Startled by “component device mismatches” on RAID1 volumes
I was startled today by a message in syslog that seems to point to a problem with my RAID1 volumes:
MarĀ 1 01:13:54 server mdadm[961]: RebuildFinished event detected on md device /dev/md3, component deviceĀ mismatches found: 512
This value is reflected in the following counter:
root:/etc/mdadm# cat /sys/block/md3/md/mismatch_cnt 512
I tried to clarify this by googling around, but I found no definitive answer whether this is an actual problem or not. However, I found a way to resync the MD components so that no mismatches remain:
root:/etc/mdadm# echo repair >> /sys/block/md3/md/sync_action
After you execute the repair you will notice that the counter shows the same number of mismatches again:
root:/etc/mdadm# cat /sys/block/md3/md/mismatch_cnt 512
This was to be expected — because the repair corrected (and thus encountered) this number of mismatches. So, if you force a check again, the counter should be down to 0:
root:/etc/mdadm# echo check >> /sys/block/md3/md/sync_action
root:/etc/mdadm# watch cat /proc/mdstat
[wait until check is finished]
root:/etc/mdadm# cat /sys/block/md3/md/mismatch_cnt
0
Tags: raid
March 1st, 2009 at 11:04
Update: I found the following statement from Neil Brown which seems to be a good explanation why these differences may happen:
October 10th, 2009 at 11:42
Neil Brown also says, that it is a problem mostly found with Swap on Raid1. Link to the whole discussion is: http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=518834