Situation:
After copying a Fedora Core 3 partition to a new harddrive (using Knoppix) I was at first unable to boot the new partition (using Grub).
I got the following error:
switchroot: mount failed: 22
umount /initrd/dev failed: 2
Kernel panic - no syncing: Attemped to kill init!
I vaguely remembered having this situation before, but really couldn’t remember how I dealt with it.
Googling around didn’t really produce much results at first (only more people having the same issue, but no real answers), but I was able to puzzle a solution together.
Problem:
It turned out that both my grub.conf and /etc/fstab files contained a reference to a ‘LABEL’ that seemed to be missing. Relevant entry of grub.conf:
title Fedora Core (2.6.9-1.667)
root (hd0,5)
kernel /boot/vmlinuz-2.6.9-1.667 ro root=LABEL=/ rhgb quiet
initrd /boot/initrd-2.6.9-1.667.img
entry of fstab:
LABEL=/ / ext3 defaults 1 1
Solution:
For as far as I understand you’d normally put a device here (in my case I would have been able use /dev/hda6 in both files), but the ‘LABEL=/’ here means as much as ‘use the partition with label /’.
Putting a label on a partition is possible using ‘e2label’. I labelled my /dev/hda6 as follows (using Knoppix):
su
mount -o dev,rw /mnt/hda6
(to mount my new partition writable)
e2label /mnt/hda6 /
Apparently it’s also possible to set the partition label/volume name using ‘tune2fs’, but since the above worked for me I didn’t really look into this.