On 19/05/2021 20:01, Leslie Rhorer wrote:
The ONLY time you can be reasonably confident that running --create WILL
recover a damaged array is if it is still in its original state - no
drives swapped, no admin changes to the array, AND you're using the same
version of mdadm.
That's a little bit of an overstatement, depending on what you mean
by "reasonably confident". Swapped drives should not ordinarily cause
an issue, especially with RAID 4 or 5. The parity is, after all,
numerically unique. Admin changes to the array should be similarly
fully established provided the rebuild completed properly. I don't
think the parity algorythms have changed over time in mdadm, either. Had
they done so, mdadm would not be able to assemble arrays from previous
versions regardless of whether the superblock was intact.
You said there's only three possible combinations of three drives. Every
change I've mentioned adds another variable - more options ...
The data offset is not fixed, for one. Swapping a drive could mean
drives have different offsets which means NO combination of drives, with
default options, will work. Rebuilding an array moves everything around.
Yes you can explicitly specify everything, and get mdadm to recover the
array if the superblocks have been lost, but it's nowhere as simple as
"there are only three possible combinations".
Cheers,
Wol