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

  • Proxmox How To Purge Ceph
  • VMWare ESXi/VSphere Disable Balloon Segfault in Services Solution
  • Apache Linux Debian Ubuntu Container how to manually restart without killing
  • Docker enable UTF8 in Container to stop seeing gibberish ? characters
  • Debian 8 How To Use Apt Update Archive sources.list
  • Debian Live CD Password
  • Forbidden You don't have permission to access this resource. [authz_core:error] [pid 338:tid 338] [client 1.2.3.4:55046] AH01630: client denied by server configuration:
  • The client needs a new connection for this request as the requested host name does not match the Server Name Indication (SNI) in use for this connection.
  • Asterisk RTP/audio not working in either direction in Docker NAT with a NAT client
  • dovecot: imap(root@localhost)<3702>: Error: Mailbox INBOX: mmap(size=352609044) failed with file /var/spool/mail/root/Maildir/dovecot.index.cache: Cannot allocate memory
  • Asterisk cannot find soundfile file.c:824 ast_openstream_full: File for-tech-support does not exist in any format
  • Apache Error solution - mktemp: failed to create directory via template '/var/lock/apache2.XXXXXXXXXX': No such file or directory
  • sysctl settings to reduce buffers and caches in Linux
  • Find /dev/sd block device of ata device - ata6: SATA link up 1.5 Gbps (SStatus 113 SControl 310) ata6.00: qc timeout (cmd 0xec) ata6.00: failed to IDENTIFY (I/O error, err_mask=0x4) ata6.00: revalidation failed (errno=-5)
  • Stuttering Audio on VOIP phones when first answering a call slow and fast audio
  • How to distribute the Microsoft VC Visual Studio Redistributable Files On Your Own
  • Nvidia video resolution and codec encode decode support matrix eg. h264 4k h265 HEVC VP9 Card List from GTX, RTX, Quadro
  • Japan and China ping time observations
  • ffmpeg convert to another format eg h265 to h264
  • Apache stop bots and hackers by using forensic logging.