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! |
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.
|
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. |
Quote:
My two cents worth. Blessed be! Pappy |
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 |
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 |
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. |
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 |
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! |
Quote:
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. |
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.
|
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)? |
Quote:
Code:
VFS: Cannot open root device "sda5" or unknown block(0,0) Code:
/sbin/e2fsck: No such device or address while trying to open /dev/sda5 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. |
Quote:
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 |
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. |
All times are GMT -5. The time now is 07:01 PM. |