How to ensure sure you can boot if your initrd image has problems

I was playing around with some new kernel bits a few weeks back, and needed to update my initrd image. Having encountered various situations where a box wouldn’t boot due to a botched initrd file, I have become overly protective of this file. Now each time I have to perform an update, I will first create a backup of the file:

$ cp /boot/initrd-


Once I have a working backup, I like to add a menu.lst entry that allows me to restore to a know working state:

title Fedora 11 (
root (hd0,0)
kernel /vmlinuz- ro root=LABEL=/
initrd /initrd-

If my changes cause the machine to fail to boot, I can pick the backup menu entry and I’m off and running. If you don’t want to pollute your menu.lst, you can also specify the initrd manually from the grub command menu. Backups are key, and not having to boot into rescue mode is huge. :)

This article was posted by Matty on 2010-05-27 09:31:00 -0400 EDT