/dev/root kernel panic: Possible mkinitrd bug?

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



I've experienced the /dev/root kernel panic that a lot of folks have
experienced.  I get the following during my boot process:

Trying to resume from /dev/hdc1
No suspend signature on swap, not resuming.
Creating root device.
Mounting root filesystem.
mount: could not find filesystem '/dev/root'
Setting up other filesustems.
Setting up new foor 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 ew root and running init.
unmounting old /dev
unmounting old /proc
unmounting old /sys
switchroot: mount failed: No such file or directory
Kernel panic - not syncing: No such file or directory
[<c011a32e>] panic+0x3e/0x170 [<c011cede>] do_exit+0x71/0x6c8
[<c011d5b9>] sys_exit_group+0x0/0xd [<c0102bc1>] syscall_call+0x7/0xb

I'm not using LVMs on my linux drive.  It's a 320 gig Western Digital
drive with an 8 gig swap partition and the rest is the root file system.
I'm using lilo v 22.6 on Fedora Core 5 and I've not switched to grub
only because I'm trying to figure out how to migrate from lilo to grub.

My current lilo.conf file:

boot = /dev/hda
timeout = 50
prompt
  default = linux
  vga = 0x318
  read-only
map=/boot/map
install=/boot/boot.b

image = /boot/vmlinuz-2.6.17-1.2139_FC5
  label=2.6.17-1.2139_F
  append="mem=1024M"
  initrd=/boot/initrd-2.6.17-1.2139_FC5.img
  root=/dev/hdc2

image = /boot/vmlinuz-2.6.17.3
  label=linux
  append="mem=1024M"
  initrd=/boot/initrd-2.6.17.3.img
  root=/dev/hdc2

image = /boot/vmlinuz-2.6.16.19
  label=linux-prev
  append="mem=1024M"
  initrd=/boot/initrd-2.6.16.19.img
  root=/dev/hdc2

other = /dev/hda1
  label = Windows




Here's my /etc/fstab.  /dev/hda is another 320 gig Western Digital hard
drive running Windows XP on VFAT:

/dev/hdc2  / ext3 defaults 1 1
/dev/fd0   mnt/floppy  auto user,exec,dev,suid,rw,noauto 0 0
none      /proc        proc    defaults        0 0
none      /dev/shm                tmpfs   defaults        0 0
none      /dev/pts                devpts  gid=5,mode=620       0 0
/dev/hdc1  swap                    swap    defaults        
none /sys sysfs defaults 0 0


I did find a solution for it at Linuxquestions.org (see
http://www.linuxquestions.org/questions/showthread.php?t=433048) and I
noticed that in the init file that mkinitrd produces there's a
"mount /sysroot" line that seems to be the source of the problem.  It
should be "mount -o defaults --ro -t ext3 /dev/hdc2 /sysroot"  but this
doesn't get written out by default. It's trying to mount /dev/root
to /sysroot and /dev/root is apparently deprecated in FC5.

As per the LinuxQuestions thread I've done the following steps:

1) Boot with the rescue CD
2) Type 'chroot /mnt/sysimage' (wherever it mounts the Fedora 5
partition)
3) 'cd /boot'
4) 'mkdir newinit'
5) 'cd newinit'
6) 'gunzip -c ../initrd-2.6.15-1.2054_FC5.img | cpio -idmv'
7) 'vi init'
8) Find 'mount /sysroot' (near the end of the file)
9) Delete or comment this out
10) Replace with 'mount -o defaults --ro -t
ext3 /dev/VolGroup00/LogVol00 /sysroot' where /dev/VolGroup00/LogVol00
is the mount point for /
11) ':wq' out of vi
12) 'find . | cpio --quiet -c -o >../newinitrd'
13) 'cd ..' - you are now in /boot
14) 'mv initrd-2.6.15-1.2054_FC5.img initrd-2.6.15-1.2054_FC5.bak' -
backup current initrd img file (just in case)
15) 'gzip -9 < newinitrd > initrd-2.6.15-1.2054_FC5.img'
16) Reboot the computer without the CD

My init file that's in the initrd image looks like this:

mount -t proc /proc /proc
setquiet
echo Mounting proc filesystem
echo Mounting sysfs filesystem
mount -t sysfs /sys /sys
echo Creating /dev
mount -o mode=0755 -t tmpfs /dev /dev
mkdir /dev/pts
mount -t devpts -o gid=5,mode=620 /dev/pts /dev/pts
mkdir /dev/shm
mkdir /dev/mapper
echo Creating initial device nodes
mknod /dev/null c 1 3
mknod /dev/zero c 1 5
mknod /dev/systty c 4 0
mknod /dev/tty c 5 0
mknod /dev/console c 5 1
mknod /dev/ptmx c 5 2
mknod /dev/rtc c 10 135
mknod /dev/tty0 c 4 0
mknod /dev/tty1 c 4 1
mknod /dev/tty2 c 4 2
mknod /dev/tty3 c 4 3
mknod /dev/tty4 c 4 4
mknod /dev/tty5 c 4 5
mknod /dev/tty6 c 4 6
mknod /dev/tty7 c 4 7
mknod /dev/tty8 c 4 8
mknod /dev/tty9 c 4 9
mknod /dev/tty10 c 4 10
mknod /dev/tty11 c 4 11
mknod /dev/tty12 c 4 12
mknod /dev/ttyS0 c 4 64
mknod /dev/ttyS1 c 4 65
mknod /dev/ttyS2 c 4 66
mknod /dev/ttyS3 c 4 67
echo Setting up hotplug.
hotplug
echo Creating block device nodes.
mkblkdevs
echo "Loading advansys.ko module"
insmod /lib/advansys.ko 
mkblkdevs
resume /dev/hdc1
echo Creating root device.
mkrootdev -t ext3 -o defaults,ro /dev/hdc2
echo Mounting root filesystem.
# mount /sysroot
mount -o defaults --ro -t ext3 /dev/hdc2 /sysroot
echo Setting up other filesystems.
setuproot
echo Switching to new root and running init.
switchroot

I'm suspecting that this is caused by a bug in mkinitrd because I first
noticed this when building a custom kernel and when I booted into the
new kernel I got the kernel panic.  I have to do the above procedure
every time I build a new kernel and even the kernel RPMs from the Fedora
Core 5 Updates repository will do the same thing.

If there's something that I'm doing wrong I'm still trying to figure out
what it is if mkinitrd is not the issue.

Thanks!,
Brian


[Index of Archives]     [Current Fedora Users]     [Fedora Desktop]     [Fedora SELinux]     [Yosemite News]     [Yosemite Photos]     [KDE Users]     [Fedora Tools]     [Fedora Docs]

  Powered by Linux