Mount root filesystem from initramfs

bootinitramfsopensuseroot-filesystemstartup

It's a common scenario. For whatever reason, the initramfs (OpenSUSE, in case it matters) has failed to find the root filesystem, so it drops you into a rescue shell. I know perfectly well what device needs to be mounted though. My question:

What is the correct procedure to mount the root filesystem and continue the boot sequence?

Presumably that's the whole point of the rescue console. And yet, nobody seems to have documented how you actually do this.

Obviously I can mount the root filesystem somewhere. But how do I make that the root of the filesystem tree? And now do I continue the normal boot process after that? (I thought just exiting the shell would do it… but it doesn't.) What exactly do you need to get mounted before you continue, and how do you continue?

Best Answer

exec switch_root /mnt/root /sbin/init

https://wiki.gentoo.org/wiki/Custom_Initramfs#Init

Related Question