# [solved]!! block device /dev/sda3 is not a valid root device

## holyprick

Hi,

I have compiled linux-2.6.27-gentoo-r2 with "genkernel all", then in grub.conf I added the very same lines about the default kernel installed by gentoo 2008 (2.6.24-gentoo-r5 I think). But when I try to boot this new kernel, after it has loaded some modules I get the error

!! block device /dev/sda3 is not a valid root device

!! could not find the root block device in

Then I tried to compile the kernel with "genkernel --menuconfig all", and this time I added some more scsi modules and I also added doscsi in the USE, but it changed nothing  :Sad: 

Here is my grub.conf :

default 0

timeout 10

splashimage=(hd0,0)/grub/robin.xpm.gz

title=Gentoo Linux 2.6.27

root (hd0,0)

kernel /kernel-genkernel-x86-2.6.27-gentoo-r2 root=/dev/ram0 init=/linuxrc ramdisk=8192 real_root=/dev/sda3  doscsi

initrd /initramfs-genkernel-x86-2.6.27-gentoo-r2

title=Gentoo Linux 2.6.24

root (hd0,0)

kernel /kernel-genkernel-x86-2.6.24-gentoo-r5 root=/dev/ram0 init=/linuxrc ramdisk=8192 real_root=/dev/sda3  doscsi

initrd /initramfs-genkernel-x86-2.6.24-gentoo-r5

title=Windows XP

rootnoverify (hd1,0)

makeactive

chainloader +1

boot

And here is my fstab :

/dev/sda2        none            swap            sw              0 0

/dev/sda1        /boot   ext3    defaults                1 2

/dev/sda3        /       ext3    defaults                0 1

none        /proc     proc    defaults          0 0

none        /dev/shm  tmpfs   defaults          0 0

How can I get the kernel to boot?

Many Thanks in advance for your help  :Very Happy: Last edited by holyprick on Sat Nov 29, 2008 2:31 pm; edited 1 time in total

----------

## jburns

See https://forums.gentoo.org/viewtopic-t-663206.html and also the topics that it links to.  The best way is to label the partitions.  When you build the kernel using genkernel use the --disklabel option.

The cause of the problem could be including the old disk drivers which changes /dev/sda3 to /dev/hda3 or it could be a change in the order the kernel detects the /dev/sd.. devices which could change /dev/sda3 to /dev/sdb3 or some other name.  Using partition labels will make the device name a don't care.

When you get the error from the kernel it tells you how to get to a shell where you can do a "ls /dev" to see what devices have been assigned by the kernel.

The other possibility is that the kernel does not have a driver for the disk.

----------

## holyprick

Thank you for your response.

I'm going to rebuild my kernel using the genkernel option "--disklabel". I'll tell you if it works.

Anyway when I got the error and when I asked for a shell, I typed "ls /dev" and my disk were assigned hda1 etc. So I tried to replace /dev/sda3 by /dev/hda3 in the grub.conf. But this time I got an error about the superblock which has been corrupted or something like that  :Confused: 

----------

## holyprick

When I tried to start the kernel build with the disklabel option, it has kept telling that the block device isn't a valid root device.

I also tried to rebuild the kernel with

CONFIG_SATA_AHCI=y

CONFIG_SATA_VIA=y (I think my motherboard is a VIA one, at leat lspci told me it was..)

But it changed nothing except when I run "ls /dev" in the shell provided by the error, I had only hdc  :Confused: 

No hda or sda or anything which look like a disk.

I have the source of the kernel linux-2.6.25-gentoo-r9, I'm going to try to build it to see if I get the same error. But if you have any advice to make the linux-2.6.27-gentoo-r2 kernel work, I would by very happy  :Very Happy: 

----------

## jburns

If you have ATA/ATAPI/MFM/RLL support enabled disable it.  This should get rid of the drivers that are using /dev/hd... 

You should also select the PATA driver for your disk controller.

In your /etc/fstab file did you change the entries from /dev/sda.. to LABEL=... or UUID=... formats.

----------

## holyprick

I've changed the entries in the /etc/fstab file before building the kernel with the disklabel option.

About the ATA/ATAPI/MFM/RLL support, I tried to disable it once, but I think I disabled the wrong option  :Embarassed: 

Can you tell me which one(s) I should disable please?

----------

## jburns

To disable the old drivers CONFIG_IDE should be reset

To provide the new driver for the IDE interface CONFIG_PATA_VIA should be set

CONFIG_SATA_AHCI and CONFIG_SATA_VIA provide drivers for the SATA interface.

----------

## holyprick

Thank you very much, it works  :Very Happy: 

----------

