[CentOS] mdX and mismatch_cnt when building an array

Tue Nov 13 22:07:37 UTC 2012
Steve Thompson <smt at vgersoft.com>

CentOS 6.3, x86_64.

I have noticed when building a new software RAID-6 array on CentOS 6.3 
that the mismatch_cnt grows monotonically while the array is building:

# cat /proc/mdstat
Personalities : [raid6] [raid5] [raid4]
md11 : active raid6 sdg[5] sdf[4] sde[3] sdd[2] sdc[1] sdb[0]
       3904890880 blocks super 1.2 level 6, 512k chunk, algorithm 2 [6/6] [UUUUUU]
       [==================>..]  resync = 90.2% (880765600/976222720) finish=44.6min speed=35653K/sec

# cat /sys/block/md11/md/mismatch_cnt
1439285488

The mismatch count grows until the assembly is complete, and then remains 
at its highest value. A subsequent check resets it to zero (immediately) 
and everything is fine thereafter. The device is not in use by any other 
system component. I have reproduced this on several different systems; it 
always happens with CentOS 6.3 and never with CentOS 5.x and earlier (in 
5.x, mismatch_cnt always stays at zero while assembling). I am using whole 
drives in this example, but it's the same if I use partitions instead. The 
count, size and type of drives appears to have no bearing.

Perhaps just a curiosity, but I'm curious as to why it does this.

Steve