How to idle MDADM during boot??

Issues related to applications and software problems and general support
Post Reply
schatzman
Posts: 3
Joined: 2022/01/08 16:59:56

How to idle MDADM during boot??

Post by schatzman » 2022/01/16 23:10:48

I guess that the Linux gurus assume that people want their RAIDs assembled during boot. I don't.

I am able to obtain the following behaviors of MDADM:

a) MDADM auto-assembles during boot. If it can't find a needed physical volume then it marks it as bad/missing and otherwise does things I don't want. I can recover from this condition but it takes some effort. This is the behavior I get if I put the usual ARRAY data in /etc/mdadm.conf.

b) MDADM does not assemble anything during boot, but it also will not let me assemble any raids after boot. This is what happens if I put the following in etc/mdadm.conf:

ARRAY <ignore> UUID=00000000:00000000:00000000:00000000
AUTO -all

I really do not want the behavior of MDADM when it can't find a physical volume. I suppose it is trying to take "reasonable" corrective action - but that is not what I want. If MDADM must do something during boot then I want it to give up if there is any problem whatsoever.

After the systems is up, I use a script that does

madm -A --scan --no-degraded /dev/mdXX --uid YYYYYYYY:YYYYYYYY:YYYYYYYY:YYYYYYYY

for each of my raids. This fails in case (b) above - mdadm complains that the raid device is not in the config file.

How??

User avatar
TrevorH
Site Admin
Posts: 33191
Joined: 2009/09/24 10:40:56
Location: Brighton, UK

Re: How to idle MDADM during boot??

Post by TrevorH » 2022/01/17 00:01:23

All you need is "AUTO -all". I suspect your other line that tells it to ignore it is naming the UUID of the array and then you're trying to run a command that wants to auto-assemble that same array and the ignore line tells it never to do so.

I use AUTO -all then have a systemd unit file that runs /usr/sbin/mdadm --assemble /dev/md0 /dev/sda1 /dev/sdb1 (alter to fit your requirements). I also have systemd activating the PV/VG on that md device, mounting the filesystem on /var/lib/mysql then starting mysqld.
The future appears to be RHEL or Debian. I think I'm going Debian.
Info for USB installs on http://wiki.centos.org/HowTos/InstallFromUSBkey
CentOS 5 and 6 are deadest, do not use them.
Use the FAQ Luke

schatzman
Posts: 3
Joined: 2022/01/08 16:59:56

Re: How to idle MDADM during boot??

Post by schatzman » 2022/01/17 01:23:56

That is exactly what I am trying to do, but it does not work. With just "AUTO -all" in etc/mdadm.conf, when I try to assemble the raids with commands like

mdadm -A --scan --no-degraded /dev/mdXX --uuid YYYYYYYY:YYYYYYYY:YYYYYYYY:YYYYYYYY

I get the error message

mdadm: /dev/mdXX not identified in config file

for each of the mdadm -A commands. The differences between my command and yours are

a) I add the "--no-degraded" command line option

b) I use "--scan" and "-uuid" instead of listing the devices. I don't see how that could work reliably, BTW, since Linux assigns device names more-or-less randomly.

When all else fails read the manual! Having just read the docs for mdadm, I see that "--scan" says "scan config file for missing information". I was thinking it would scan the physical devices. My bad.

However, when I put the ARRAY data for all the raids in /etc/mdadm.conf, then mdadm assembles the arrays during boot. I don't want that!

Post Reply