LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - General (https://www.linuxquestions.org/questions/linux-general-1/)
-   -   Booting from initramfs shell using switch_root in Debian (https://www.linuxquestions.org/questions/linux-general-1/booting-from-initramfs-shell-using-switch_root-in-debian-4175594958/)

Progzmaster 12-07-2016 02:27 AM

Booting from initramfs shell using switch_root in Debian
 
Dear All,

My Debian system does not boot due to grub issue. I booted a SystemRescueCD which fails to run the existing system, because it can not find /sbin/init, none the less it exists.
It dropped me into the initramfs shell, where I am PID 1. I can mount the rootfs witch is on an LVM volume and the LVM itself is on MD RAID, so all these are recognized by the initrfamfs system.

So I tried the following:
Code:

mount /dev/vgbgy/rootfs /newroot
exec switch_root /newroot /sbin/init

After this, the system hangs, cursor blinks without any output, seems there is no activity at all. I can reboot with ctrl-alt-del. Googling around it seems that a few people ran into this problem, but I can't find a proper solution.

Any help would be appreciated.

Thank you in advance!

EDIT:
"SystemRescueCD fails to run the existing system":
I have choosen the "Boot existing system" (or similarly named) option from the boot menu, which has an "root=auto" option in the kernel command line. After that I explicitly specified the valid root device "root=/dev/vgbgy/rootfs". Both attemps end up in that SRCd tries to mount the filesystem and complains that it can not find "/sbin/init".
This repeats three times, then drops me into the shell. I can then mount the rootfs with the above command, and certainly the /sbin/init file exists (which is actually a symlink to /lib/systemd/systemd). The raid and lvm volumes are certainly recognized before SRCd tries to mount the LV, so I don't know why it fails to boot.

However I also don't know why I can't boot manually using switch_root mentioned above.

c0wb0y 12-07-2016 12:14 PM

Did you check if '/sbin/init' actually exists on the borked system?
Try chroot'ing into the broken system and reinstall grub from there

Jjanel 12-08-2016 01:47 PM

I never figured out why slacko5.7 N270cpu VBox hung on switch_root. Do you have strace?
I'm not sure if: strace exec sw... OR exec strace sw... [-f -o] would show anything.
Somewhere mentioned: mount--move dev sys proc to /newroot, but I doubt that's it.

>"reinstall grub": I'd love to know if BRD.iso 'auto-magically fixes ALL'! Let us know!


All times are GMT -5. The time now is 04:14 AM.