LinuxQuestions.org
Visit Jeremy's Blog.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - General
User Name
Password
Linux - General This Linux forum is for general Linux questions and discussion.
If it is Linux Related and doesn't seem to fit in any other forum then this is the place.

Notices


Reply
  Search this Thread
Old 12-07-2016, 02:27 AM   #1
Progzmaster
LQ Newbie
 
Registered: Dec 2016
Location: Hungary
Distribution: Debian
Posts: 1

Rep: Reputation: Disabled
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.

Last edited by Progzmaster; 12-07-2016 at 03:50 AM.
 
Old 12-07-2016, 12:14 PM   #2
c0wb0y
Member
 
Registered: Jan 2012
Location: Inside the oven
Distribution: Windows
Posts: 417

Rep: Reputation: 74
Did you check if '/sbin/init' actually exists on the borked system?
Try chroot'ing into the broken system and reinstall grub from there
 
Old 12-08-2016, 01:47 PM   #3
Jjanel
Member
 
Registered: Jun 2016
Distribution: any&all, in VBox; Ol'UnixCLI; NO GUI resources
Posts: 999
Blog Entries: 12

Rep: Reputation: 363Reputation: 363Reputation: 363Reputation: 363
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!

Last edited by Jjanel; 12-08-2016 at 01:48 PM.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
initramfs - switch_root unable to load new rootfs ExternalUse Linux - Kernel 2 02-11-2015 08:51 AM
Booting into initramfs after upgrade.. Doomhammer Linux - Server 1 10-02-2009 10:19 AM
Kernel Booting Slow - initramfs - Ubuntu 7.04 bench Linux - Laptop and Netbook 4 07-26-2007 02:40 PM
quik booting 2.6 kernel and initramfs risu Linux - Kernel 0 09-16-2006 05:00 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - General

All times are GMT -5. The time now is 05:41 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration