# [Solved] Kernel Panic Unable to mount root fs

## lijnk

I'm getting this common error,

```

VFS: Cannot open root device "sda4" or unknown-block(0,0) 

Please append a correct "root=" boot option; here are the available partitions:

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

```

although I'm not entirely sure what I'm missing. I've used this site to determine what I should set up, however it failed, so I used lspci -k which also didn't work out.

lspci -k

```

00:00.0 Host bridge: NVIDIA Corporation nForce3 250Gb Host Bridge (rev a1)

   Subsystem: ASRock Incorporation Motherboard (one of many)

   Kernel driver in use: agpgart-amd64

00:01.0 ISA bridge: NVIDIA Corporation nForce3 250Gb LPC Bridge (rev a2)

   Subsystem: ASRock Incorporation Motherboard (one of many)

00:01.1 SMBus: NVIDIA Corporation nForce 250Gb PCI System Management (rev a1)

   Subsystem: ASRock Incorporation Motherboard (one of many)

00:02.0 USB controller: NVIDIA Corporation CK8S USB Controller (rev a1)

   Subsystem: ASRock Incorporation Motherboard (one of many)

   Kernel driver in use: ohci_hcd

   Kernel modules: ohci-hcd

00:02.1 USB controller: NVIDIA Corporation CK8S USB Controller (rev a1)

   Subsystem: ASRock Incorporation Motherboard (one of many)

   Kernel driver in use: ohci_hcd

   Kernel modules: ohci-hcd

00:02.2 USB controller: NVIDIA Corporation nForce3 EHCI USB 2.0 Controller (rev a2)

   Subsystem: ASRock Incorporation Motherboard (one of many)

   Kernel driver in use: ehci_hcd

   Kernel modules: ehci-hcd

00:05.0 Bridge: NVIDIA Corporation CK8S Ethernet Controller (rev a2)

   Subsystem: ASRock Incorporation Device 00df

   Kernel driver in use: forcedeth

   Kernel modules: forcedeth

00:06.0 Multimedia audio controller: NVIDIA Corporation nForce3 250Gb AC'97 Audio Controller (rev a1)

   Subsystem: ASRock Incorporation Device 0850

   Kernel driver in use: snd_intel8x0

   Kernel modules: snd-intel8x0

00:08.0 IDE interface: NVIDIA Corporation CK8S Parallel ATA Controller (v2.5) (rev a2)

   Subsystem: ASRock Incorporation Motherboard (one of many)

   Kernel driver in use: pata_amd

   Kernel modules: ata_generic, pata_acpi, pata_amd

00:0a.0 IDE interface: NVIDIA Corporation nForce3 Serial ATA Controller (rev a2)

   Subsystem: ASRock Incorporation Motherboard (one of many)

   Kernel driver in use: sata_nv

   Kernel modules: ata_generic, pata_acpi, sata_nv

00:0b.0 PCI bridge: NVIDIA Corporation nForce3 250Gb AGP Host to PCI Bridge (rev a2)

00:0e.0 PCI bridge: NVIDIA Corporation nForce3 250Gb PCI-to-PCI Bridge (rev a2)

00:18.0 Host bridge: Advanced Micro Devices [AMD] K8 [Athlon64/Opteron] HyperTransport Technology Configuration

00:18.1 Host bridge: Advanced Micro Devices [AMD] K8 [Athlon64/Opteron] Address Map

00:18.2 Host bridge: Advanced Micro Devices [AMD] K8 [Athlon64/Opteron] DRAM Controller

00:18.3 Host bridge: Advanced Micro Devices [AMD] K8 [Athlon64/Opteron] Miscellaneous Control

01:00.0 VGA compatible controller: Advanced Micro Devices [AMD] nee ATI RV350 AR [Radeon 9600]

   Subsystem: Advanced Micro Devices [AMD] nee ATI Device 3000

01:00.1 Display controller: Advanced Micro Devices [AMD] nee ATI RV350 AR [Radeon 9600] (Secondary)

   Subsystem: Advanced Micro Devices [AMD] nee ATI Device 3001

```

grub.conf

```

default 0

timeout 5

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

title Gentoo Linux 2.6.24-r5

root (hd0,0)

kernel /boot/vmlinuz-3.2.12-r1 root=/dev/sda4 ro

```

fstab

```

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

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

/dev/sda1               /boot           ext3            noatime         1 2

/dev/sda4               /               jfs             noatime         0 1

/dev/sda3               none            swap            sw              0 0

/dev/sda2               /tmp            reiserfs

/dev/sdb1               /home           ext4            defaults

# /dev/cdrom            /mnt/cdrom      auto            noauto,ro       0 0

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

```

Kernel config: http://pastebin.com/1xEPK0gULast edited by lijnk on Wed May 30, 2012 8:59 am; edited 1 time in total

----------

## krinn

 *lijnk wrote:*   

> so I used lspci -k which also didn't work out. 

 

I don't see where it fail, it should ouput the kernel module in use, and it's what you get

If you were thinking lspci -k should "configure the kernel module to match my computer for me", then yes it's a failure, but maybe not from lspci  :Smile: 

See my comments ("s" don't stop at the first comment, second one will help you more) there, should help you fix your setup.

https://forums.gentoo.org/viewtopic-p-6823512.html#6823512

----------

## Jaglover

Any chance your drive has GPT instead of MBR?

----------

## NeddySeagoon

lijnk,

```
VFS: Cannot open root device "sda4" or unknown-block(0,0) 
```

tells that the kernel cannot see the HDD at all.

You are missing one or more of  

Partition Table Driver

SCSI Disk Support

Low Level HDD Chipset Support 

There are a couple of other rarer things too but they don't apply to an nVidia nForce3 chipset.

----------

## solamour

When something like this happens, I usually boot from the installation CD (or SystemRescueCD) and check whether I'm even able to mount the partition at all. If I can, listing up the loaded modules usually tells what needs to be done.

__

sol

----------

## lijnk

 *NeddySeagoon wrote:*   

> lijnk,
> 
> ```
> VFS: Cannot open root device "sda4" or unknown-block(0,0) 
> ```
> ...

 

I thought so, although I have no idea what I'm missing since it looks like I have everything there. Searching for what I'm supposed to have doesn't seem to have any proper results.

----------

## WorBlux

CONFIG_PATA_AMD:                                                        │  

  │                                                                         │  

  │ This option enables support for the AMD and NVidia PATA                 │  

  │ interfaces found on the chipsets for Athlon/Athlon64.                   │  

  │                            

If unsure, say N.                                                       │  

  │                                                                         │  

  │ Symbol: PATA_AMD [=n]                                                   │  

  │ Type  : tristate                                                        │  

  │ Prompt: AMD/NVidia PATA support                                         │  

  │   Defined at drivers/ata/Kconfig:305                                    │  

  │   Depends on: ATA [=y] && ATA_SFF [=y] && ATA_BMDMA [=y] && PCI [=y]    │  

  │   Location:                                                             │  

  │     -> Device Drivers                                                   │  

  │       -> Serial ATA and Parallel ATA drivers (ATA [=y])                 │  

  │         -> ATA SFF support (ATA_SFF [=y])                               │  

  │           -> ATA BMDMA support (ATA_BMDMA [=y])

Hope that helps  (a board with nforce3 was actually the first puter I installed gentoo on)

----------

## lijnk

I already have PATA_AMD enabled which is why the error is confusing me. I'm going to try flipping a couple things to see if that works.

----------

## lijnk

Ok, it worked this time. I'll put some notes down because I'm not entirely sure why it worked. I compiled 3 different kernels.

First kernel had pata_amd and sata_nv enabled, but not ata_generic.

The second kernel had pata_amd and sata_nv enabled as well as ata_generic, but I copied it from arch/x86_64/boot/bzImage to the first kernel's name (may have not overwritten it?).

The third kernel I compared with my kernel and enabled various options. I have ata_verbose_error, sata_pmp, pata_amd and ata_generic enabled and sata_nv disabled (sata_nv may have caused conflicts? sata_pmp might have been needed?).

Here's the current working kernel config for review: http://pastebin.com/uQX7cDcw

I've marked it as solved since the initial problem is solved, but maybe someone can bring some context into what went on.

----------

## NeddySeagoon

lijnk,

sata_nv  is neded for the SATA ports provided on your chipset.  If none of your drives as SATA. You don't need it.

pata_amd is the driver for the IDE ports.  The two do not conflict.

ata_generic is something to try only if nothing else works.  If there is a driver specifically for your chipset, do not build ata_generic.

Options that have 'verbose' or 'debug' in their names hould generally be avoided. They often generate a log of logspam and more interfere with normal device operation.

```
00:08.0 IDE interface: NVIDIA Corporation CK8S Parallel ATA Controller (v2.5) (rev a2) 

   Subsystem: ASRock Incorporation Motherboard (one of many) 

   Kernel driver in use: pata_amd

00:0a.0 IDE interface: NVIDIA Corporation nForce3 Serial ATA Controller (rev a2) 

   Subsystem: ASRock Incorporation Motherboard (one of many) 

   Kernel driver in use: sata_nv 
```

is a bit of a giveaway.

All of the options needed for the HDD must be selected at <*> so they are included in the bzImage file that is loaded by the boot loader.

The code for any options set as <M> is installed in /lib/modules, which is located on the root filesyatem.  Its a really bad idea to have modules here that are needed to mount the root filesystem since the filesystem must be mounted to load the modules needed to mount the filesystem.

----------

