All of lore.kernel.org
 help / color / mirror / Atom feed
* Repairing a RAID1 with non-zero mismatch_cnt
@ 2020-01-20 10:02 Andrey ``Bass'' Shcheglov
  2020-01-20 10:56 ` Wols Lists
  0 siblings, 1 reply; 7+ messages in thread
From: Andrey ``Bass'' Shcheglov @ 2020-01-20 10:02 UTC (permalink / raw)
  To: linux-raid

Greetings,

I have a question on how to repair a RAID1 array (consisting of 2
physical hard drives, metadata version 1.2) which went split-brain.

One of my md-devices repeatedly shows a non-zero mismatch_cnt:

# cat /sys/block/md4/md/mismatch_cnt
1024

Zeroing out free space (with `zerofree`, as recommended here:
<http://decafbad.net/2017/01/03/mismatch_cnt,-raid1,-and-a-clever-fix/>)
and disabling the swap both retain the mismatch count at the very same
level.
Also, none of the drives is failing (18x and 19x SMART attributes are ok).
Checking file systems (ext4) doesn't show any problem, either, so the
file system metadata is most probably correct, too.

The usual suspects ruled out, I'm starting to think it my data got
corrupted, and at least one out of two replicas is affected.
Of course I can

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

but I have a 50% chance of losing information stored on the "right" replica.


So, assuming my /dev/md0 is now assembled from /dev/sda1 and /dev/sdb1,
I feel like assemble and run two separate degraded mirrors from
/dev/sda1 and /dev/sdb1, respectively (`mdadm -A`),
mount the corresponding file systems R/O,
create two backups (one backup per replica)
and then compare them with each other (`diff -urN`).


The question is: is it possible to assemble an array in a read-only mode,
so that the underlying block device is never written to,
the metadata in the superblock remains intact and the event count is
not incremented?

My intention is to avoid the resync when my original /dev/md0 is
reassembled from /dev/sda1 and /dev/sdb1.


If you have any other recommendations on how to interactively repair
the array (I want to be able to peek at the data being synced),
I'd appreciate you sharing them.

Regards,
Andrey.

^ permalink raw reply	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2020-04-09 21:18 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2020-01-20 10:02 Repairing a RAID1 with non-zero mismatch_cnt Andrey ``Bass'' Shcheglov
2020-01-20 10:56 ` Wols Lists
2020-01-20 22:30   ` Andrey ``Bass'' Shcheglov
2020-04-08 22:13     ` Repairing a RAID1 with non-zero mismatch_cnt, vol. 2 Andrey ``Bass'' Shcheglov
2020-04-09  1:06       ` Phil Turmel
2020-04-09  7:19       ` Robin Hill
2020-04-09 21:18         ` Andrey ``Bass'' Shcheglov

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.