Failed to start initrd-switch-root.service - Switch Root

I am using Fedora 36 and I am getting an error on boot which sends it into emergency mode.

After typing:


I get the error message:

systemd[1]: Failed to start initrd-switch-root.service - Switch Root.

After command:

systemctl status initrd-switch-root.service

I get the error message:

systemctl[628]: Failed to switch root: Specified switch root path '/sysroot' does not seem to be an OS tree. os-release file is missing.

However “/sysroot” is there and inside “/sysroot/root/etc/” there is an os-release file.

Any ideas how I can resolve this?

Same problem, using an old version of the kernel solved the issue but idk how to force it so it doesn’t try to boot into the new one every time

EDIT: found how to choose what kernel to boot: How to Change the Default Kernel on Fedora - Reisuke

Got the same issue. Are you guys using nvidia drivers? Do you guys dual boot windows?

I’m using an HP laptop with an i3-5005u no dual boot and only integrated hd graphics

EDIT: Just tried 5.19.9-200 and the problem persists, how do i prevent the kernel from getting deleted in the next update?
(Now the only one working is the third so it will be automatically deleted with the next release)

Not true
A kernel update will never delete the currently active kernel so if you are booted from the kernel that you want to keep it will remain and the oldest not in use (even if newer) will be removed.

You do however need to find out why the newer kernels are not booting.

There have been a couple instances where a kernel upgrade did not complete properly for me and the fix I found (with fedora 37 beta and kernel 5.19.9) was to remove and reinstall that kernel.

  1. sudo dnf remove kernel*5.19.9*
  2. sudo dnf upgrade --refresh
    which will reinstall that kernel.
  3. wait ~5 minutes thenreboot and it worked for me.

In my case there seemed something did not complete with the postinstall scripts and the initramfs image had not been properly built. The reinstall handled that properly.

I tried it, but it doesn’t work.
The strange thing is that the kernel writes to the screen all the things that start and stop as if it were set to verbose.
And after logging in (from boot, not user space), it gives the same error described in the op’s post.

EDIT: After looking a bit more the logs shows intrd-switch... : Triggering OnFailure= dependencies., am I missing any dependencies?

This sounds like it is not starting graphics at all, or maybe is starting in emergency mode.

Are you logging in with your user name and password in a text screen?
What happens if you use startx after you log in?

Seeing the line

However “/sysroot” is there and inside “/sysroot/root/etc/” there is an os-release file.

in the original post, I believe that the text rootflags=subvol=root could be missing from the option line. You can check that by running

grep option /boot/loader/entries/*conf

Yes indeed, it it’s just options mitigations=off, anything else. (That’s why it was verbose, there was no quet option :brain: )

Why? shouldn’t them be in the config by default?

Manually adding the other options fixed the problem, thank you.

I have been having the identical problem on my Dell XPS 9350 since kernel 5.19.8. I have been running as 5.19.7 as a work around. Today, I updated to 5.19.16 and had the same issue. When I saw the comment about missing boot options, I decided to check my own boot files:

Under /boot/loader/entries:

File *-5.19.7-200.fc36.x86_64.conf:

linux /vmlinuz-5.19.7-200.fc36.x86_64
initrd /initramfs-5.19.7-200.fc36.x86_64.img
options root=/dev/mapper/fedora_x1carbon-root ro resume=/dev/mapper/fedora_x1carbon-swap rd.luks.uuid=luks-*** rhgb quiet

File *-5.19.16-200.fc36.x86_64.conf:

linux /vmlinuz-5.19.16-200.fc36.x86_64
initrd /initramfs-5.19.16-200.fc36.x86_64.img

So it appears that the “options” portion of the entries files were cleared out around the 5.19.8 update for me. Copying the options from the 5.19.7 file to the 5.19.16 finally allowed my system to boot. I do have disk encryption active, and the disk password window doesn’t come up on 5.19.16 still. I have to press the ESC key to see the prompt, but after entering the password the boot continues fine. For now I’ll just treat that as an extra level of security. :slightly_smiling_face:

I’ve read about other people reinstalling Fedora 36 to work around the problem. I’m hopeful posting this will save people some aggravation.

This sounds like an issue with missing options in /etc/default/grub. You should check if the options in GRUB_CMDLINE_LINUX are correct, at worst you’ll have to copy them over from the previous kernel version file, located in /boot/loader/entries/[something].conf

Unfortunately those options are not located in /etc/default/grub.
They should be seen in /etc/kernel/cmdline and if not then you can copy them from the /boot/loader/entries/*5.19.7-200.fc36.x86_64.conf file and put that options line into the /etc/kernel/cmdline file. When you copy it over put everything but the word options from that line into the cmdline file.

There have been other posts about that cmdline file getting corrupted occasionally with kernel 5.19.8 or there about.