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
How to retrieve and change partition’s UUID Universally Unique Identifier on linux
Viewed 4636 times since Tue, Jul 17, 2018
Top 10 darmowych i publicznych serwerów DNS
Viewed 3157 times since Tue, May 22, 2018
Learn Linux System Auditing with Auditd Tool on CentOS/RHEL
Viewed 6685 times since Fri, Apr 5, 2019
stunnel basics and pki standards
Viewed 10535 times since Fri, Sep 28, 2018
Linux Linux Network Statistics Tools / Commands
Viewed 10753 times since Mon, Sep 21, 2020
How to convert RAW image to VDI and otherwise
Viewed 16338 times since Wed, Oct 3, 2018
Using etckeeper with git
Viewed 9211 times since Sun, Jun 3, 2018
LVM: Extend SWAP size by adding a new Logical Volume
Viewed 4140 times since Sat, Jun 2, 2018
RHCS6: Install a two-node basic cluster
Viewed 4505 times since Sun, Jun 3, 2018
LVM: Mount LVM Partition(s) in Rescue Mode
Viewed 6559 times since Sat, Jun 2, 2018