RHEL: Rebuilding the initial ramdisk image

RHEL: Rebuilding the initial ramdisk image

# Tested on RHEL 5, 6 & 7

# Sometimes it may be necessary to rebuild the initial ramdisk (also known as initrd or
# initramfs) to include new kernel modules, files, etc.


#
RHEL 3, 4 & 5: Rebuilding the initrd
# ------------------------------------------------------------------------------------------

cp /boot/initrd-$(uname -r).img /boot/initrd-$(uname -r).img.bak

mkinitrd -f -v /boot/initrd-$(uname -r).img $(uname -r)

# If we are in a kernel version different to the initrd we are building we must specify
# the full kernel version, without architecture:

mkinitrd -f -v /boot/initrd-2.6.18-348.2.1.el5.img 2.6.18-348.2.1.el5



#
RHEL 6 & 7: Rebuilding the initramfs
# ------------------------------------------------------------------------------------------

cp /boot/initramfs-$(uname -r).img /boot/initramfs-$(uname -r).img.bak

dracut -f

# If we are in a kernel version different to the initrd we are building we must specify
# the full kernel version, including architecture:

dracut -f /boot/initramfs-2.6.32-220.7.1.el6.x86_64.img 2.6.32-220.7.1.el6.x86_64


# *** Consider adding a new grub/grub2 entry pointing to the initial ramdisk image, that
#     will allow you to choose the old version at boot time without restoring the backup
5 (1)
Article Rating (1 Votes)
Rate this article
Attachments
There are no attachments for this article.
Comments
There are no comments for this article. Be the first to post a comment.
Full Name
Email Address
Security Code Security Code
Related Articles RSS Feed
Prosty skaner portów TCP w bash
Viewed 3116 times since Thu, May 24, 2018
Red Hat 8 How to Set Up Automatic Updates for CentOS 8
Viewed 3495 times since Fri, Sep 25, 2020
10 Linux rsync Examples to Exclude Files/Directories
Viewed 10720 times since Wed, Oct 31, 2018
RHEL : How to deal with “CLOSE_WAIT” and “TIME_WAIT” connection
Viewed 25420 times since Thu, Feb 14, 2019
Use Fail2ban to Secure Your Server
Viewed 14385 times since Fri, Jul 5, 2019
HowTo: The Ultimate Logrotate Command Tutorial with 10 Examples
Viewed 4874 times since Fri, Nov 30, 2018
debian Debian/Ubuntu Linux: Find If Installed APT Package Includes a Fix/Patch Via CVE Number
Viewed 9295 times since Sun, Sep 23, 2018
stunnel basics and pki standards
Viewed 9315 times since Fri, Sep 28, 2018
RHEL7: Create and configure LUKS-encrypted partitions and logical volumes to prompt for password and mount a decrypted file system at boot.
Viewed 11523 times since Mon, Aug 6, 2018
Linux - How to get network speed and statistic of ethernet adapter in Linux
Viewed 1978 times since Fri, Jun 8, 2018