[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: "Waiting for root file system ..."



Niu Kun wrote:

>> and last but not least it's pretty tricky to boot broken initram but not
>> too hard if you know the steps.
>>   
> Would you please say something about this?
> Or any useful link that can be referenced?
>> regards

First of all I would try to provide the root kernel option. If you know your
root is now on sdb1 you could say root=/dev/sdb1 (see step 1 below). This
should work.

The harder way is, assuming you have bootable kernel and initrd, to run the
shell instead of executing the init file

1) you have something in the bootloader (here grub as example)

root            (hd0,0)
kernel          /vmlinuz-2.6.30eko2 quiet ro splash
initrd          /initrd-2.6.30eko2

1a) press 'e' for edit

1b) move to kernel line and press 'e' for edit again

1c) write at the end of the line

        init=/bin/sh

1d) press enter

1e) press "b" (for boot)

=> you are in the limited shell

2) here identify your disk (start mds. lvm crypt or whatever)
        mount -t proc none /proc

3) mount root somewhere 
        mkdir /new
        mount -ro <path_to_your_root> /new
        cd /new

4) (you could actually do anything with your system at this stage, because
you have all the commands, so) type following to run through the boot
process

exec /usr/sbin/chroot . /bin/sh <<- EOF >dev/console 2>&1
exec /sbin/init ${CMDLINE}
EOF

the three lines above are just great. I don't remember if it was used before
in debian or somewhere else, where I've got it years ago.

now debian is using

exec run-init ${rootmnt} ${init} "$@" <${rootmnt}/dev/console
>${rootmnt}/dev/console

Which you may prefer, but have to decifer what all those variables are good
for

5) after booting your system recreate initrd (update/mkinitramfs)
        (watch out to backup the initrd with which you could at least reach the
limited shell), so if the new one does not work you can repeat the
procedure.

I hope this helps

regards






Reply to: