CentOS 7 / 8 cannot boot with with mdadm RAID array solution

This article about migrating to a CentOS 7 /8 RAID mdadm array has a lot of info but I wanted to focus specifically on what newer versions of CentOS 7 require to boot mdadm and what changes are necessary on CentOS 7.8+

CentOS 7 / 8 mdadm RAID booting requirements

This assumes you are chrooting into an existing install or using it to get a new deployment ready.  However, these steps can fix existing mdadm installs that don't boot properly either (but you'll want to boot either into rescue or a Live environment and then chroot).

Check this if you need to learn how to chroot into your OS

1.) Install mdadm:

yum -y install mdadm

2.) Edit /etc/default grub like this

Without rd.auto=1 you will find that it won't be able to boot or assemble your RAID array.

Edit the GRUB_CMDLINE_LINUX line and add:


3.) Update your grub.cfg file

grub2-mkconfig -o /boot/efi/EFI/redhat/grub.cfg

4.) Update your /etc/dracut.conf

Update your dracut.conf as this is critical for new kernels that you install, otherwise the initramfs will not contain mdraid and your array will be inaccessible.  You'll forget long after this, until you find your server can't boot after a kernel update!

Just uncomment and enable the "add_dracutmodules" to be like below:


5.) Update the existing initramfs files

You'll want to do this otherwise the initramfs is missing the mdadm kernel module, so your array won't be accessible and boot will fail.

For each initramfs in /boot you'll want to do this:

*Change the name of initramfs to match yours

dracut --add="mdraid" /boot/initramfs-3.10.0-1127.13.1.el7.x86_64.img 3.10.0-1127.13.1.el7.x86_64 --force

Notice that after the initramfs full name, you need to take the full kernel name and place it, which in the example above was "3.10.0-1127.13.1.el7.x86_64" this is critical as if you miss the kernel name, it will create but just won't work and you'll still be unable to boot.


If you've done something wrong configuring your CentOS 7 8 mdadm RAID array you'll see something like this when you boot:

Warning: /dev/disk/by-uuid/ does not exist

Entering emergency mode.


centos, mdadm, raid, array, solutionthis, migrating, info, newer, versions, booting, requirements, assumes, chrooting, existing, install, deployment, installs, ll, chroot, os, yum, edit, etc, default, grub, rd, auto, assemble, grub_cmdline_linux, update, cfg, mkconfig, efi, redhat, dracut, conf, kernels, initramfs, contain, mdraid, inaccessible, server, kernel, uncomment, enable, quot, add_dracutmodules, updates, module, accessible, _, img, unable, ve, configuring, dev, disk, uuid, mode,

Latest Articles

  • vi cannot copy and paste automatic visual mode solution
  • python3 error Ubuntu Linux error solution SyntaxError: invalid syntax line 12 pip{sys.version_info.major}
  • Could not read response to hello message from hook [ ! -f /usr/bin/snap ] || /usr/bin/snap advise-snap --from-apt 2>/dev/null || true: Connection reset by peer
  • -bash: expr: command not found Linux Debian Mint Ubuntu
  • How to remove metadata from pdf on Linux Ubuntu
  • How to install and configure haproxy on Linux Ubuntu Debian
  • Linux Ubuntu Mint Gnome keyboard Typing not working in certain application or window solution
  • talib/_ta_lib.c:747:10: fatal error: ta-lib/ta_defs.h: No such file or directory
  • How to install Windows or other OS and then bring to another computer by using a physical drive and Virtual Machine with QEMU
  • PXE-E23 Error BOOTx64.EFI GRUB booting is 0 bytes tftp pxe dhcp solution NBP filesize is 0 Bytes
  • vagrant install on Debian Mint Ubuntu Linux RHEL Quick Setup Guide Tutorial
  • RHEL 8 CentOS 8, Alma Linux 8, Rocky Linux 8 System Not Booting with RAID or on other servers/computers Solution for dracut and initramfs missing kernel modules
  • How to Upgrade to Debian 11 from Version 8,9,10
  • Ubuntu Linux Mint Debian Redhat Cannot View Files on Android iPhone USB File Transfer Not Working Solution
  • Virtualbox Best Networking Mode In Lab/Work Environment without using NAT Network or Bridged
  • debootstrap how to install Ubuntu, Mint, Debian install
  • Linux grub not using UUID for the root device instead it uses /dev/sda1 or other device name solution
  • How To Restore Partition Table on Running Linux Mint Ubuntu Debian Machine
  • Debian Ubuntu apt install stop daemon questions/accept the default action without prompting
  • iptables NAT how to enable PPTP in newer Debian/Ubuntu/Mint Kernels Linux