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:

rd.auto=1

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:

add_dracutmodules+="mdraid"

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.


Tags:

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

  • How To Upgrade Debian 8,9,10 to Debian 12 Bookworm
  • Linux dhcp dhclient Mint Redhat Ubuntu Debian How To Use Local Domain DNS Server Instead of ISPs
  • Docker dockerd swarm high CPU usage cause solution
  • Docker Minimum Requirements/How Efficient is Docker? How Much Memory Does Dockerd Use?
  • qemu-nbd: Failed to set NBD socket solution qemu-nbd: Disconnect client, due to: Failed to read request: Unexpected end-of-file before all bytes were read
  • apache2 httpd apache server will not start [pid 22449:tid 139972160445760] AH00052: child pid 23248 exit signal Aborted (6) solution Mint Debian Ubuntu Redhat
  • How to use the FTDI USB serial cable to RJ45 adapter to connect to the console on Cisco/Juniper Switch Router Firewall in Linux Ubuntu Debian Redhat
  • How To Setup Python3 in Ubuntu Docker Image for AI Deep Learning
  • How to Configure NVIDIA GPUs with Docker on Ubuntu: A Comprehensive Guide for AI Deep Learning CUDA Solution
  • Linux Ubuntu Mint how to check nameservers when /etc/resolv.conf disabled solution
  • Docker cannot work on other overlayfs filesystems such as ecryptfs won't start overlayfs: filesystem on '/home/docker/overlay2/check-overlayfs-support130645871/upper' not supported as upperdir
  • Linux How To Access Original Contents of Directory Mounted Debian Mint CentOS Redhat Solution
  • ecryptfs how to manually encrypt your existing home directory or other directory
  • How to Reset CIPC Cisco IP Communicator for CME CUCM CallManager
  • Internet Explorer Cannot Download File "Your security settings do not allow for this file to be downloaded." Security Settings Solution
  • Linux How To Upgrade To The Latest Kernel Debian Mint Ubuntu
  • Firefox how to restore and backup saved passwords and history which files/location
  • Linux How To echo as root solution to use tee permission denied solution Ubuntu Debian Mint Redhat CentOS
  • Linux how to keep command line bash process running if you are disconnected or need to logout of SSH remotely
  • Linux swapping too much? How to check the swappiness and stop swapping