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
zabbix linux How to solve apache error No space left on device: Cannot create SSLMutex
Viewed 2435 times since Wed, Nov 11, 2020
Linux Cluster Tutorial
Viewed 2170 times since Sat, Sep 29, 2018
OEL 7 – How to disable IPv6 on Oracle Linux 7
Viewed 20433 times since Fri, Aug 3, 2018
RHEL: Retrieve and generate a unique SCSI identifier
Viewed 3139 times since Sat, Jun 2, 2018
Linux File Systems (mkfs, mount, fstab) ext4
Viewed 3206 times since Sat, Jun 2, 2018
LOGROTATE – ARCHIWIAZACJA LOGÓW
Viewed 2024 times since Fri, Nov 30, 2018
How to Configure ‘FirewallD’ in RHEL/CentOS 7 and Fedora 21
Viewed 10499 times since Wed, Oct 9, 2019
systemd Auto-restart a crashed service in systemd
Viewed 3241 times since Fri, Jan 17, 2020
Logrotate Example for Custom Logs
Viewed 2633 times since Sun, Jan 12, 2020
Build a simple RPM that packages a single file
Viewed 8559 times since Sat, Jun 2, 2018