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:

journalctl

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.