HOWTO Rebuild an Initrd Image
Introduction
This document describes how to rebuild an initrd image file on a Debian 4.0 (Etch) system.
This can be necessary, if for example you restore your system to a different RAID or LVM setup, where the volume IDs may have changed. (Note that you will no doubt need to modify /etc/lvm/lvm.conf and /etc/mdadm/mdadm.conf to use the new volume IDs).
Rebuilding Initrd Image
Where you've booted off a rescue disk and mounted your normal root and boot partitions under say, /mnt/bak, you can rebuild an initrd image with the following:
# mkinitramfs -d /mnt/bak/etc/initramfs-tools -o /mnt/bak/boot/new.img -r /mnt/bak
You can then add another 'test' entry to your grub configuration file (/mnt/bak/boot/grub/menu.lst) to use new.img intead of the standard initrd image file. If it boots into your system successfully, just re-create the standard initrd image with:
# mkinitramfs -o /boot/initrd.img-2.6.18-6-686
Which should create an image configured identically to the way a new one is created on a kernel upgrade.
See also 'man update-initramfs'
Related Topics: LinuxSoftwareRaid, LogicalVolumeManagement
-- Frank Dean - 03 Jan 2009