PDA

View Full Version : Kernel panic on vanilla 2.6.21.3 kernel



kirktrue
26th May 2007, 08:59 PM
I get a kernel panic on boot when I upgraded from a vanilla 2.6.20.4 to a vanilla 2.6.21.3 kernel on a Fedora Core 6 box. Here's the relevant part of the log:


Creating root device.
Mounting root filesystem.
mount: could not find filesystem '/dev/root'
Setting up other filesystems.
Setting up new root fs
setuproot: moving /dev failed: No such file or directory
no fstab.sys, mounting internal defaults
setuproot: error mounting /proc: No such file or directory
setuproot: error mounting /sys: No such file or directory
Switching to new root and running init.
unmounting old /dev
unmounting old /proc
unmounting old /sys
switchroot: mount failed: No such file or directory
[ 580.767825] Kernel panic - not syncing: Attempted to kill init!

What I believe is happening is that the builtin nash command mkrootdev is silently failing to produce a /dev/root. I assume this because I added a call to the init script that lists the entries in the /dev file system at boot time:


find /dev

This is output right after the mkrootdev call but before the setuproot call. I see about two dozen or so /dev entries from the find command on the console. However, on 2.6.21.3, /dev/root is not listed, but it is listed for 2.6.20.4. As such, 2.6.20.4 boots fine whereas 2.6.21.3 then panics.

Here is what my 2.6.20.4 boot log looks like:


Creating root device.
Mounting root filesystem.
kjournald starting. Commit interval 5 seconds
EXT3-fs: mounted filesystem with ordered data mode.
Setting up other filesystems.
Setting up new root fs
no fstab.sys, mounting internal defaults
Switching to new root and running init.
unmounting old /dev
unmounting old /proc
unmounting old /sys

Regarding my root= option, it's /dev/sda3 as opposed to LABEL=/. My root filesystem is ext3 which is a module as opposed to built-in. However, my 2.6.20.4 kernel was the same way and caused no issues.

So, it would seem that mkinitrd is not creating a /dev entry for the root device. Based on some Google-ing, I tried to manually create the entry in my init script:


mknod /dev/sda3 b 8 3
mknod /dev/root b 8 3

But then it said:


Creating root device.
Mounting root filesystem.
mount: error mounting /dev/root on /sysroot as ext3: No such device or address
Setting up other filesystems.
Setting up new root fs
setuproot: moving /dev failed: No such file or directory
no fstab.sys, mounting internal defaults
setuproot: error mounting /proc: No such file or directory
setuproot: error mounting /sys: No such file or directory
Switching to new root and running init.
unmounting old /dev
unmounting old /proc
unmounting old /sys
switchroot: mount failed: No such file or directory
[ 292.981508] Kernel panic - not syncing: Attempted to kill init!


I have heard some references to udev and have seen some calls to /sbin/udevstartup or something in some user's init scripts, but my mkinitrd does not generate this call.

Any ideas? I've been working on this for nearly a week now and Google-ing for it ad naseum. I've heard that Fedora is not too friendly to vanilla kernels, but I don't really want to switch my whole distro because of this issue.

Thanks!

sideways
26th May 2007, 09:25 PM
Try labelling sda3 and referring to it by its label in grub.conf and fstab

eg see 'important warnings' in this blog
http://ostoolbox.blogspot.com/2007/04/fedora-7-test-4-693-released.html

lmo
27th May 2007, 12:09 AM
When you "upgraded from a vanilla 2.6.20.4 to a vanilla 2.6.21.3" could you have left out a step? If it didn't do the mkinitrd for the new kernel, I think it could cause that error.