I prefer mdadm RAID1 vs btrfs RAID1 because:

My question relates to bitrot which is undetected by hardware ECC.

If I get detect mismatching data (a non-0 mismatch_cnt) via:

echo check > /sys/block/md0/md/sync_action
  1. Given a non-0 mismatch_cnt, how do I determine:

    • The affected blocks
    • The affected files

I expect to need to read the files a few times (how to disable caching?) until I luck the good mirror's copy of the data. I'd measure this by the filesystem not throwing a CRC error, or the data passing its own internal checks (eg zip CRC).

  1. Can I then re-write the RAID1 blocks, while keeping the file metadata (eg file creation timestamp) intact?

[If I used something like rmlint's clone mode to try to repair the bad RAID blocks from the copied (CRC-good) data, a failure case in the clone process is when the correct RAID1 block is returned by mdadm, and the extents of the CRC-good copy are replaced by those of the original good RAID copy, leaving the bad RAID blocks unchanged.]

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.