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
Linux - How to monitor CPU usage
Viewed 6674 times since Fri, Jun 8, 2018
Monitoring bezpieczeństwa Linux: integracja auditd + OSSEC cz. I
Viewed 2662 times since Fri, Apr 5, 2019
Open SSL Encrypt & Decrypt Files With Password Using OpenSSL
Viewed 8736 times since Mon, Feb 18, 2019
Need to set up yum repository for locally-mounted DVD on Red Hat Enterprise Linux 7
Viewed 3391 times since Mon, Oct 29, 2018
FIO (Flexible I/O) – a benchmark tool for any operating system
Viewed 19748 times since Wed, Jul 25, 2018
Top 25 Best Linux Performance Monitoring and Debugging Tools
Viewed 7307 times since Sun, Sep 30, 2018
RHCS6: Basic operations on clustered services
Viewed 2881 times since Sun, Jun 3, 2018
10 Linux rsync Examples to Exclude Files/Directories
Viewed 11163 times since Wed, Oct 31, 2018
Manage SSH Key File With Passphrase
Viewed 2454 times since Tue, Mar 5, 2019
Using stunnel to Encrypt Database Connections
Viewed 4126 times since Fri, Sep 28, 2018