Review your favorite Linux distribution.
Go Back > Forums > Linux Forums > Linux - Newbie
User Name
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!


  Search this Thread
Old 03-06-2008, 12:50 AM   #1
LQ Newbie
Registered: Feb 2008
Posts: 15

Rep: Reputation: 0
Unhappy Kernel Compilation: Solve The Error

I compiled my kernel... RHEL5 and kernel version 2.6.18-8.el5. I compiled the new kernel The steps i followed are:
First i unpatched the kernel into a directory /home/src and it came in a folder linux- Then i cd'd into the folder

$cd /home/src/linux-

After that i ran the following command:

$make mproper
$make xconfig (where i removed the ext3 file system, only change i made)
$make dep
$make clean
$make bzImage
$make modules
$make modules_install

Then i created initial ramdisk
$mkinitrd /boot/initrd-

Then i copied the kenel and the system map
$cp arch/x86/boot/bzImage /boot/bzImage-
$cp /boot/
$ln -s /boot/ /boot/

Then i changed the grub file in /etc/grub.conf and added the following lines:

title Test Kernel (
root(hd0,5) //this was given as in the earlier entry
kernel /bzImage- ro root=/dev/VolGroup00/LogVol00 rhgb quiet
initrd /initrd-

Then i rebooted the system... and from the grub menu chose the Test Kernel..
but it gives the error...

mount: error mounting /dev/root on /sysroot as ext3: No such device
setuproot: moving /dev failed: No such file or directory
setuproot: error mouting /proc: No such file or directory
setuproot: error mouting /sys: No such file or directory
swutchroot: mount failed: No such file or directory
kernel panic - not sysncing : attempted to kill init!

Could anyone please help me in removing this error and properly compile the kernel?
Old 03-06-2008, 06:52 AM   #2
Senior Member
Registered: Dec 2005
Location: Indiana
Distribution: RHEL/CentOS/SL 5 i386 and x86_64 pata for IDE in use
Posts: 4,790

Rep: Reputation: 57
You forgot somethings like creating a working kernel configuration before tweaking. You also did a few extra not needed steps and preformed some undesired/unnecessary work, the steps in order and the only steps one need to do are;

make mrproper
make oldconfig ;the step you missed
make menuconfig (or xconfig or gconfig here)
make modules_install
make install ;takes the place of the mkinitrd command, copying files and editing you did

The other junk you did is not required and it sounds like you using an old HOWTO as a reference, please get the updated reference for building a 2.6 kernel from here;

You want(direct link):


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off

Similar Threads
Thread Thread Starter Forum Replies Last Post
Kernel compilation error: Error 15: File not found Niceman2005 Linux - General 9 10-04-2007 03:45 AM
Kernel compilation error windycity_linux Red Hat 1 12-17-2006 07:41 AM
kernel compilation error!! vishamr2000 Linux - General 2 05-12-2006 02:20 PM
kernel compilation error bond_7942 Linux - General 1 02-02-2005 04:35 AM
kernel compilation error bunty Linspire/Freespire 0 09-08-2004 09:22 AM > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 09:51 PM.

Main Menu
Write for LQ is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration