LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Slackware
User Name
Password
Slackware This Forum is for the discussion of Slackware Linux.

Notices


Reply
  Search this Thread
Old 11-24-2007, 02:25 AM   #1
tommcd
Senior Member
 
Registered: Jun 2006
Location: Philadelphia PA USA
Distribution: Lubuntu, Slackware
Posts: 2,230

Rep: Reputation: 293Reputation: 293Reputation: 293
can't compile kernel 2.6.23.8 ERROR: no /sbin/init found on rootdev


I have been trying to learn how to compile a kernel. I am using the current kernel from kernel.org (2.6.23.8). I have been following Alien Bob's totally excellent guide:
http://alien.slackbook.org/dokuwiki/...kernelbuilding
as well as the O'Reilly book:
http://kroah.com/lkn/
I used " make oldconfig" first, as in Alien Bob's guide, and I used the config file from Slackware 12's 2.6.21.5-generic-smp kernel found in the /boot directory to configure the kernel. I then did "make xconfig" to enable the changes suggested in Alien Bob's guide. The kernel compiles without errors, but when I try to boot it I get:
-------------------------------------------------
Kernel panic - not syncing : VFS : unable to mount root fs on unknown-block (0,0).
----------------------------------------------------
I assume this is because I need an initrd. I did add ext3 and jbd in the kernel, not as modules, when I ran "make xconfig", but because of the kernel panic I created an initrd for the new kernel anyway. Then when I try to boot the new kernel I get:
-----------------------------------------------------
ERROR: no /sbin/init found on rootdev (or not mounted). Trouble ahead.
Kernel panic -not syncing: Attempted to kill init!
--------------------------------------------------------
I used Alien Bob's guide to compile a new kernel for Zenwalk and it worked fine. Kernel runs great! So I tried running "make oldconfig" on Slackware again but this time using the config from Zenwalk. The new kernel boots ok, except my battery monitor on the laptop don't work.
So using the config from Zenwalk at least lets me boot the kernel, but using the config from Slackware doesn't.
I have been trying this for a few days now and I can't get any further.
Question: which config file should I be using to compile a new kernel using "make oldconfig" for Slack12? I tried compiling a new kernel from scratch using "make xconfig" but I screwed that up too, so I would like to be able to run "make oldconfig" to get things right. Any advice on what I'm missing here using? Any help appreciated, thanks!
 
Old 11-24-2007, 02:56 AM   #2
Alien_Hominid
Senior Member
 
Registered: Oct 2005
Location: Lithuania
Distribution: Hybrid
Posts: 2,247

Rep: Reputation: 53
Do the same steps as in Alien Bob's guide again, but this time do not forget to add your filesystem support into the kernel if you are not going to use initrd.
 
Old 11-24-2007, 03:11 AM   #3
tommcd
Senior Member
 
Registered: Jun 2006
Location: Philadelphia PA USA
Distribution: Lubuntu, Slackware
Posts: 2,230

Original Poster
Rep: Reputation: 293Reputation: 293Reputation: 293
Thanks Alien_H. I did add ext3 and jdb to the kernel (placed a check mark in the box in "make xconfig" for ext3 and jbd). Is there something else I am missing?, and when the kernel would not boot I made an initrd for the new kernel anyway. The I got the 2nd error in my original post.
Am I using the right config file to run "make oldconfig" on to compile a new kernel? I used the one for Slack12's 2.6.21.5-smp kernel, which I am running now. I don't know why it won't boot, even after creating an initrd.
 
Old 11-24-2007, 04:16 AM   #4
pappy_mcfae
Member
 
Registered: Feb 2007
Location: Dallas
Distribution: Gentoo x86 & x86_64
Posts: 190

Rep: Reputation: 31
Post

Quote:
Originally Posted by tommcd View Post
Thanks Alien_H. I did add ext3 and jdb to the kernel (placed a check mark in the box in "make xconfig" for ext3 and jbd). Is there something else I am missing?, and when the kernel would not boot I made an initrd for the new kernel anyway. The I got the 2nd error in my original post.
Am I using the right config file to run "make oldconfig" on to compile a new kernel? I used the one for Slack12's 2.6.21.5-smp kernel, which I am running now. I don't know why it won't boot, even after creating an initrd.
My first thought/question would be, are you actually operating with the ext3 file system, or are you using reiserfs or something else? From what I have read, and from my experience, the kernel panic you list in the original post looks like your file system isn't directly installed in the kernel.

My two cents worth.

Blessed be!
Pappy
 
Old 11-24-2007, 04:45 AM   #5
tommcd
Senior Member
 
Registered: Jun 2006
Location: Philadelphia PA USA
Distribution: Lubuntu, Slackware
Posts: 2,230

Original Poster
Rep: Reputation: 293Reputation: 293Reputation: 293
Thanks Pappy_M, your post made me question that too, but I am indeed using ext3. I am writing this from Slackware 12's stock generic-smp-2.6.21.5 kernel, so I had to create an initrd as per the instructions in /boot/README.initrd to boot this kernel. For reference, here is my fstab (Slackware is on /dev/sda5):
Code:
bash-3.1$ cat /etc/fstab
/dev/sda2        swap             swap        defaults         0   0
/dev/sda5        /                ext3        defaults         1   1
/dev/sda7        /data            ext3        defaults         1   2
#/dev/cdrom      /mnt/cdrom       auto        noauto,user,ro   0   0
/dev/fd0         /mnt/floppy      auto        noauto,owner     0   0
devpts           /dev/pts         devpts      gid=5,mode=620   0   0
proc             /proc            proc        defaults         0   0
bash-3.1$
I am totally new at compiling a kernel. Am I using the right config file to run "make oldconfig" on? I used the one for config-generic-smp-2.6.21.5-smp found in the /boot directory since that it what I am running now.

Last edited by tommcd; 11-24-2007 at 04:46 AM.
 
Old 11-24-2007, 06:05 AM   #6
tobyl
Member
 
Registered: Apr 2003
Location: uk
Distribution: slackware current
Posts: 768

Rep: Reputation: 64
Hi tommcd,

If you have established that the problem is down to differences in your .config files, you could compare them.
Copy them both somewhere, renaming one of them to .config1 or something different.
Get yourself a nice big console window up, cd to where they are and type:

diff -y .config .config1

this one is pretty cool too:
diff -y --suppress-common-lines .config .config1

there are some clever gui programs that do the same type of thing if you prefer, Kompare for instance.
This is not the only way to solve your problem, but it just might save you some legwork...

tobyl
 
Old 11-24-2007, 06:55 AM   #7
tommcd
Senior Member
 
Registered: Jun 2006
Location: Philadelphia PA USA
Distribution: Lubuntu, Slackware
Posts: 2,230

Original Poster
Rep: Reputation: 293Reputation: 293Reputation: 293
Thanks Tobyl, I tried using the diff commands to compare them, but the output is huge. It will take some time to compare them. I will have to let this rest for now.
For now can you suggest which Slackware .config file I should be using to run "make oldconfig" on to compile a new kernel? I have tried config-generic-smp-2.6.21.5-smp and config-generic-2.6.21.5 from Slackware's /boot directory. Both got the same errors. I didn't want to use one of the config files for the huge kernels since according to the Changes_And_Hints.txt we should be running one of the generic kernels, but I guess I could try that since the generic config files don't seem to be working for me.
 
Old 11-24-2007, 07:09 AM   #8
Alien Bob
Slackware Contributor
 
Registered: Sep 2005
Location: Eindhoven, The Netherlands
Distribution: Slackware
Posts: 8,559

Rep: Reputation: 8106Reputation: 8106Reputation: 8106Reputation: 8106Reputation: 8106Reputation: 8106Reputation: 8106Reputation: 8106Reputation: 8106Reputation: 8106Reputation: 8106
Try the slackware-current's kernel config file for a 2.6.23.8 kernel, instead of the old config for a 2.6.21.5 kernel. You can find one here:
http://slackware.osuosl.org/slackwar...p-2.6.23.8-smp

What is the mkinitrd command you are using? What other steps did you take (kernel installation commands, lilo.conf editing, etc). Maybe you missed a step, but you did not document anything in your posts.

Another thing you may be experiencing is that your /dev/sda drive is not called /dev/hda with that new kernel. Try to see what kernel messages during boot refer to harddisk detection, and whether they mention sda or hda.

Eric
 
Old 11-24-2007, 07:12 AM   #9
tobyl
Member
 
Registered: Apr 2003
Location: uk
Distribution: slackware current
Posts: 768

Rep: Reputation: 64
I would have thought config-generic-smp would be best. After make oldconfig, make xconfig and pay special attention to the filesystem, Sata (if you have a sata disk) and ACPI sections. You should at least be able to compare those sections. Remember, if in doubt, compile it in, as opposed to modules. You can fine tune later.

tobyl

edit: ok ignore me, go with what Eric says, I defer to him!

Last edited by tobyl; 11-24-2007 at 07:13 AM. Reason: alien
 
Old 11-24-2007, 07:47 AM   #10
tommcd
Senior Member
 
Registered: Jun 2006
Location: Philadelphia PA USA
Distribution: Lubuntu, Slackware
Posts: 2,230

Original Poster
Rep: Reputation: 293Reputation: 293Reputation: 293
Quote:
Originally Posted by Alien Bob View Post
Try the slackware-current's kernel config file for a 2.6.23.8 kernel, instead of the old config for a 2.6.21.5 kernel. You can find one here:
http://slackware.osuosl.org/slackwar...p-2.6.23.8-smp

What is the mkinitrd command you are using? What other steps did you take (kernel installation commands, lilo.conf editing, etc). Maybe you missed a step, but you did not document anything in your posts.

Another thing you may be experiencing is that your /dev/sda drive is not called /dev/hda with that new kernel. Try to see what kernel messages during boot refer to harddisk detection, and whether they mention sda or hda.

Eric
Thanks. I have been doing this:
cd /usr/src
rm -r linux
tar -xvjf linux-2.6.23.6.tar.bz2
ln -s linux-2.6.23.8 linux
cd linux
make mrproper
Then I copied the generic-smp config to /usr/src/linux/.config and ran make oldconfig, the make xconfig to enable ext3, low latency kernel, and smp processor.
I use grub from ubuntu (on /dev/sda1) to boot Slack, so I didn't have to worry about lilo. I will try the config from Slackware-current you suggested and report back later. (It takes me a while to go through this stuff). I'll try to watch the kernel boot messages more closely. Thanks everyone.
EDIT: oh, and the mkinitrd command was:
mkinitrc -c -k 2.6.23.8 -m ext3 -f ext3 -r /dev/sda5. I also tried just mkinitrd -c -k 2.6.23.8 -m ext3, but it didn't help.

Last edited by tommcd; 11-24-2007 at 08:06 AM.
 
Old 11-24-2007, 08:11 AM   #11
tommcd
Senior Member
 
Registered: Jun 2006
Location: Philadelphia PA USA
Distribution: Lubuntu, Slackware
Posts: 2,230

Original Poster
Rep: Reputation: 293Reputation: 293Reputation: 293
Forgot to add that I also ran "make bzImage" "make modules" "make modules_install" and I copied arch/i386/boot/bzImage, System.map and config to boot, and symlinked the new SYstem.map.
 
Old 11-24-2007, 08:17 AM   #12
duryodhan
Senior Member
 
Registered: Oct 2006
Distribution: Slackware 12 Kernel 2.6.24 - probably upgraded by now
Posts: 1,054

Rep: Reputation: 46
Does the kernel detect your HDD and still say that it can't mount it?

I mean, is it able to find the HDD and not mount it (which is a FS issue) or not able to find the HDD at all (which is an issue with the controllers you compiled in)?
 
Old 11-24-2007, 10:12 AM   #13
tommcd
Senior Member
 
Registered: Jun 2006
Location: Philadelphia PA USA
Distribution: Lubuntu, Slackware
Posts: 2,230

Original Poster
Rep: Reputation: 293Reputation: 293Reputation: 293
Quote:
Originally Posted by duryodhan View Post
Does the kernel detect your HDD and still say that it can't mount it?

I mean, is it able to find the HDD and not mount it (which is a FS issue) or not able to find the HDD at all (which is an issue with the controllers you compiled in)?
This must be the problem. I tried compiling the 2.6.23.8 kernel again using the .config Eric suggested. I got basically the same error:
Code:
VFS: Cannot open root device "sda5" or unknown block(0,0)
Please append a correct "root="boot option; here are the available partitions:
0300...78150744... hda driver: ide-disk
0301...9767488...hda1
0302...979965...hda2
0303........1...hda3
0305...9767488...hda5
0306...9767488...hda6
0307...47865636...hda7
1600...4194302...hdc driver:ide-cdrom
Kernel panic-not syncing: VFS: Unable to mount root filesystem on unknown block(0,0)
So I tried booting again, but this time added root=/dev/hda5 (instead of sda5) to grub's menu. This time it gets a little further... and I get:
Code:
/sbin/e2fsck: No such device or address while trying to open /dev/sda5
Possibly non-existent or swap device?
*************************************************
An error occurred during the root filesystem check. You will be given a chance to log in single-user  mode to fix the problem.
If you are using ext2 filesystem running `e2fsck -v -y <partition>` might help
**************************************************
I tried running the e2fsck command. It then reboots to the same error (the 2nd error listed here).
So it must be something with the file system. Is that right? At least I got a little closer this time!
I enabled every option for ext3 (and jbd) in the kernel, not as a module. I enabled ext2 also. Could that be it? All my partitions are ext3, and sda2 is swap. Slackware is sda5. I can boot the 2.6.21.5-smp kernel using /dev/sda5 with an initrd and it boots just fine.
 
Old 11-24-2007, 11:24 AM   #14
Alien Bob
Slackware Contributor
 
Registered: Sep 2005
Location: Eindhoven, The Netherlands
Distribution: Slackware
Posts: 8,559

Rep: Reputation: 8106Reputation: 8106Reputation: 8106Reputation: 8106Reputation: 8106Reputation: 8106Reputation: 8106Reputation: 8106Reputation: 8106Reputation: 8106Reputation: 8106
Quote:
Please append a correct "root="boot option; here are the available partitions:
0300...78150744... hda driver: ide-disk
0301...9767488...hda1
0302...979965...hda2
0303........1...hda3
0305...9767488...hda5
0306...9767488...hda6
0307...47865636...hda7
1600...4194302...hdc driver:ide-cdrom
OK that proved that indeed your drive is now recognized as /dev/hda instead of /dev/sda.

Now, look at your /etc/fstab ... that one still uses /dev/sdX devices, which lead to your other errors. If you fix that in fstab, you will be OK

Eric
 
Old 11-24-2007, 11:42 AM   #15
jelaiwang
LQ Newbie
 
Registered: Nov 2006
Posts: 28

Rep: Reputation: 15
I experienced a similar problem a few weeks ago when moving from the stock kernel to the newly recompiled kernel. Here are a few notes I took at the time that may help you:

After the first kernel recompile and reboot, there was a kernel panic where the kernel couldn't find the root partition. Here are some facts:

* The stock kernel recognized the SATA hard drive as /dev/sda, but the new kernel recognized the hard drive as /dev/hda.
* In /etc/lilo.conf, root=/dev/sda2. This creates an obvious problem if the hard drive isn't /dev/sda.
* The new kernel had standard IDE/ATA support compiled in, but no SATA.
* The page at http://www.serpentine.com/blog/2006/...s-cddvd-drive/ describes a similar problem and fix for Fedora.
* I took the spirit of this suggestion and removed ATA support (for disk and cdrom) and added it for SATA. This particular computer uses an Intel 82801GBM/GHM (ICH7 family) SATA IDE controller, so I used the ata_piix kernel option.
* In other words, instead of /dev/hda and /dev/hdc, I now have /dev/sda and /dev/sr0.

This was obviously a head-scratcher until I realized what I was going on.

HTH, JW.
 
  


Reply


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
exec of init (/sbin/init) failed!!! kernel panic KiraII Linux - Kernel 1 07-13-2007 09:07 PM
Kernel Panic: No init found- error lgpage Linux - Kernel 3 06-11-2007 05:26 PM
error: No init found. Try passing the init= option to the Kernel neylitalo Linux - Laptop and Netbook 3 01-22-2004 09:34 PM
error "Kernel panic: No init found. Try passing init= option Anauj0101 Linux - Newbie 3 05-06-2003 10:18 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Slackware

All times are GMT -5. The time now is 07:36 PM.

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