# kernel panic woes

## auberondreaming

Hi all.  I have succesfully installed gentoo onto my SATA equipped hardrive.  I keep getting the same kernel panic VFS cannot open root device etc etc.  I have tried recompiling the kernel with the low level ahci drivers built in, same effect.  I am at m wits end here, would love to get into gentoo but if I cannot run the thing....

I have my ntfs on partition 1, boot on 2, swap on 3, root on 4.  I really would appreciate some help with this, don't want to have to abandon gentoo!

----------

## NeddySeagoon

auberondreaming,

Post the exact text of the error message and the output of lspci please.

----------

## auberondreaming

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

Please append a correct "root=" boot option

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

I seem to be unable to get list all pci devices to work on this live cd, sorry.  This is a toshiba satellite laptop.

----------

## FantomKnight

This message is almost always caused by not having the controller driver properly compiled into your kernel.  We really need to see the output of lspci before we can tell you how to proceed.  Post what you can from lspci.

----------

## sinizzl

oh that's easy. go to device drivers - scsi support - scsi low level drivers (or something like that, but it definitely is in scsi support) either compile an initramfs or if you're lazy (like me), compile it directly into your kernel.

EDIT: it would be really useful if you knew what SATA chipset you're using ;-D

----------

## NeddySeagoon

auberondreaming,

To determine your SATA chipset, boot the liveCD and run 

```
lsmod
```

Mount your root filesystem.

Now for all the SATA drivers listed in lsmod, do 

```
modprobe -r <module-name>
```

You should not be able to remove the one thats in use - thats the one you want in your own kernel.

If you do manage to remove the SATA driver used for mounting your root filesystem, then it won't be mounted any longer.

You can detect that by running commands like ls on it.

----------

## auberondreaming

ok I have found the driver I need by doing this, now how do I compile it directly into the kernel?

----------

## FantomKnight

mount /boot

cd /usr/src/linux

make menuconfig

Then, go to:

```
Device Drivers -->

  SCSI support -->

    SCSI Low-level driver -->
```

and mark your particular driver.  Make sure it has <*> next to it and not something like [M] or <M>

exit and compile by doing

make && make modules_install

Then, copy the new kernel to your /boot partition by

cp arch/i386/boot/bzImage /boot/kernel-2.6.17-gentoo-r4 (assuming you are using the 2.6.17-gentoo-r4 kernel.  I usually just start typing the command and then hit the TAB key after I type the letter k in kernel.  That completes the command for me (assuming you are using /bin/bash) with the correct existing kernel file.  Some people don't like this because it overwrites your existing kernel rather than giving you a fallback option.  But, I'm lazy, and if I need to recompile, I know that I can always boot from the LiveCD and chroot in and fix it.

----------

## auberondreaming

OK all I actually fixed the vfs kernel panic by going into the .config file itself and turning on (read compile vs module) all the sata stuff by hand (menuconfig was not doing this for some reason).  Now I am getting a new error (non kernel panic thankfully), "the root block device is unspecified or not detected".  It also gives me a slew of errors about the kernel not finding the correct SATA modules.  I compiled them directly into the kernel, so why is it looking for these drivers as modules?  And lastly can you tell me a bit about what a correct initdr specification in my grub should look like?  thanks!

----------

## NeddySeagoon

auberondreaming,

Many options in 

```
make menuconfig
```

change two or more option in the .config file.

You should not edit the .config by hand, you arelikely to make it illegal.

If make menuconfig cannot set something as a built in, there will be a reason. Normally a higher level option needs to be changed from module to built in too.

----------

## auberondreaming

Sorry all been real busy with work and school kicking back in.  I finally got a working live disk with lspci, here is the result from that

00:00.0 Host bridge: ATI Technologies Inc Unknown device 5a31 (rev 01)

00:01.0 PCI bridge: ATI Technologies Inc RS480 PCI Bridge

00:12.0 IDE interface: ATI Technologies Inc ATI 4379 Serial ATA Controller (rev 80)

00:13.0 USB Controller: ATI Technologies Inc IXP SB400 USB Host Controller (rev 80)

00:13.1 USB Controller: ATI Technologies Inc IXP SB400 USB Host Controller (rev 80)

00:13.2 USB Controller: ATI Technologies Inc IXP SB400 USB2 Host Controller (rev 80)

00:14.0 SMBus: ATI Technologies Inc IXP SB400 SMBus Controller (rev 81)

00:14.1 IDE interface: ATI Technologies Inc Standard Dual Channel PCI IDE Controller ATI (rev 80)

00:14.2 Audio device: ATI Technologies Inc Unknown device 437b (rev 01)

00:14.3 ISA bridge: ATI Technologies Inc IXP SB400 PCI-ISA Bridge (rev 80)

00:14.4 PCI bridge: ATI Technologies Inc IXP SB400 PCI-PCI Bridge (rev 80)

01:05.0 VGA compatible controller: ATI Technologies Inc RC410 [Radeon Xpress 200M]

02:04.0 Ethernet controller: Atheros Communications, Inc. AR5005G 802.11abg NIC (rev 01)

02:06.0 CardBus bridge: ENE Technology Inc CB1410 Cardbus Controller (rev 01)

02:07.0 Ethernet controller: Realtek Semiconductor Co., Ltd. RTL-8139/8139C/8139C+ (rev 10)

I went back and used menuconfig to turn on everything I could think of, now is there something special I need to do with the second image initrd?   As the kernel loads it gives me an error saying it can't find the SATA modules in the initrd image directory..... any help would be appreciated, sorry for the length between posts.

----------

