# "Root block device" error

## freeflyer

I am not sure if I am having a kernel problem or a grub problem.  I get the following error when I try to boot:

```

>> Mounting filesystems

>> Determining root device...

>> Block device /dev/hda3 is not a valid root device...

>> The root block device is unspecified or not detected Please specify a device to boot, or "shell" for a shell... boot(): 
```

contents of /boot:

```
System.map-2.6.11-gentoo-r6    grub    kernel-2.6.11-gentoo-r6     boot     initrd-2.6.11-gentoo-r6    lost+found
```

contents of grub.conf

```
default 0

timeout 30

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

title=Gentoo Linux 2.6.11-r6

root (hd0,0)

kernel /kernel-2.6.11-gentoo-r6 root=/dev/ram0 init=/inuxrc ramdisk=8192 real_root=/dev/hda3 udev

initrd /initrd-2.6.11-gentoo-r6

```

fdisk -l:

```

Disk /dev/hda: 80.0 GB, 80026361856 bytes

240 heads, 63 sectors/track, 10337 cylinders

Units = cylinders of 15120 * 512 = 7741440

      Device  Boot         Start         End        Blocks        Id       System

/dev/hda1      *                 1           5        37768+      83       Linux

/dev/hda2                        6           72       506520       82       Linux swap

/dev/hda3                       73       10337    77603400     83       Linux

```

All help will be greatly appreciated, very new to linux so please be explicit with details.Last edited by freeflyer on Sun Jun 18, 2006 6:41 am; edited 1 time in total

----------

## cyblord

would you mind posting your /etc/fstab file?

thanks

----------

## freeflyer

Sure, here is my fstab:

```

/dev/hda1                  /boot              ext2       noauto, noatime       1 1

/dev/hda3                  /                    xfs         noatime             0 0

/dev/hda2                  none              swap         sw                    0 0

/dev/cdroms/cdrom0   /mnt/cdrom     iso9660   nauto, user                      0 0

none             /proc         proc         defaults                           0 0

none             /dev/shm     tmpfs     defaults                               0 0 

```

Sorry, I'm having trouble formating this correctly.

----------

## mieses

Could this grub error result from XFS not being compiled into the kernel?

/dev/hda3 is an XFS filesystem.

How to check if the kernel has XFS support?

----------

## cyblord

I'm almost certain that this has something to do with your grub.conf file.

the section where it says:

```

root (hd0,0) 

```

"Dont forget GRUB references the first partition of your hard disk as hd0,0 and not hd0,1. GRUB also references SATA disks using the same notation i.e. hd0,1. If you are not sure which partitions boot and root lives in then use fdisk l to remind yourself of your disk partitioning scheme and, if you are still unsure, df h which will display your partitions and where they are mounted."

try

```

root (hd0,4) 

```

----------

## mieses

wouldn't /dev/hda3 be (hd0,2)?

----------

## cyblord

erm... I'm not quite sure...   :Razz: 

if 0,4 doesn't work, try some other ones like 0,2

----------

## freeflyer

Okay, trying various I get the following, these errors occur directly after the Grub selection screen:

```
root (hd0,1)

  Filesytem type unknown, partition type 0X82

kernel /kernel-2.6.11-gentoo-r6 root=/dev/ram0

init=/linuxrc ramdisk =8192 real_root=dev/hda3 udev

Error17: Cannot mount selected partition
```

```
root (hd0,2)

  Filesystem type is xfs, partition type 0X83

kernel /kernel-2.6.11-gentoo-r6 root=/dev/ram0

init=/linuxrc ramdisk =8192 real_root=dev/hda3 udev

Error 15: File not found
```

next 0,3

```
root (hd0,3)

Error 22: No such partition
```

(0,4) and (0,5) give the same error as (0,3).  Thanks for the responses.

----------

## cyblord

 *freeflyer wrote:*   

> 
> 
> [code]root (hd0,2)
> 
>   Filesystem type is xfs, partition type 0X83
> ...

 

so now we know that (hd0,2) is your root partition.

It says "file now found".  it's refering to your kernel. 

in your grub.conf, there's a critical error.

[code]

kernel /kernel-2.6.11-r6

[/code]

your kernel is usually located in /boot.

make sure the firename is correct in the grub.conf file.

----------

## mieses

gentoo documentation on Grub Error 15 -

http://www.gentoo.org/doc/en/grub-error-guide.xml#doc_chap4

[edit]

This error falls into the case "Solution - Booting an Entry" in the Gentoo documentation above.

http://www.gentoo.org/doc/en/grub-error-guide.xml#doc_chap4_sect3

But it would be good to verify the naming of the kernel file just in case.

[/edit]Last edited by mieses on Sun Jun 18, 2006 6:24 am; edited 1 time in total

----------

## freeflyer

Looking at the mountpoint where I have mounted /dev/hda1 I get the following after "ls -al":

```

total 4156

drwxr-xr-x    4 root     root           1024 Jun 17 06:28 .

drwxr-xr-x    21 root    root           4096 Feb 15 2004 ..

-rw-r--r--     1 root    root              0 Mar 11 2005 .keep

-rw-------     1 root    root         774048 Mar 23 09:48 System.map-2.6.11-gentoo

-r6

lrwxrwxrwx     1 root     root             1 May  9  2005 boot -> .

drwxr-xr-x     2 root     root          1024 Jun 18 05:42 grub

-rw-r--r--     1 root     root       1852783 Mar 23 10:00 initrd-2.6.11-gentoo-r6

-rw-r--r--     1 root     root       1576856 Mar 23 09:48 kernel-2.6.11-gentoo-r6

drwx--------   2 root     root         12288 May  9  2005 lost+found
```

This is perhaps a more revealing version of some code in my first post.

----------

## mieses

in the first post,  you mentioned that grub.conf contains:

```
kernel /kernel-2.6.11-r6 root=/dev/ram0 init=/inuxrc ramdisk=81192 real_root=/dev/hda3 udev 
```

but the actual file is named 

```
kernel-2.6.11-gentoo-r6
```

cyblord is right about the mis-naming.

change the name in grub.conf so that it matches the actual file name.

----------

## freeflyer

Left out a bit of code in the first post of grub.conf, I will edit the top code so that it looks like this, what is actually in grub.conf:

```
default 0

timeout 30

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

title=Gentoo Linux 2.6.11-r6

root (hd0,2)

kernel /kernel-2.6.11-gentoo-r6 root=/dev/ram0 init=/inuxrc ramdisk=8192 real_root=/dev/hda3 udev

initrd /initrd-2.6.11-gentoo-r6
```

Note that I now have (hd0,2) in grub.conf.  Sorry for the mistake and thanks for the responses.

----------

## Talchas

It should be root (hd0,0) because for grub root is your /boot partition, as that is where your kernels are. If you didn't have a /boot partition (if it was just a directory on /), then you would use (hd0,2), but you have a separate partition. Your orginal error message says that your kernel is being booted by grub just fine, its only runing into problems after mounting the initrd. As mieses said, check if your kernel has XFS support built in (not as a module).

----------

## mieses

If you have the kernel-config for this kernel,  you can determine if XFS support was compiled in.  Kernel config files are in /etc/kernels.

If XFS support is not included,  then your next step is to boot with a livecd, chroot, and recompile the kernel with XFS support.

Does anyone know if it is possible to determine a kernel's features without viewing the kernel-config?

----------

## Talchas

I know you can compile the config into the kernel if you choose an option (I always do this in case I lose the config), other than that I don't know.

----------

## freeflyer

I recompiled the kernel using genkernel and made sure the XFS filesystem is supported.  GRUB is looking at (hd0,0).  Note, I used a recent LiveCD to do this, 2006.0.  The same error as I initially reported was returned to me.  Thanks for all the great responses, if anyone from this point has any further ideas please let me know.

----------

## freeflyer

It did not seem reasonable to try and get around this error given the above attempts.  I have since saved files from the computer and am in the process of reinstalling gentoo.  Thanks for all the responses.

----------

