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
RHEL: Extending a vmdk (Virtual Machine disk)
Viewed 5144 times since Sun, May 27, 2018
ubuntu How to Reset Forgotten Passwords in Ubuntu 16.04
Viewed 4600 times since Tue, Dec 8, 2020
SPRAWDZONA KONFIGURACJA RSYSLOG I LOGROTATE, JAKO ZEWNĘTRZNEGO SERWERA SYSLOG
Viewed 4638 times since Fri, Nov 30, 2018
Top 20 OpenSSH Server Best Security Practices - good article
Viewed 11881 times since Mon, Oct 1, 2018
Modifying the inode count for an ext2/ext3/ext4 file system
Viewed 17172 times since Fri, Sep 18, 2020
10 Linux nslookup Command Examples for DNS Lookup
Viewed 11028 times since Sun, Sep 30, 2018
How to automate SSH login with password? ssh autologin
Viewed 3500 times since Fri, Jun 8, 2018
An easier way to manage disk decryption at boot with Red Hat Enterprise Linux 7.5 using NBDE
Viewed 8765 times since Mon, Aug 6, 2018
Linux An introduction to swap space on Linux systems
Viewed 3206 times since Thu, Jan 23, 2020
How to disable SSH cipher/ MAC algorithms for Linux and Unix
Viewed 50716 times since Fri, Aug 21, 2020