Kernel Panic Unable To Mount root fs

To say that SATA on Linux is a pain in the ass is a bit of an understatement. The 2.4 kernel has limited support for SATA which is why I was very careful with what motherboard I bought. Paul Nasrat checked with some of the Fedora guys which chip sets where supported and the Promise PDC20378 and VIA VT8237 on the MSI and Asus motherboards are supported.
I spent quite a while trying to get a 2.6.4 kernel working on my machine. Lucky for me the netinst CD is also a recovery CD.
Anyway to save some poor person like me spending a long time wondering why their 2.6.4 kernel wont work here is a pointer on a problem that stumped me for a wee while.
I am no guru with the Linux kernel so some of this might very well be nonsense.
If you have compiled a kernel and are getting an error as follows
VFS: Cannot open root device “342” or unknown-block(3,66)
Please append a correct “root=” boot option
Kernel Panic VFS: Unable to mount root fs on unknown-block(3,2)
here are a few things to try.
First make sure that the file system that you are trying to use ie ext2, ext3, reiserfs or whatever is NOT being compiled as a module. To do this you need to locate the “.config” file that is created when you compile your kernel. The normal place for this is
/boot/config-2.6.4
or something like that. An example kernel config ????
In this file there are lots of options to determine whether the kernel will have the driver built in or as a loadable module. If you think about it some drivers need to be in the kernel in order for the kernel to boot and read off the filesystem ie your filesystem drivers in my case EXT2. Make sure these are configured so that they are built in to the kernel.
Another problem that I had was to do with using make-kpkg to build my kernel.
Normally most people finish creating their kernel when using make-kpkg using
make-kpkg kernel_image
when I did this I got the same error above. To fix this you can do the following
make-kpkg –initrd kernel_image
this will create an initrd image in the /boot/ partition which you can then need to link like
/initrd.img > boot/initrd.img-2.6.4
the command to create soft links is
cd /
ln -s /boot/initrd-kernelversion initrd.img
or something similar. This solved the above problem for me.