• Skip to primary navigation
  • Skip to main content
  • Skip to primary sidebar
  • Skip to footer navigation

The Geek Diary

  • OS
    • Linux
    • CentOS/RHEL
    • Solaris
    • Oracle Linux
    • VCS
  • Interview Questions
  • Database
    • oracle
    • oracle 12c
    • ASM
    • mysql
    • MariaDB
  • DevOps
    • Docker
    • Shell Scripting
  • Big Data
    • Hadoop
    • Cloudera
    • Hortonworks HDP

How to Rebuild the “initramfs” with Multipath in CentOS/RHEL 6 and 7

by admin

The initramfs contains kernel modules for all hardware that is required to boot, as well as the initial scripts required to proceed to the next stage of booting. On CentOS/RHEL system, the initramfs contains a complete operational system (which may be used for troubleshooting purposes).

Occasionally, the initramfs image may get damaged as well. If this happens, you cannot boot your server into normal operational mode. To repair the initramfs image after booting into the rescue environment, you can use the dracut command. If used with no arguments, this command creates a new initramfs for the kernel currently loaded.

Alternatively, you can use the dracut command with several options to make an initramfs for specific kernel environments. There is also a configuration file with the name /etc/dracut.conf that you can use to include specific options while re-creating the initramfs.

Backup initramfs

Always make a backup of the current initramfs image in case there are issues with the new version created.

# cp /boot/initramfs-$(uname -r).img /boot/initramfs-$(uname -r).img.$(date +%m-%d-%H%M%S).bak

Rebuild initramfs with multipath

Rebuild the initramfs image with multipath, execute the dracut command with the following options:

CentOS/RHEL 6

# dracut -v -f -a multipath --include /etc/multipath /etc/multipath

CentOS/RHEL 7

# dracut --force --add multipath --include /etc/multipath

Verify

Verify the new initramfs image was created in /boot directory:

# ls -lrt /boot/initramfs-$(uname -r).img

Reboot

Reboot the system with the newly created initramfs image.

# reboot

Filed Under: CentOS/RHEL 6, CentOS/RHEL 7, Linux

Some more articles you might also be interested in …

  1. CentOS / RHEL 7 : How to open a port in the firewall with firewall-cmd?
  2. e4defrag Command Examples in Linux
  3. aa-enforce: command not found
  4. ORA-01031: insufficient privileges when creating a materialized view
  5. “az version” Command Examples (Shows the current version of Azure CLI modules and extensions)
  6. ntpq Command Examples in Linux
  7. flameshot: command not found
  8. CentOS / RHEL 5,6 : How to Change the timezone
  9. How to change the default IP address of docker bridge
  10. mktemp: command not found

You May Also Like

Primary Sidebar

Recent Posts

  • Chezmoi: A multi-machine dotfile manager, written in Go
  • cheat: Create and view interactive cheat sheets on the command-line
  • chars: Display names and codes for various ASCII and Unicode characters and code points
  • chafa: Image printing in the terminal

© 2023 · The Geek Diary

  • Archives
  • Contact Us
  • Copyright