[CentOS] mismatch_cnt after 5.3 -> 5.4 upgrade

Sun Oct 25 21:23:55 UTC 2009
S.Tindall <tindall.satwth at brandxmail.com>

On Sun, 2009-10-25 at 14:52 -0400, Ron Loftin wrote:
> On Sun, 2009-10-25 at 12:33 -0600, Devin Reade wrote:
> > Saturday I did an upgrade from 5.3 (original install) to 5.4.  Saturday
> > night, /etc/cron.weekly reported the following:
> > 
> >        /etc/cron.weekly/99-raid-check:
> > 
> >        WARNING: mismatch_cnt is not 0 on /dev/md0
> > 
> I had this happen on a box that I upgraded Friday.  I went ahead and
> tested each partition in the affected mirror with badblocks ( found no
> errors ) and after multiple resyncs, there was no change.  After similar
> experiences with Google, I did run across a note saying that this went
> away after a reboot.  I broke down and applied the Micro$lop solution
> ( reboot ) and the error has gone away.
> 
> Like you, I'm interested in a better understanding of this issue, so if
> anyone else has more info, I'm all ears. ;>
> 

mismatch_cnt (/sys/block/md*/md/mismatch_cnt) is the number of
unsynchronized blocks in the raid.

The repair is to rebuild the raid:

# echo repair >/sys/block/md<#>/md/sync_action

...which does not reset the count, but if you force a check after the
rebuild is complete:

# echo check >/sys/block/md<#>/md/sync_action

...then the count should return to zero.

Or at least that worked for me on three systems today.

Steve