My LFS Hint appears to be sitting in the moderation queue...so here it is.
AUTHOR: Stephen West <stephen.george.west@gmail.com>
DATE: 2011-06-03
LICENSE: GNU Free Documentation License Version 1.2
SYNOPSIS: VFS: Cannot open root device "hda1" or unknown-block(2,0)
DESCRIPTION:
Hint to get past a kernel panic on boot, due to a difference in the way
hard disks are reported by the LFS live cd 2.6.22 kernel and the compiled
2.6.38 kernel. The symptom is a crash at boot with this error:
>VFS: Cannot open root device "hda1" or unknown-block(2,0)
>Please append a correct “root=” boot option;
PREREQUISITES:
A nearly finished LFS install that crashes on boot with a "VFS: ..." error as
stated in the synopsis.
HINT:
For some reason the kernel(2.6.22.5) on LFS version 6.8 reports the hard disks
differently than the compiled kernel(2.6.37). Perhaps, the LFS kernel is
using using the legacy ATA driver and not libATA which was introduced 2.6.20.
http://justlinux.com/forum/showthread.php?t=149316
http://www.google.com/search?q=hda+vs.+sda+(%3C2.6.20)
The main symptom is a crash at boot, with an error message similar to:
>VFS: Cannot open root device "hda1" or unknown-block(2,0)
>Please append a correct “root=” boot option;
Most of the google searches end up with the conclusion that either the
initramfs was not built or that the filesystem was not compiled into the
kernel. After much searching and trying to include more drivers in the kernel,
I noticed the available partitions below the error were rather familiar, but
not quite what I expected. I saw:
>sda1 00000-000-00-0-0
>sda2 000...
>sda5 000...
where I was expecting:
>hda1 52b74591-....
>hda2 …
>hda5 ...
So I changed things I didn’t fully understand. Edited the boot command from:
>linux /boot/vmlinux-2.6.37-lfs-6.8 root=/dev/hda1 ro
to:
>linux /boot/vmlinux-2.6.37-lfs-6.8 root=/dev/sda1 ro
And violia!
>Init: version 2.88 booting.
Dang! Success is short lived.
>swapon: dev/hda5: stat failed: no such file or directory [Fail]
>Mounting rroot file system in read-only mode... [ Ok ]
>fsck.ext3: No such file or directory while trying to open /dev/hda1
>Possibly non-existent device? [Fail]
>FAILURE...
Time to update $LFS/etc/fstab based on the same guess as before,
from:
>/dev/hda1 / ...
>/dev/hda5 swap ...
to:
>/dev/sda1 / ...
>/dev/sda2 swap ...
I rebooted and the system came up.
After I re-ran grub-mkconfig, all the hda references in /boot/grub/grub.cfg
were updated to sda.
grub.cfg(old) contained the lines:
>...
>set root='(hd0,1)'
>...
>linux /boot/vmlinux-2.6.37-lfs-6.8 root=/dev/hda1 ro
>...
grub.cfg(new) contained the lines:
...
set root='(/dev/sda1,1)'
...
linux /boot/vmlinux-2.6.37-lfs-6.8 root=/dev/sda1 ro
...
CHANGELOG:
[2011-06-03]
* Initial hint.