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

Bug#475958: document procedure to recover from "/dev/hda became /dev/sda" boot failure



Hi,

I have written something addressing this issue. I give it with all the rights under the term of the GPLv2.

Please let me know if something is wrong or badly written.

Even if I was unable to reproduce this bug, I tried to simulate it and tested successfully the 2 first solutions. The solution 3 being very similar to solution 2.

Hope this help.
Giovanni


Title : boot hangs on 'Waiting for root file system'
Title : recover from "/dev/hda became /dev/sda" boot failure

Some users have reported that an upgrade could cause the kernel not finding
the system root partition after a system reboot.

In such case, the system boot will hang on the following message:
 Waiting for root file system ...
and after a few seconds a bare busybox prompt will show.

This problem can occur when the upgrade of the kernel introduces the use of
the new generation of IDE drivers. The IDE disk naming convention for the
old drivers was hda, hdb, hdc, hdd. The new drivers will name the same disks
respectively sda, sdb, sdc, sdd. The problem appears when the upgrade does not
generate a new '/boot/grub/menu.lst' file to take the new naming convention
into account. During the boot, Grub will pass a system root partition to the
kernel that the kernel doesn't find.

There are several ways to recover from such a problem.

Solution 1 :
This is applicable when Grub shows you the menu interface for selecting
the entry you want to boot from. If such menu does not appear, try
pressing 'ESC' key before the kernel boots in order to make it appear.
If you can't get into this menu, try solution 2 or 3.

In the Grub menu, highlight the entry you want to boot from. Press 'e' key
to edit the options related to this entry. You will see something like :
  root (hd0,0)
  kernel /vmlinuz-2.6.26-1-686 root=/dev/hda6 ro
  initrd /initrd.img-2.6.26-1-686

Highlight the line
  kernel /vmlinuz-2.6.26-1-686 root=/dev/hda6 ro

press 'e' key and replace 'hdX' with 'sdX' ('X' being the letter 'a','b',
'c' or 'd' depending of your system), In my example the line becomes:
  kernel /vmlinuz-2.6.26-1-686 root=/dev/sda6 ro

Then press 'ENTER' to save the modification. If other lines show 'hdX',
change these line too. Don't modify the entry similar to 'root (hd0,0)'.
Once all modifications are done, press 'b' key. And your system should now
boot as usual.

If this solution worked. Login to your system, make a backup of the
'/boot/grub/menu.lst' file. Then generate a new '/boot/grub/menu.lst'
by issuing with root privileges the command:
  update-grub

Edit '/boot/grub/menu.lst' and make sure all occurences of 'hdX' were replaced
by 'sdX'. There is nothing wrong with the lines similar to:
  root            (hd0,0)
just leave it as it is.

Reboot your system, it should reboot correctly.

Solution 2 :
Boot from a debian installation media (cd/dvd) and when prompt, type
'rescue' to launch the rescue mode. Select your language, location, keyboard
mapping, let it configure the network no matter if it success or not. After a
while, you should be asked for selecting a partition you want to use as root
file system. The proposed choices will look something like:
 /dev/ide/host0/bus0/target0/lun0/part1
 /dev/ide/host0/bus0/target0/lun0/part2
 /dev/ide/host0/bus0/target0/lun0/part5
 /dev/ide/host0/bus0/target0/lun0/part6

If you know which partition is your root file system, choose the right one. If
you don't, just try with the first. If it complains about an invalid root file
system partition, try the next one, and so on. Trying one after the other
shouldn't arm your partitions and if you have only one system installed on your
disks, you should easily find the right root file system partition. If you have
many systems installed on your disks, it would be better to know exactly which
is the right partition.

Once you have choosen a partition, you will be proposed among several actions.
Make the choice of executing a shell in the selected partition. If it complains
that it cannot do that then try with another partition.

Now you should have shell access as user root on your root file system
mounted on '/'. You need access to the /boot, /sbin and /usr directories
content. If these directories need to be mounted from other partitions, do it.
(see '/etc/fstab' if you have no idea of which partition to mount)

Make a backup of the '/boot/grub/menu.lst' file. Then generate a new
'/boot/grub/menu.lst' by issuing with root privileges the command:
  update-grub

Edit '/boot/grub/menu.lst' and make sure all occurences of 'hdX' ( 'X' being
the letter 'a','b','c' or 'd' depending of your system) were replaced by 'sdX'.
There is nothing wrong with the lines similar to:
  root            (hd0,0)
just leave it as it is.

Type 'exit' to leave the rescue shell
Then reboot your system, it should reboot correctly.

Solution 3 :
Boot from your favorite LiveCD distribution (Knoppix, Kaella, ...).
Mount the partition where your '/boot' directory is. If you don't know which
one it is, use the output of the command:
  dmesg
to find whether your disk is known as hda, hdb, hdc, hdd or sda, sdb, sdc, sdd.
Once you know which disk to work on, for example sdb, issue the following
command to see the partition table of the disk and to find the right partition:
  fdisk -l /dev/sdb

Assuming that you have mounted the right partition under '/mnt' and
that this partition contains the '/boot' directory and its content,
edit the '/mnt/boot/grub/menu.lst' file.

Find the section similar to:
  ## ## End Default Options ##

  title           Debian GNU/Linux, kernel 2.6.26-1-686
  root            (hd0,0)
  kernel          /vmlinuz-2.6.26-1-686 root=/dev/hda6 ro
  initrd          /initrd.img-2.6.26-1-686

  title           Debian GNU/Linux, kernel 2.6.26-1-686 (single-user mode)
  root            (hd0,0)
  kernel          /vmlinuz-2.6.26-1-686 root=/dev/hda6 ro single
  initrd          /initrd.img-2.6.26-1-686

  ### END DEBIAN AUTOMAGIC KERNELS LIST

and replace every hda, hdb, hdc, hdd respectively with sda, sdb, sdc, sdd.
Don't modify the line similar to:
  root            (hd0,0)

Reboot the system, remove the LiveCD and your system should boot correctly.
If it boots correctly, login, make a backup of the '/boot/grub/menu.lst' file
Then generate a new '/boot/grub/menu.lst' by issuing with root privileges
the command:
  update-grub

Edit '/boot/grub/menu.lst' and make sure all occurences of 'hdX' ( 'X' being
the letter 'a','b','c' or 'd' depending of your system) were replaced by 'sdX'.
There is nothing wrong with the lines similar to:
  root            (hd0,0)
just leave it as it is.

Reboot your system, it should reboot correctly.



Reply to: