Account Links: Cart | Your Account | Logout

Skip to content

Red Hat Knowledgebase

Red Hat Knowledgebase Search:

Updated Within the Last:

New Solutions within the last day New Solutions within the last week New Solutions within the last month

Browse by topics:


Click to View a Topic
Red Hat Enterprise Linux > AS/ES/WS Basics > Issue <<  14 of 908 >>

Solution Tools:


Email a Solution Postcard Printer version Submit a comment on this answer Update notifications Request an answer Back

Article Reference

Article ID: 4969
Last update: 11-24-06
Issue:
How do I rebuild the initial ramdisk image?
Resolution:
When adding hardware like SCSI, SATA, or FibreChannel controllers to the system, it may be necessary to rebuild the initial ramdisk to contain the proper kernel modules to access these devices. After adding the proper line to the modules.conf (Red Hat Enterprise Linux 2.1 or 3) or modprobe.conf (Red Hat Enterprise Linux 4) file, execute this command to rebuild the initial ramdisk:
# cp /boot/initrd-(kernel-version).img /boot/initrd-(kernel-version).img.bak
# mkinitrd -f initrd-$(uname -r).img $(uname -r)
For example:
 
cp /boot/initrd-2.4.21-27.0.2.ELsmp.img /boot/initrd-2.4.21-27.0.2.ELsmp.img.bak
mkinitrd -v -f /boot/initrd-2.4.21-27.0.2.ELsmp.img 2.4.21-27.0.2.ELsmp
This example rebuilds the ramdisk for a system running the 2.4.21-27.0.2 SMP kernel. Adjust the mkinitrd command as necessary to match the kernel version running on your machine or use uname -r as shown above.
  • The -v verbose flag causes mkinitrd to display the names of all the modules it is including in the initial ramdisk.
  • The -f option will force an overwrite of any existing initial ramdisk image for this kernel.

Note: This method has been known to fail with the ICH7 SATA chipset Check for Linux supported drivers prior to rebuilding it.

Note: Make a backup of the existing .img file in /boot for the current kernel if unsure of the stability or configuration of the new module before issuing the mkinitrd command:

# cp /boot/initrd-(kernel-version).img /boot/initrd-(kernel-version).img.bak

Optional: It is possible to create a separate entry in /boot/grub/grub.conf for the backup initial ramdisk image, to conveniently choose the old version at boot time without needing to restore the backup. This example configuration allows selection of either the new or old initial ramdisk image from the grub menu:

title Red Hat Enterprise Linux AS (2.4.21-27.0.2.ELsmp)
root (hd0,0)
kernel /vmlinuz-2.4.21-27.0.2.EL ro root=LABEL=/
initrd /initrd-2.4.21-27.0.2.EL.img
title Backup initrd (2.4.21-27.0.2.ELsmp)
root (hd0,0)
kernel /vmlinuz-2.4.21-27.0.2.EL ro root=LABEL=/
initrd /initrd-2.4.21-27.0.2.EL.img.bak


How well did this entry answer your question?


good wrong incomplete out of date
Red Hat Enterprise Linux > AS/ES/WS Basics > Issue <<   14  of  908  >>