Rebuild Initrd in Centos / Redhat

Boot in Rescue Mode

Please perform the following steps:

Boot from a CentOS installation disc (for example, CD #1 or DVD).
Type “linux rescue” at the “boot:” prompt.
Mount all filesystems in read-write mode.
Create the New Initrd

Change root to real root (‘/’) on your hard disk and make the initrd. (The example is for the latest CentOS 5.5 kernel, as of this writing. Modify it for your current kernel.)
mount –bind /proc /mnt/sysimage/proc
mount –bind /dev /mnt/sysimage/dev
mount –bind /sys /mnt/sysimage/sys
chroot /mnt/sysimage
cd /boot
mv initrd-2.6.18-194.32.1.el5.img initrd-2.6.18-194.32.1.el5.old.img
mkinitrd initrd-2.6.18-194.32.1.el5.img 2.6.18-194.32.1.el5

If you are migrating a physical machine to a virtual one using the Xen hypervisor, replace the last command above with:
mkinitrd –with-xenblk initrd-2.6.18-194.32.1.el5xen.img 2.6.18-194.32.1.el5xen

Many other options may be exercised, such as adding non-loaded modules manually. See man mkinitrd for details. It may be necessary to modify /boot/grub/grub.conf and/or /etc/fstab depending on the details of your installation. This depends on your use of LABEL and/or UUID versus physical devices in the files, and is too complex an issue to get into in any detail in a TipsAndTricks article.
cd /
sync; sync; sync
telinit 6

WP Twitter Auto Publish Powered By :