How To Rebuild The Initial Ramdisk Image in Red Hat Enterprise Linux - Red Hat Customer Portal
How To Rebuild The Initial Ramdisk Image in Red Hat Enterprise Linux - Red Hat Customer Portal
(https://access.redhat.com/)
Environment
Red Hat Enterprise Linux (RHEL) 3,4,5,6,7
initrd / initramfs image
Issue
How to rebuild the initial ramdisk image in Red Hat Enterprise Linux
How to rebuild initial ram disk image in Red Hat Enterprise Linux
How to remake or recreate the initrd or initramfs
The /etc/lvm/lvm.conf and root file system resides on a logical volume. How to ensure the
changes are applied upon rebooting?
The /etc/multipath.conf and my root file system resides on a multipath device. How to
ensure the changes are applied upon rebooting?
The module options in /etc/modprobe.conf or /etc/modprobe.d/ have been modified. How
to ensure the changes are applied upon rebooting?
Resolution
When adding new hardware to a system, or after changing configuration files that may be used very
early in the boot process, or when changing the options on a kernel module, it may be necessary to
rebuild the initial ramdisk (also known as initrd or initramfs) to include the proper kernel modules,
files, and configuration directives.
https://access.redhat.com/solutions/1958#initrd 1/8
6/6/2020 How to rebuild the initial ramdisk image in Red Hat Enterprise Linux - Red Hat Customer Portal
Once the necessary modifications have been made, it is time to rebuild the initrd. This process
differs based on the version of RHEL. In these examples you will see the usage of $(uname -r) ,
which is a way to pass the current kernel version into a command without actually typing it out. If
you are working with a version of the kernel other than what is currently running, then replace
$(uname -r) with the actual kernel version, such as 2.6.18-274.el5 .
# dracut -f -v
If you are in a kernel version different to the initrd you are building (including if you are in Rescue
Mode) you must specify the full kernel version, including architecture:
https://access.redhat.com/solutions/1958#initrd 2/8
6/6/2020 How to rebuild the initial ramdisk image in Red Hat Enterprise Linux - Red Hat Customer Portal
If the customized kernel menu entry does not appear in the grub configuration file(s), rebuild the
grub menu. This rebuild is nominally performed by dracut, but can not be successfully completed in
some corner cases.
# grub2-mkconfig -o /boot/grub2/grub.cfg
# grub2-mkconfig -o /boot/efi/EFI/redhat/grub.cfg
The -v verbose flag causes mkinitrd to display the names of all the modules it is including
in the initial ramdisk.
The -f option will force an overwrite of any existing initial ramdisk image at the path you
have specified
https://access.redhat.com/solutions/1958#initrd 3/8
6/6/2020 How to rebuild the initial ramdisk image in Red Hat Enterprise Linux - Red Hat Customer Portal
If you are in a kernel version different to the initrd you are building (including if you are in Rescue
(https://access.redhat.com/)
Mode) you must specify the full kernel version, without architecture:
Alternatively, you can enter edit-mode in grub if you need to choose the old initrd and did not
make a separate entry in grub.conf before rebooting. To do so:
Note: This procedure does not actually make the change persistent. The next boot will continue to
use the original grub.conf configuration unless it is updated.
This solution is part of Red Hat’s fast-track publication program, providing a huge library of
solutions that Red Hat engineers have created while supporting our customers. To give you the
knowledge you need the instant it becomes available, these articles may be presented in a raw and
unedited form.
How do I rebuild the initramfs with multipath in Red Hat Enterprise Linux 6 and 7
9 Comments
23 July 2012 2:53 PM (https://access.redhat.com/solutions/1958#comment-384053)
SR Sylwester Rutkowski (/user/1617733)
(/user/1617733)
https://access.redhat.com/solutions/1958#initrd 5/8
6/6/2020 How to rebuild the initial ramdisk image in Red Hat Enterprise Linux - Red Hat Customer Portal
NEWBIE
Actually, when rebuilding initrd on RHEL 5.8 the command should be:
(https://access.redhat.com/)
7 Points mkinitrd -f -v /boot/initrd-$(uname -r).img $(uname -r)
(entering -fv returns syntax error)
≤ Reply (/Ajax_comments/Reply/1958/384053)
≤ Reply (/Ajax_comments/Reply/1958/392033)
From the RHCE: "...filters can be a little tricky depending on what path the pv was
created on and the way the disk enumerate. Unless you have around 100 or more disk
presented to the server, I recommend leaving the default filter. "
≤ Reply (/Ajax_comments/Reply/1958/1037311)
7 Points
≤ Reply (/Ajax_comments/Reply/1958/1338251)
(https://access.redhat.com/)
9 August 2018 7:04 AM (https://access.redhat.com/solutions/1958#comment-1340111)
MR Mushfiqur Rahman (/user/20306341)
(/user/20306341)
good one, dra.cut starter
RED HAT
22 Points
≤ Reply (/Ajax_comments/Reply/1958/1630681)
≤ Reply (/Ajax_comments/Reply/1958/1802121)
All systems operational (https://status.redhat.com)
https://access.redhat.com/solutions/1958#initrd 7/8
6/6/2020 How to rebuild the initial ramdisk image in Red Hat Enterprise Linux - Red Hat Customer Portal
(https://access.redhat.com/)
Privacy Statement (http://www.redhat.com/en/about/privacy-
policy)
Customer Portal Terms of Use
(https://access.redhat.com/help/terms/)
All Policies and Guidelines
(http://www.redhat.com/en/about/all-policies-guidelines)
https://access.redhat.com/solutions/1958#initrd 8/8