# Kernel Panic unable to mount / fs

## potuz

Hi list, I managed to loose my 2.6.38-r4 sources on a --depclean (stupid me) and decided to compile a new kernel (3.1.7)

Did a make oldconfig and checked around to see changes (didn't find anything major for my system). Booting into the new kernel I get

```

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

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

0800 118489088 sda driver: sd

0801 204800      sda1 ....

...

...

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

...

```

Now this is a macbook booting via grub2 efi installed when I still had mac os X around in this laption and it boots with 

```

root=(hd0,3)

linux /boot/linux agp=off video=efifb

```

where linux-->kernel-3.1.7 in my /boot partition

I remember that getting grub2 efi to work was a pain (did it on an LFS system before installing gentoo here) so I'm hoping I do not need to reinstall that. Have obviously the drivers in the kernel for the SATA drive, so I'm not sure what's going wrong. 

I have another entry in grub for a symling old-->kernel-2.6.38-r4 and that works fine.

Any help will be appreciated

----------

## NeddySeagoon

potuz,

You kernel can see your hard drive as is shown by 

```
0800 118489088 sda driver: sd 

0801 204800      sda1 .... 

... 

... 
```

Thats the partitions on sda.

```
Unable to mount fs on unknown-block(2,0)
```

tells that the kernel tried to mount /dev/ram0 as root, which is shoudl only be asked to do if you are using an initrd.

It looks like your grub setup has told the kernel to use an initrd but the initrd was never loaded.

Further, it looks like you may be able to boot without an initrd anyway.

----------

## potuz

Thanks for the reply and indeed it looks as if its trying to boot from initrd, but my line on grub is the same for both kernels

```

root=(hd0,3)

linux /boot/linux agp=off video=efifb 

```

I have another line like this with "old" replacing "linux" with old a symlink to my 2.6.38 kernel in /boot (which boots fine), so I'm not sure how is it that grub would be responsible for this

I have never used an initrd.

----------

## Hu

Please post the full configuration file.

----------

## potuz

For grub, in the Darwin partition:

```

#cat grub.cfg

timeout=10

menuentry "Linux" {

root=(hd0,3)

linux /boot/linux agp=off video=efifb

}

menuentry "Old Linux" {

root=(hd0,3)

linux /boot/old agp=off video=efifb

}

menuentry "Mac OSX" { 

root=(hd0,2)

chainloader /usr/standalone/i386/boot.efi -v

}

```

The .config for the 3.1.7 kernel is in http://pastebin.com/1n0nzCF3

Thanks

----------

## potuz

It was an issue of adding an extra root directive in the end, I'm not sure why but having 

```

root=(hd0,3)

linux /boot/linux root=/dev/sda3 agp=off video=efifb 

```

is necessary with the new kernel while the "root=/dev/sda3" clause is not needed with the 2.6 kernel. 

Now on to try to solve my other hardware problems.

----------

