Linux – How to repair unbootable Fedora install

fedoralinuxyum

How do you repair/reinstall Fedora without deleting any existing partitions or data?

I was attempting to upgrade some old Fedora 13 servers to 17, following the instructions in the wiki. After the 14->15 upgrade, rebooting resulted in the output:

Dropping to debug shell.

sh: can't access tty; job control turned off
dracut:/#

Running dmesg also shows:

dracut Warning: No root device "block:/dev/mapper/VolGroup-lv_root" found

Googling shows this error is typically related to some weird RAID issues, but my server is a virtual machine not using any RAID. Using a rescue CD, I can chroot /mnt/sysimage, and all packages and data still seems to be there. How do I make the system bootable again?

Best Answer

Apparently, it's not uncommon for Fedora's upgrade process to corrupt the /boot/initramfs filesystem, resulting in an unbootable system.

Using a tip I found here, the solution is to boot using a Fedora Live CD, and select "rescue installed system" from the menu. Then walk through the menu to get to the rescue shell. Then mount the system using chroot /mnt/sysimage. The tip recommended repairing initramfs by running:

mv /boot/initramfs-$(uname -r).img /boot/initramfs-$(uname -r)-nouveau.img
dracut /boot/initramfs-$(uname -r).img $(uname -r)

However, since you'll be running the Live CD's kernel, this will likely fail if your system's kernel version does not exactly match the Live CD. My Live CD was using a 2.6.* kernel, but I had a 3.4.* kernel installed, so I ran:

mv /boot/initramfs-3.4.2-1.fc16.x86_64.img /boot/initramfs-3.4.2-1.fc16.x86_64-nouveau.img
dracut /boot/initramfs-3.4.2-1.fc16.x86_64.img 3.4.2-1.fc16.x86_64
exit

Afterwards, removing the Live CD and then rebooting resulted in a bootable system.

Related Topic