0

I'm new to this particular area of the Stack Exchange network so please be kind. We are experiencing issues with auto-assembling a RAID1 Array created with mdadm on CentOS 7.6, and no matter what we try, the array is either non-existent after reboot or the system has to be put into recovery mode to undo the changes. Prior to the first reboot though, the array worked beasutifully and we were able to create a physical volume on it with pvcreate, along with a volume group for SolusVM use. All the articles I'm finding myself on Google that pertain to this scenario seem to deal with Ubuntu or other Debian-type distros which is really frustrating also.

So what have we tried so far? We've tried adding rd.md.uuid= (with the UUID of the RAID array gathered from /etc/mdadm.conf) to GRUB_CMDLINE_LINUX of /etc/default/grub and then running the following commands:

  • dracut -a mdraid -f
  • grub2-mkconfig -o "$(readlink -e /etc/grub2.cfg)"

That resulted in the system not booting up and we had to go into recovery mode temporarily afterwards. We then tried variations of those commands with no luck, with the system booting up successfully some of the time but with no luck on mdadm auto-assembling the array at any point. We tried just running the following commands, separately, on their own without any luck:

  • dracut -a mdraid -f
  • dracut -f

We'd sincerely appreciate any help on this issue as the help we are finding via Google is not assisting in any manner, we are essentially going into this blind. Thank you and we look forward to your replies.

EDIT: I was told to give the output of mdadm --examine and cat /proc/mdstat so I went to assemble the array manually and the following output was given:

[root@omega phobosdthorga]# mdadm --assemble /dev/md0 /dev/nvme0n1 /dev/nvme1n1
\mdadm: Cannot assemble mbr metadata on /dev/nvme0n1
mdadm: /dev/nvme0n1 has no superblock - assembly aborted
[root@omega phobosdthorga]#

I followed the following guide for creating the array: https://www.tecmint.com/create-raid1-in-linux/

I suppose I have to find where I went wrong originally and try to fix that also, but I'd still like some advice on how I can auto-assemble the array afterwards, please.

  • The first thing you need to do is to investigate why the RAID array does not assemble. You did not post anything about this, but it is the most important thing you should have done. Please edit your question to show the status of your RAID arrays, e.g. the outputs of `mdadm --examine` or `cat /proc/mdstat` and any additional information you developed. – Michael Hampton Feb 20 '19 at 16:17
  • Thanks, Michael, I made some edits and hopefully they shed further light on where I'm stuck with this. Much appreciated. – Phobos D'thorga Feb 20 '19 at 16:40
  • What about `cat /proc/mdstat`? – Michael Hampton Feb 20 '19 at 17:01
  • One obvious, but kind of facepalm situation, is if you did something that blew away the array metadata. Like, did you do pvcreate on /dev/nvme0n1 instead of /dev/md0? Another less common situation is if you created the array using external metadata such as IMSM or DDF - sometimes these are written to the end of the device, rather than the beginning, and can inadvertently be destroyed. – Mike Andrews Feb 20 '19 at 20:42

1 Answers1

0

Okay! I fixed the issue thanks to the suggestion of an article in the right sidebar :) What changed is that I created the RAID1 array using mdadm as normal but instead did the following:

  • Firstly run mdadm --stop /dev/md0 after the array had finished building.
  • Then perform mdadm --assemble /dev/md0 --update=homehost.

I then next followed what I did as per in my original question which was to:

  • Do all that was needed regarding rd.md.uuid with grub2.
  • Execute dracut -a mdraid -f afterwards.
  • Then lastly perform the grub2-mkconfig -o "$(readlink -e /etc/grub2.cfg)" command.

So yeah, the array auto-assembles on boot now! Thank you for your time and assistance, Michael and Mike.