In Linux, if I have a software RAID1 mirror /dev/md1
with N ≥ 1 active devices, what are the semantics of the repair
command?
echo "repair" >/sys/block/md1/md/sync_action
Am I correct to assume that
- in case of 1 active device, the
repair
command does nothing, - in case of 2 active devices, the
repair
command searches for data discrepancies and overwrites mismatched data of one of the devices with the mismatched data from the second device, and - in case of 3 (or more) active devices, the
repair
command searches for data discrepancies, figures out (if possible) or decides which data contents are most prevalent and with this data overwrites the mismatched data on other devices?
I've read Documentation/admin-guide/md.rst and even Documentation/device-mapper/dm-raid.txt from the Linux kernel documentation, but these are currently not very informative. I've also tried to understand drivers/md/raid1.c but its not very well commented and I lack knowledge of Linux kernel internals to understand it.