# VFS: Unable to mount root fs on unkown-block(0,0)

## deathiv

I am new to Gentoo, and after following the handbook I got the error VFS: Unable to mount root fs on unkown-block(0,0) after googling the problem and looking through these forums it seems that the problem is not having the hardware driver installed, so I used lspci -k and got the following output 

```
00:00.0 Host bridge: Intel Corporation Mobile 4 Series Chipset Memory Controller Hub (rev 09)

Subsystem: Gateway 2000 Device 0704

00:02.0 VGA compatible controller: Intel Corporation Mobile 4 Series Chipset Integrated Graphics Controller (rev 09)

Subsystem: Gateway 2000 Device 0704

00:02.1 Display controller: Intel Corporation Mobile 4 Series Chipset Integrated Graphics Controller (rev 09)

Subsystem: Gateway 2000 Device 0704

00:1a.0 USB controller: Intel Corporation 82801I (ICH9 Family) USB UHCI Controller #4 (rev 03)

Subsystem: Gateway 2000 Device 0704

00:1a.1 USB controller: Intel Corporation 82801I (ICH9 Family) USB UHCI Controller #5 (rev 03)

Subsystem: Gateway 2000 Device 0704

00:1a.2 USB controller: Intel Corporation 82801I (ICH9 Family) USB UHCI Controller #6 (rev 03)

Subsystem: Gateway 2000 Device 0704

00:1a.7 USB controller: Intel Corporation 82801I (ICH9 Family) USB2 EHCI Controller #2 (rev 03)

Subsystem: Gateway 2000 Device 0704

00:1b.0 Audio device: Intel Corporation 82801I (ICH9 Family) HD Audio Controller (rev 03)

Subsystem: Gateway 2000 Device 0704

00:1c.0 PCI bridge: Intel Corporation 82801I (ICH9 Family) PCI Express Port 1 (rev 03)

00:1c.2 PCI bridge: Intel Corporation 82801I (ICH9 Family) PCI Express Port 3 (rev 03)

00:1c.5 PCI bridge: Intel Corporation 82801I (ICH9 Family) PCI Express Port 6 (rev 03)

00:1d.0 USB controller: Intel Corporation 82801I (ICH9 Family) USB UHCI Controller #1 (rev 03)

Subsystem: Gateway 2000 Device 0704

00:1d.1 USB controller: Intel Corporation 82801I (ICH9 Family) USB UHCI Controller #2 (rev 03)

Subsystem: Gateway 2000 Device 0704

00:1d.2 USB controller: Intel Corporation 82801I (ICH9 Family) USB UHCI Controller #3 (rev 03)

Subsystem: Gateway 2000 Device 0704

00:1d.7 USB controller: Intel Corporation 82801I (ICH9 Family) USB2 EHCI Controller #1 (rev 03)

Subsystem: Gateway 2000 Device 0704

00:1e.0 PCI bridge: Intel Corporation 82801 Mobile PCI Bridge (rev 93)

00:1f.0 ISA bridge: Intel Corporation ICH9M LPC Interface Controller (rev 03)

Subsystem: Gateway 2000 Device 0704

00:1f.2 SATA controller: Intel Corporation 82801IBM/IEM (ICH9M/ICH9M-E) 4 port SATA Controller [AHCI mode] (rev 03)

Subsystem: Gateway 2000 Device 0704

00:1f.3 SMBus: Intel Corporation 82801I (ICH9 Family) SMBus Controller (rev 03)

Subsystem: Gateway 2000 Device 0704

02:00.0 Network controller: Atheros Communications Inc. AR928X Wireless Network Adapter (PCI-Express) (rev 01)

Subsystem: Foxconn International, Inc. T77H053.00 802.11bgn Wireless Mini PCIe Card [AR9281]

06:00.0 Ethernet controller: Marvell Technology Group Ltd. 88E8057 PCI-E Gigabit Ethernet Controller (rev 10)

Subsystem: Gateway 2000 Device 0704

07:09.0 Mass storage controller: O2 Micro, Inc. Integrated MS/xD Controller (rev 03)

Subsystem: Gateway 2000 Device 0704

07:09.2 SD Host controller: O2 Micro, Inc. Integrated MMC/SD Controller (rev 02)

Subsystem: Gateway 2000 Device 0704
```

So I compiled in ICH and ICH-M drivers, and all the AHCI SATA drivers aswell as all the Intell SATA drivers that were in the --> Device Drivers area. 

What do I do to fix the problem after this since it is persisting?

----------

## Jaglover

deathiv, welcome to the forums!

After you have enabled support for your HDD controller you also have to make sure you have SCSI disk support enabled and support for partition table used (GPT or MBR).

http://kmuto.jp/debian/hcl/ will help, too.

----------

## BillWho

deathiv,

Can you paste your /etc/fstab file and the /boot/grub/menu.lst or grub.cfg file   :Question: 

I forget what the grub menu list file is called since I don't use gentoo's  :Embarassed: 

----------

## deathiv

 *BillWho wrote:*   

> deathiv,
> 
> Can you paste your /etc/fstab file and the /boot/grub/menu.lst or grub.cfg file?
> 
> I forget what the grub menu list file is called since I don't use gentoo's. 

 

```
# /etc/fstab: static file system information.

#

# noatime turns off atimes for increased performance (atimes normally aren't

# needed); notail increases performance of ReiserFS (at the expense of storage

# efficiency). It's safe to drop the noatime options if you want and to

# switch between notail / tail freely.

#

# The root filesystem should have a pass number of either 0 or 1.

# All other filesystems should have a pass number of 0 or greater than 1.

#

# See the manpage fstab(5) for more information.

#

# <fs> <mountpoint> <type> <opts> <dump/pass>

# NOTE: If your BOOT partition is ReiserFS, add the notail option to opts.

/dev/sda1 /boot ext2 noauto,noatime 1 2

/dev/sda3 / ext3 noatime 0 1

/dev/sda2 none swap sw 0 0

/dev/cdrom /mnt/cdrom auto noauto,user 0 0

/dev/fd0 /mnt/floppy auto noauto 0 0
```

Menu.lst

```
# This is a sample grub.conf for use with Genkernel, per the Gentoo handbook

# http://www.gentoo.org/doc/en/handbook/handbook-x86.xml?part=1&chap=10#doc_chap2

# If you are not using Genkernel and you need help creating this file, you

# should consult the handbook. Alternatively, consult the grub.conf.sample that

# is included with the Grub documentation.

default 0

timeout 30

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

title Gentoo Linux 3.2.12

root (hd0,0)

kernel /boot/kernel-3.2.12-gentoo root=/dev/sda3

title Gentoo Linux 3.2.12 (rescue)

root (hd0, 0)

kernel /boot/kernel-3.2.12-gentoo root=/dev/sda3 init=/bin/bb

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

# vim:ft=conf:
```

Thank you Jaglover, after checking through the drivers shown there I was able to enable wireless internet, and HD sound drivers, however after when I booted I still got the same error.

----------

## BillWho

deathiv,

Since you have a separate /boot partition, the kernel line should not be preceded with /boot. Try this:

```
default 0

timeout 30

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

title Gentoo Linux 3.2.12

root (hd0,0)

kernel /kernel-3.2.12-gentoo root=/dev/sda3

title Gentoo Linux 3.2.12 (rescue)

root (hd0, 0)

kernel /kernel-3.2.12-gentoo root=/dev/sda3 init=/bin/bb

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

```

This is what my line looks like for grub2

```
   linux /kernel root=UUID=b3bfd853-2f66-4946-9a08-428af6f50ba1 rootfstype=ext3 vga=794

   initrd /initramfs

```

I'm not sure about the splashimage line. If it gives you a  problem, just comment it for now.

Good luck   :Wink: 

----------

## deathiv

The corrected splashimage line shows the image now, but I still get the error 

not syncing: VFS: Unable to mount root fs on unknown-block(0,0)

My boot partition is Sda1 so it should be (0,0) right because it counts from 0 rather than a and 0 rather than one for drives?

----------

## jburns

The device numbers are defined in /usr/src/linux/Documentation/devices.txt

Your .config should have 

```
CONFIG_HAVE_IDE=y

# CONFIG_IDE is not set

#

# SCSI device support

#

CONFIG_SCSI_MOD=y

CONFIG_SCSI=y

CONFIG_SCSI_DMA=y

CONFIG_SCSI_PROC_FS=y

#

# SCSI support type (disk, tape, CD-ROM)

#

CONFIG_BLK_DEV_SD=y

CONFIG_BLK_DEV_SR=y

CONFIG_BLK_DEV_SR_VENDOR=y

CONFIG_CHR_DEV_SG=y

```

It should also have the drivers for your disk drive built in.

----------

## NeddySeagoon

deathiv,

Welcome to Gento.

Your grub setup is fine. It loads your kernel, which is all its supposed to do.

```
VFS: Unable to mount root fs on unkown-block(0,0) 
```

tells that your kernel cannot communicate with your hard drive, so you have a kernel problem. Your /etc/fstab has yet to be read, so if you have problems there you won't know until the kernel is fixed.

You only have a 

```
00:1f.2 SATA controller: Intel Corporation 82801IBM/IEM (ICH9M/ICH9M-E) 4 port SATA Controller [AHCI mode] (rev 03)
```

It even says your BIOS is set to AHCI mode which is correct too.  Check your kernel for the following settings:-

```
< > ATA/ATAPI/MFM/RLL support (DEPRECATED)  --->

-*- SCSI device support 

[*] legacy /proc/scsi/ support 

<*> SCSI disk support

<*> Serial ATA and Parallel ATA drivers  --->

[*]   ATA ACPI Support

<*>   AHCI SATA support
```

The first one must be off.

You will also need some or all of the following, all is harmless:-

```
[*]   PC BIOS (MSDOS partition tables) support 

[*]   EFI GUID Partition support

 <*> Ext3 journalling file system support 
```

These settings must not be <M> as the kernel needs these items to mount the root filesystem before it can load any modules.

If you change anything in make menuconfig, rebuild and reinstalll your kernel.

Hint: menuconfig has a search function - press /

----------

## VoidMage

'legacy /proc/scsi/ support' is most likely not needed.

----------

## deathiv

I had those drivers installed from looking up the error on the forums previously. They seem not to be the problem, so is there a driver that I am missing other than the ones that you mentioned? Are there drivers which I should deselect that are currently selected for it to work?

----------

## NeddySeagoon

deathiv,

Installed as <*>  ?

Did you rebuild and reinstall your kernel ?

Lets check some file names and timestamos.

In your chroot, look at

```
ls -l /usr/src/linux/.config
```

what is the date and time on the file?

This file should be the oldest as the kernel is built from it.

Next,

```
 ls -l /usr/src/linux/arch/x86/boot/bzImage
```

this is the kernel binary file.

As its made using the .config file it must be newer, or the .config has been changed since the kernel was made.

We know the kernel you are loading is called /boot/kernel-3.2.12-gentoo.

What is the timestamp on /boot/kernel-3.2.12-gentoo ?

It should be the same as the timestamo in bzImage above.

Do you have a file called lost+found in /boot ?  you should do

Is there a kernel file there but no grub directory?

That indicates you did not mount the boot partition before you installed a kernel, so grub still loads the old kernel.

Do you have several kernels in /boot where you expected only one?

If everything checks out, make friends with wgetpaste.  

```
emerge wgetpaste
```

wgetpaste puts things on the web from the command line.

```
ls -l /boot | wgetpaste

wgetpaste /boot/grub/grub.conf

wgetpaste /usr/src/linux/.config
```

 will all be good.  Tell us the URLs you get back

----------

## BillWho

deathiv,

Also check 

```
gentoo linux # grep CONFIG_EXT3_FS .config

CONFIG_EXT3_FS=y

```

It's under filesystems if it's not set correctly. Prompt: Ext3 journalling file system support

----------

## Logicien

Here I have a comment. For those who do not know how to use a separate /boot partition from the root partition / , refrain to use it.

----------

## deathiv

Yes to the first one, the second one also, bzimage is may 30, 33:11

The /boot/kernel-3.2.12-gentoo is marked as may 31 15:24, what should I do with this?

There is a kernel and a grub directory, where grub.conf is stored.

There is a lost+found directory

There are 3 kernels in there: kernel-3.2.12-gentoo, kernel-genkernel-x86-2.6.34-gentoo-r1, and kernel-2.6.34-gentoo-r1.

However the only one listed in Grub.conf is kernel-3.2.12-gentoo.

/boot:

https://gist.github.com/2854589

grub.conf:

https://gist.github.com/2854607

.config

https://gist.github.com/2854612

----------

## NeddySeagoon

deathiv,

You have a badly bloated kernel.  You may well have problems with device drivers not playing nicely with one another.

All you need built in are the drivers I posted earlier. Others can be modules.

Go to pappys seeds and follow the instructions there to remake your kernel from a clean kernel tree.

----------

## BillWho

deathiv,

As a "hail mary" attempt at booting try adding rootfstype to the kernel line in grub.conf

```
kernel /kernel-3.2.12-gentoo root=/dev/sda3 rootfstype=ext3
```

I looked over everything and it all looks good   :Confused: 

Hopefully someone here will have an epiphany   :Smile: 

----------

## deathiv

 *NeddySeagoon wrote:*   

> deathiv,
> 
> You have a badly bloated kernel.  You may well have problems with device drivers not playing nicely with one another.
> 
> All you need built in are the drivers I posted earlier. Others can be modules.
> ...

 

That website is down, is there a mirror or did you type the url wrong?

----------

## BillWho

 *deathiv wrote:*   

>  *NeddySeagoon wrote:*   deathiv,
> 
> You have a badly bloated kernel.  You may well have problems with device drivers not playing nicely with one another.
> 
> All you need built in are the drivers I posted earlier. Others can be modules.
> ...

 

Try this site  http://kmuto.jp/debian/hcl/

----------

## NeddySeagoon

deathiv,

From Pappys sig

SITE LIST: 

Main: http://www.kernel-seeds.org

Mirror: http://kernel-seeds.bloodnoc.org/

Mirror 2: http://kernel-seeds.audiodef.com/

Mirror 3: http://www.elilabs.com/~pappy/

----------

## wcg

Did you say you had the root filesystem and /boot on separate partitions?

Like /dev/sda1 mounts on /boot and the root filesystem is on /dev/sda2

or /dev/sda3, something like that?

If so, your grub.conf has errors. (hd0,0) is the first partition on the

first drive, /dev/sda1. If you have separate partitions for /boot and /,

(hd0,0) cannot be both of them.

List the partitions on your drive and where they mount (or nowhere

if swap) like this:

```

/dev/sda1  [where?]

/dev/sda2  [where?]

```

(Any other partitions on that drive? Are they supposed to mount at

boot? If so, where?)

/dev/sda1 will be (hd0,0), /dev/sda2 will be (hd0,1), /dev/sda3 will be (hd0,2),

and so on.

----------

## deathiv

/dev/sda1 is boot, and /dev/sda3 is root

So should the grub.conf read

root (hd0,0) 

since I want it to boot from /boot there or what should the line be so it boots from hd0,0 and takes hd0,2 as root? 

should it be

boot (hd0,0)

root (hd0,2)

kernel /kernel-3.1.12-gentoo root=/dev/sda3 rootfstype-ext3

?

----------

## wcg

I was mis-remembering what grub's "root" command refers

to exactly.

I have this note in my grub setup notes from when I first set

up grub:

 *Quote:*   

> 
> 
> grub's "root (device)" command does not refer to a linux
> 
> root partition. It refers to the device where the grub stages
> ...

 

I install grub with grub's install command from within the

grub interpreter. If grub is meant to be installed on the

mbr of /dev/sda, /dev/sda1 is the boot partition, and

/dev/sda3 is the root partition, grub.conf would read like this:

```

default 0

timeout 30

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

# kernel 3.2.12

title Gentoo 3.2.12

# where to find the partition with grub's stage1, etc.

root (hd0,0)

kernel (hd0,0)/vmlz3212 root=/dev/sda3 ro video=[some_stuff_for_framebuffer_console]

# other kernels

# ....

```

(vmlz3212 is an arbitrary file name for a kernel copied into /boot/

from /usr/src/linux/arch/[x86,sparc,powerpc,etc]/boot/bzImage

after compiling it.)

(Aside: I actually would copy it to /boot/bzImage.3.2.12,

then make a hardlink to it in /boot/ in case of accidents with

rm, etc:

```

# My current working directory is /usr/src/linux after compiling a kernel

# for an x86 box, and /boot/ is mounted read-only, sync.

mount -o remount,rw /boot

cp arch/x86/boot/bzImage /boot/bzImage.3.2.12

cp System.map /boot/System.map.3.2.12

cp .config /boot/config.3.2.12

cd /boot

ln bzImage.3.2.12 vmlz3212

cd /boot/grub

# edit grub.conf to include new kernel

cd ~ && mount -o remount,ro /boot

```

I typically do not need to reinstall grub, because it is already

on the mbr of the drive that it boots from, and it will find the

new entry in grub.conf on a reboot. This is how I set up kernels

in /boot/ before I ever installed my first Gentoo system, and

that is how I still do it, even though Gentoo has other

infrastructure for installing kernels in /boot/, keeping track

of the kernel .config, etc. If I accidentally "rm /boot/vmlz[version]",

at 3:00 am or whatever, and then I decide, "Oh no, I need it back,"

the kernel file is still there as "/boot/bzImage.[version]". Hard links

do not use up additional disk space for a copy of the whole file,

they only use an additional directory entry referring to one and

the same inode, so the cost of this protection is insignificant.

"/boot/System.map" is for ksymoops, which expects it to be

named exactly like that, so it needs a local script to run

after system startup that remounts /boot read-write, checks

the current kernel version with uname, and symlinks

/boot/System.map.[version] to /boot/System.map (if I want

ksymoops to work in case of a kernel oops), then remounts

/boot read-only, which is how it is mounted during normal

system operation on my systems.)

So back to grub: there are various fancy commands to automatically

install grub to an mbr for you, using /boot/grub/device.map and

so on, but I prefer the grub interpreter, which is a handy thing

to get familiar with in case of system rescues, etc.

From a text mode command prompt (the --device-map option and device

command from within the grub interpreter eliminate any reliance on

the accuracy of /boot/grub/device.map, although I have not found

any errors in it lately):

```

grub --device-map=/dev/null

# grub interpreter starts

> device (hd0) /dev/sda

> root (hd0,0)

> install (hd0,0)/grub/stage1 d (hd0) (hd0,0)/grub/stage2 (hd0,0)/grub/grub.conf

> quit

```

Seems to work. You can put grub various places with the install command

(floppies, usb devices, and so on).

I have this note from the sample grub.conf that was initially

installed. It uses an initrd:

```

#title Gentoo Linux 2.6.24-r5

#root (hd0,0)

#kernel /boot/kernel-genkernel-x86-2.6.24-gentoo-r5 root=/dev/ram0 real_root=/dev/sda3

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

```

If you boot with an initrd, it should be pretty close to what you need. (hd0,0) is

/dev/sda1, so that works. You would only need to change the title,

the kernel filename ("kernel /boot/[filename]"), and the name of the

initrd file ("initrd /boot/[initrd filename]"). grub would have to figure

out that "/boot" is (hd0,0). That part seems a little dicy, and explicitly

using the (hd0,0) syntax for the kernel location and initrd location

is perhaps more reliable, like this:

```

kernel (hd0,0)/kernel-genkernel-x86-[version] root=/dev/ram0 real_root=/dev/sda3

initrd (hd0,0)/initramfs-genkernel-x86-[version]

```

Now, the original error message indicates that grub is apparently found

by bios during the boot process, because grub is reporting the mystery

block error message. Look at your /boot/grub/device.map file. It should have

```

(hd0) /dev/sda

```

It might have notation for other devices as well, but it should

certainly have that. I am guessing that various automated grub

installer's use that file to know where to install grub, and grub uses

it to locate its stage1, stage2, and grub.conf.

Between the GNU grub manual

( http://www.gnu.org/software/grub/manual/grub.html )

and the Grub Grotto,

( http://www.troubleshooters.com/linux/grub/index.htm ),

one can usually figure out grub.

(Apologies if my initial confusion wasted any of your time.)

----------

