# Kernel Panic

## inferno6881

Alright guys I'm having a slight problem I just installed gentoo for the first time and when I reboot to load it for the first time I'm getting a Kernel Panic I'm not really sure but I guess I didn't configure my kernel properly, but I do not know what I have done wrong here is what I get on my screen:

md:  Waiting for all device to be available before autodetect

md:  If you don't use raid, use raid=noautodetect

md:  Autodetecting RAID arrays.

md:  Scanned 0 and added 0 devices.

md:  autorun ...

Root-NFS:  No NFS server available, giving up.

VFS:  Unable to mount root fs vis NFS, trying floppy.

VFS:  Cannot open root device "sda3" or unknown-block(2,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(2,0)

Pid:  1, comm:  swapper Not tainted 2.6.31-gentoo-r10 #1

Call Trace:

[<c14ccbba>] ? printk+0xf/0x11

[<c14ccb10>] panic+0x39/0xd4

[<c1788bbb>] mount_block_root+0x163/0x172

[<c1002930>] ? sys_sigsuspend+0x62/0xb2

[<c1788d93>] mount_root+0x66/0x84

[<c1788d93>] prepare_namespace+0x145/0x16c

[<c1788335>] kernel_init+0x16e/0x17d

[<c17881c7>] ? kernel_init+0x0/0x17d

[<c100358f>] kernel_thread_helper+0x7/0x10

I have one 750GB sata hard drive with /dev/sda1 as boot /dev/sda5 as swap and /dev/sda3 as install.

I know there is probably more information that is needed I don't know what that is. 

Thanks

----------

## gerard27

Plse post /boot/grub/grub.conf.

Gerard.

----------

## inferno6881

Here is the grub.conf file minus the comments at the top

default 0

timing 30

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

title Gentoo Linux 2.6.24-r5

root (hd0,0)

#kernel /boot/kernel root=/dev/ram0 real_root=/dev/sda3

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

kernel /boot/kernel root=/dev/sda3

# vim:ft=conf:

----------

## NeddySeagoon

inferno6881,

grub has done its stuff and loaded your kernel, your error mesage

```
Root-NFS: No NFS server available, giving up.

VFS: Unable to mount root fs vis NFS, trying floppy.

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

tells that your kernel is missing the driver for your hard drive controller, so it can't see your disk drive. The error also tells that the kernel tried everything it knoe to find a root filesystem before it gave up.

Post the output of lspci so we can help with your kernel setup.

----------

## gerard27

That looks ok.

What filesystem did you use for /dev/sda3?

And did you compile support for this fs in the kernel or as a module?

It needs to be in-kernel when you don't use initram like genkernel does.

Maybe you can post your kernel .config in pastebin.

Gerard.

----------

## inferno6881

00:00.0 Host bridge: ATI Technologies Inc RS480 Host Bridge

00:02.0 PCI bridge: ATI Technologies Inc RS480 PCI-X Root Port

00:11.0 IDE interface: ATI Technologies Inc IXP SB400 Serial ATA Controller

00:12.0 IDE interface: ATI Technologies Inc IXP SB400 Serial ATA Controller

00:13.0 USB Controller: ATI Technologies Inc IXP SB400 USB Host Controller

00:13.1 USB Controller: ATI Technologies Inc IXP SB400 USB Host Controller

00:13.2 USB Controller: ATI Technologies Inc IXP SB400 USB2 Host Controller

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

00:14.1 IDE interface: ATI Technologies Inc IXP SB400 IDE Controller

00:14.3 ISA bridge: ATI Technologies Inc IXP SB400 PCI-ISA Bridge

00:14.4 PCI bridge: ATI Technologies Inc IXP SB400 PCI-PCI Bridge

00:14.5 Multimedia audio controller: ATI Technologies Inc IXP SB400 AC'97 Audio Controller

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: nVidia Corporation G92 [GeForce 9800 GTX] (rev a2)

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

02:04.0 FireWire (IEEE 1394): VIA Technologies, Inc. VT6306/7/8 [Fire II(M)] IEEE 1394 OHCI Controller (rev 80)

----------

## inferno6881

I used ext3 for my filesystem not sure how to get that kernel info you requested

----------

## Jaglover

inferno6881,

NeddySeagoon pointed out your current problem. We don't know if there is also filesystem problem or not, because your kernel cannot access hard drive.

----------

## inferno6881

@Jaglover the filesystem response was to gerard82

@NeddySeagoon how do I add the IXP SB400 Serial ATA Controller Driver?  Also where would I check to make sure my kernel has the driver for the HDD itself?

----------

## inferno6881

Here is my kernel .config on pastebin http://pastebin.com/LDsWPxhB

----------

## NeddySeagoon

inferno6881,

```
00:14.1 IDE interface: ATI Technologies Inc IXP SB400 IDE Controller 
```

is your disk controller. That needs

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

that really is off.

The high level part of SCSI

```
SCSI device support

  │ │    < > RAID Transport Class                                         │ │  

  │ │    -*- SCSI device support                                          │ │  

  │ │    < > SCSI target support                                          │ │  

  │ │    [*] legacy /proc/scsi/ support                                   │ │  

  │ │        *** SCSI support type (disk, tape, CD-ROM) ***               │ │  

  │ │    <*> SCSI disk support                                            │ │  

  │ │    < > SCSI tape support                                            │ │  

  │ │    < > SCSI OnStream SC-x0 tape support                             │ │  

  │ │    <*> SCSI CDROM support                                           │ │  

  │ │    [ ]   Enable vendor-specific extensions (for SCSI CDROM)         │ │  

  │ │    <*> SCSI generic support 
```

The low level chip set specific items

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

  │ │    --- Serial ATA and Parallel ATA drivers                          │ │  

  │ │    [ ]   Verbose ATA error reporting                                │ │  

  │ │    [*]   ATA ACPI Support                                           │ │  

  │ │    [ ]   SATA Port Multiplier support                               │ │  

  │ │    <*>   AHCI SATA support                                          │ │  

  │ │    < >   Silicon Image 3124/3132 SATA support                       │ │  

  │ │    [*]   ATA SFF support 

...  

  │ │    <*>     ATI PATA support 
```

For your ext3 filesystem, learn to use the menuconfig search.  Press / end enter ext3

Notice that all of the above options are built in  <*>, not module <M> - your ext3 filesystem support must be built in too.

The reason is that modules live on the root filesystem, so cannot be loaded until the root filesystem is mounted.

Your drives will have SCSI names, so you need /dev/sd, not /dev/hd in fstab too.

----------

## inferno6881

@NeddySeagoon tried your instructions out same problem then went and double checked them tried again still not it.  What else should I try?

----------

## NeddySeagoon

inferno6881,

I'm guessing you are not installing the kernel properly, so its not being used.

Boot the CD and get into your chroot, then check the following:-

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

The timestamp on this file is your new kernel. Compare it to the time you last made the kernel.

Look in /boot with 

```
ls -l /boot
```

Find a file with the same time stamp as your kernel above. It will be an identical size too.

What is the file called?

Grub will only find it if its called kernel, as thats what you have told grub to look for.

If the new kernel is there with a different name, you will need to fix grub.conf to boot using the new name.

You did do

```
 make

make modules_install

...
```

after you fixed the kernel configuration ?

----------

## inferno6881

NeddySeagoon,

kernel is the name of the file in /boot that matches the timestamp and size of /usr/src/linux/arch/x86/boot/bzImage.  

Oh I also remembered to 

```
make

make modules_install

```

This one sure has me stumped even more now.  Thanks for all your help so far greatly appreciated.

----------

## NeddySeagoon

inferno6881,

In your chroot,

emerge wgetpaste and give the command 

```
wgetpaste -s ca /usr/src/linux/.config
```

Post the URL you get back ... thats a link to your kernel config file, so I can look at it tomorrow.

----------

## inferno6881

Here is the pastebin link as requested 

http://pastebin.ca/1854297

It's probably just something small and easy I missed because I have never configured my kernel before

----------

## NeddySeagoon

inferno6881,

The only thing you should have set under 

```
CONFIG_ATA_SFF=y
```

is 

```
CONFIG_PATA_ATIIXP=y
```

Everything else should be off.

If all else fails - boot with a liveCD and do 

```
lspci -k
```

This will tell you the driver the liveCD is using and we can pick out the kernel option from that.

----------

## inferno6881

I tried those changes you suggested and it still did not work so I ran

```
lspci -k

```

as suggested then looked it over and found my live disk was using sata_sil so I did a search for it in the kernel configuration found where it was and enabled it now it boots up just fine.  Thanks for all of your help I wouldn't have been able to do it without you.  What would you reccomend for reading on the subject of working with the kernel because now it has intrigued me greatly.

----------

## NeddySeagoon

inferno6881,

The kernel interactive help is a good resource.  For more detail look in /usr/src/linux/Documentation

Pappys Seeds is well worth a read but its still a work in progress and Linux-Sea, an on line book written with Gentoo in mind.

----------

## wilsonsamm

I think since /dev/sda3 is exactly the root partition specified in the example in the gentoo handbook there's a chance inferno6881 has accidentally left it as /dev/sda3 while actually having a different partitioning scheme on his hard drive. At least, I've made this mistake many times before.

Type fdisk -l (that's minus lowercase L, not capital i or number 1 or anything else) to see what partitions you have, and make sure you know which one you installed gentoo onto.  :Smile: 

EDIT: I saw you got it working. Congratulations and enjoy your gentoo!

----------

## inferno6881

Hey Wilson I got it fixed thanks for the input though.  I was missing one driver for my HDD in the kernel after it was added it booted like a champ.  Ya I did follow the guide considering I had no idea what I was doing.  The only thing I have to do now is write my xorg.conf file for xserver, but that can wait it's not a high priority.

----------

