# "genkernel all" kernel panic

## teepark

I'm installing gentoo for the first time and when I started having problems with my first kernel attempt I went back and just did genkernel all. Now when I boot up linux I get the error message "Kernel panic - not syncing: VFS: Unable to mount root fs on unknown-block(1,0)". What is going wrong?

----------

## NeddySeagoon

teepark,

Welcome to Gentoo.

Your

```
unknown-block(1,0)
```

means there was a problem with your 

```
root=/dev/ram0
```

on the kernel line in your grub.conf,

so your kernel didn't get started properly.

The contents of /dev/ram0 are provided by your initrd file, which should be loaded just after your kernel line in grub.conf like this

```
kernel /...  <loads kernel> ... root=/dev/ram0

initrd /... <loads inital RAM drive file>
```

Check your kernel line and initrd line ig grub.conf.

If your first kernel attempt was a manual build, you may have forgotten the initrd line that genkernel needs in grub.conf.

----------

## teepark

Thanks for the help, I double checked my grub.conf and found a typo. So now I don't get that error message any more, instead I get an entirely different one: "Error 28: Selected item cannot fit into memory".

Here's my current grub.conf:

```
default 0

timeout 10

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

title=Windows XP Professional SP2

rootnoverify (hd0,0)

makeactive

chainloader +1

title=Gentoo Linux 2.6.15

root (hd0,1)

kernel /boot/kernel-genkernel-x86_64-2.6.15-gentoo-r5 root=/dev/ram0 init=/linuxrc ramdisk=8192 real_root=/dev/sda5 udev 

initrd /boot/initramfs-genkernel-x86_64-2.6.15-gentoo-r5

```

----------

## NeddySeagoon

teepark,

Your grub.conf looks ok. The udev at the end of the kerenl line is no longer required but thats not the issue.

Either your kernel file does not contain a kernel or your initrd file is bigger than 8Mb.

Can you post the output of 

```
ls -l /mnt/gentoo/boot
```

from the liveCD, with both your root and boot mounted but from outside the chroot.

----------

## teepark

This is not exactly the output of ls -l, but this is what's in that location:

```
grub                                                   folder

lost+found                                             folder

Recycled                                               folder

.keep                                                  0kb

2.6.15-gentoo-r5                                       2,471kb

boot                                                   1kb

initramfs-genkernel-x86_64-2.6.15-gentoo-r5            1,546kb

kernel-genkernel-x86_64-2.6.15-gentoo-r5               2,190kb

System.map-genkernel-x86_64-2.6.15-gentoo-r5           1,048kb
```

The 2.6.15-gentoo-r5 is from my first failed attempt at building a kernel.

Thanks for helping me get started.

----------

## troymc

 *teepark wrote:*   

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

 

90% of the time, this messages means your kernel does not contain the drivers for your IDE controller.

"unknown-block" device is the clue - it does not understand what you told it your root device is.

I believe genkernel specifically has problems with SATA controllers. 

It could also mean that you mistyped the real_root device on the kernel command line. 

(ie. specifying /dev/sda1 when it's really a PATA IDE device.)

Just from what you've posted it looks like you are probably having SATA driver problems.

I'm not a genkernel expert, but I believe that there is a way to do a 'genkernel --menuconfig' or something so that you can go in and specifically enable your SATA drivers.

troymc

----------

## NeddySeagoon

teepark,

In your grub.conf you said 

```
kernel /boot/kernel-genkernel-x86_64-2.6.15-gentoo-r5 root=/dev/ram0 init=/linuxrc ramdisk=8192 real_root=/dev/sda5 udev 
```

That must be one very long line. Your file names and sizes in  /boot look OK too.

Did you let genkerel configure your kernel or did you use --menuconfig and change some things yourself ?

It is possible that you turned off the ext2 file system, which is used in the initrd file, so the kernel cannot read it.

troymc,

If you read /usr/src/linux/Documentation/devices.txt and look up the block device with major number 1 and minor number 0 

```
block(1,0)
```

you will see that its /dev/ram0 thats unkmown. The kernel has not got as far as looking around for hardware yet. The numbers in that error message are very useful for deteriming the cause.

----------

## troymc

 *NeddySeagoon wrote:*   

> 
> 
> If you read /usr/src/linux/Documentation/devices.txt and look up the block device with major number 1 and minor number 0 
> 
> ```
> ...

 

Ah, thank you, you are correct. I mis-read that as "block(0,0)".

This would seem like he doesn't have ramdisks or initrd enabled in his kernel.

 *NeddySeagoon wrote:*   

> 
> 
> It is possible that you turned off the ext2 file system, which is used in the initrd file, so the kernel cannot read it. 
> 
> 

 

Could an unknown filesystem give him an unknown block device error? Maybe a 0-length initrd file?

Or wouldn't that give him a "RAMDISK:" error?

troymc

----------

## teepark

No, when compiling the kernel I just used genkernel all. The documentation said that would give me the same kernel that was on the liveCD, so I thought that would be a good place to start, since I knew that would make the system run. Am I better off doing a manual compile and just repeatedly going back and recompiling when I miss something?

----------

## NeddySeagoon

teepark,

I've never used genkernel, since I have been doing my own kernels from before I discovered gentoo.

This post tells about the pros and cons of buildiong your own kernel and gives some hight level hints.

This post  gives more details about making your own kernel.

Then of course, there is the handbook.See 7c.

When you have your own kernel booting, you may add modules to it without a full rebuild.

----------

