Mdadm keeps making the second disk of a mirror a "spare"

I have two disks in this array. I don’t think there is anything wrong with either of them. I noticed today that it is doing the U_ thing, and I have no idea how long that has been going on.

When I look at --detail it says one drive is a spare. When I stop and try to re-assemble with:

mdadm --assemble --verbose /dev/md125 /dev/sdl /dev/sda

I get:

mdadm: looking for devices for /dev/md125
mdadm: /dev/sdl is identified as a member of /dev/md125, slot 0.
mdadm: /dev/sda is identified as a member of /dev/md125, slot 1.
mdadm: added /dev/sda to /dev/md125 as 1 (possibly out of date)
mdadm: added /dev/sdl to /dev/md125 as 0
mdadm: /dev/md125 has been started with 1 drive (out of 2).

How do I get them to add as proper members and resync without loosing data? Assume the disks are physically fine.

Second question: How can I configure mdadm to simply stop and shutdown an array when it detects a problem instead of trying to be smart (which always makes a mess for me)?

ie:

NEVER fail a disk, NEVER run an array degraded, NEVER change any configuration. Just stop the whole array (or don’t start it on boot) and refuse to start it unless all the parts are working as configured? I’ve had nothing but problems with mdadm messing itself up for no reason on this server, and not just this mirror array, but the other arrays as well. I think there’s flaky cables or back-planes but I’ve cross swapped everything multiple times and nothing ever appears to be the problem. It’s never a drive failure, and it’s always transient.

Thanks,
Nick

The /dev/md125 tells me the array isn’t properly configured.

What kind of array is it? RAID1 is safe to disassemble as the drives are mirror images.

Install Webmin. It helps keeping syntax errors out of the config file :wink:

Create a new RAID and list it in your /etc/fstab, make sure the directory exists. If the array is the first/only one, use /dev/md0 in fstab.