kernel compilation problem

Taking care of your Linux box.
Post Reply
zaeemarshad
Lieutenant Colonel
Posts: 660
Joined: Sat Jul 06, 2002 12:35 pm
Location: Islamabad
Contact:

kernel compilation problem

Post by zaeemarshad »

i have tried almost for the 20th time to recompile my linux kernel on both rhl8.0/9.0 but it fails giving the error message
vfs panic
could not mount root device. give correct root=boot labelblah blah

i have followed the procedure given in redhat's sysadminguide and also tried the sequence in a previous post regarding kernel compilation with teh addition that i made the ramdisk. plz guide me or at least someone plz outline the process u follow. my method(standard it is) at least upto 7.3 worked. any help. i am pulling my hears right now :cry:

in need of desparate help
zaeem
cwackked
Lance Naik
Posts: 33
Joined: Sat Aug 30, 2003 7:23 am
Contact:

Post by cwackked »

hmm..whats your hard disk setting?
master,slave or cable select?
-umer
cwackked
Lance Naik
Posts: 33
Joined: Sat Aug 30, 2003 7:23 am
Contact:

Post by cwackked »

one more thing...
did you edit the bootloader after making the kernel and modules?
-umer
Faraz.Fazil
Major General
Posts: 1024
Joined: Thu Jul 04, 2002 5:31 pm
Location: Karachi/Pakistan/Earth/Universe

Post by Faraz.Fazil »

Bingo.
Help is here!!!!

I encountered an exactly same problem after i recompiled my kernel on redhat 9 (which previously had 2.4.20.8) and i solved it successfully.

The problem is caused by a portion that says ro root=LABEL=/ in grub.conf

That string is compatible with the default 2.4.20.8 kernel but is not compatible with the recompiled kernel >2.4.20.8
All u need to do is to remove the ro root=LABEL=/ portion,

By default grub.conf looks something like this:

title Red Hat Linux (2.4.22)
root (hd0,6)
kernel /boot/vmlinuz-2.4.22 ro root=LABEL=/
initrd /boot/initrd-2.4.22-ext2.img

Remove the ro root=LABEL=/ line in grub.conf by editing it with any editor like vim,emacs or joe , so that it looks something like:

title Red Hat Linux (2.4.22)
root (hd0,6)
kernel /boot/vmlinuz-2.4.22
initrd /boot/initrd-2.4.22-ext2.img

Note: Your root and initrd image name and kernel image names can be different so make sure u specify it correctly.BY default, if u did a make install during the kernel recompile, it would have entered the paramaters correctly itself and u would just have to remove the ro root=LABEL=/ part.

I have personally encountered and solved this error, so u can be sure if u follow the steps correctly, ur kernel will run without any problem.

I assume u also did a make install during the kernel install.If u did, then this much is enough.Otherwise u would have to issue a mkinitrd command to make a initrd image which is something like

mkinitrd imagename.img kernelversion

e.g

mkinitrd /boot/faraz.img 2.4.22

Issue that command in terminal and use that initrd image in grub.

Also if u cannot even boot into linux, then even u can solve the problem.In that case, on the main grub screen higlight the linux entry and press e to edit.HIghlight the kernel line and press e to edit.Remove the ro root=LABEL=/ part and press B to boot.Voila it will boot and work!!
Then once linux is started, edit the grub.conf file as explained before to make the change permanent.

I hope its clear enough!!
zaeemarshad
Lieutenant Colonel
Posts: 660
Joined: Sat Jul 06, 2002 12:35 pm
Location: Islamabad
Contact:

Post by zaeemarshad »

many thanks faraz. you brought the right solution. though i would urge others who love to post answers to thoroughly read the problem and then try to answer. it doesnt help except clutter the page and more bits for my slow dialup to download i.e. previous bandwidth wasted. anyways thanks a lot sir. hats off to ya

regards
zaeem 8)
mahin
Major
Posts: 605
Joined: Wed Aug 07, 2002 8:00 pm
Location: Karachi
Contact:

kernel compilation problem

Post by mahin »

zaeemarshad wrote:many thanks faraz. you brought the right solution. though i would urge others who love to post answers to thoroughly read the problem and then try to answer.<snip>
Agree! :) Faraz is a professinal with lots of experience and you can see the difference that make :)
Faraz.Fazil
Major General
Posts: 1024
Joined: Thu Jul 04, 2002 5:31 pm
Location: Karachi/Pakistan/Earth/Universe

Post by Faraz.Fazil »

You Welcome.
Thanx for the appreciation guyz.
Its a pleasure to be of help to others.

OpenSource ruleZ!
Post Reply