How to synchronize Linux software RAID1

Aug 11, 2014 00:00 · 89 words · 1 minute read Linux

Sometimes we can see synchronization issue between disks in software RAID. We can verify the consistency of Linux software RAID-disks with reading operations via comparing the corresponding blocks of each disk in the array. If an error occurs, the counter is increased in the /sys/block/mdX/md/mismatch_cnt file.

To see count of mismatch between disks we can use mismatch_cnt:

cat /sys/block/mdX/md/mismatch_cnt

A manual check or repair can be triggered via sysfs:

echo check >/sys/block/mdX/md/sync_action

or

echo repair >/sys/block/mdX/md/sync_action

Also we can use watch utility to monitor the progress:

watch cat /proc/mdstat