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 / UNIX: Run Command a Number of Times In a Row
Viewed 15635 times since Tue, Aug 6, 2019
RHEL: Crash kernel dumps configuration and analysis on RHEL 7
Viewed 6790 times since Sat, Jun 2, 2018
RHCS6: ’fencing’ basics
Viewed 2040 times since Sun, Jun 3, 2018
Procedura powiekszania OCFS2 online
Viewed 5228 times since Fri, Jun 8, 2018
Top 4 Reasons for Node Reboot or Node Eviction in Real Application Cluster (RAC) Environment
Viewed 80635 times since Thu, Jun 21, 2018
Oracle Linux 7 – How to audit changes to a trusted file such as /etc/passwd or /etc/shadow
Viewed 2705 times since Wed, Jul 25, 2018
Linux - How to monitor CPU usage
Viewed 6165 times since Fri, Jun 8, 2018
YUM CRON Enabling automatic updates in Centos 7 and RHEL 7
Viewed 11700 times since Fri, Oct 26, 2018
watchdog How to restart a process out of crontab on a Linux/Unix
Viewed 5708 times since Tue, Jul 31, 2018
Easily Monitor CPU Utilization in Linux Terminal With Stress Terminal UI
Viewed 3729 times since Thu, Apr 18, 2019