You are not logged in.
Pages: 1
Had a bad PCI sata card. Hooked up one drive from an mdadm raid6 to it. Removed the bad card and switched to better hardware a few days ago. As per the wiki I ran a scrubbing operation yesterday. Array now has mismatch_cnt > 0 (24). I cannot find any information on how to correct this minus running a repair operation, which may or may not make the problem worse. The wiki says:
If it (the scrub) finds good sectors that contain bad data (the data in a sector does not agree with what the data from another disk indicates that it should be, for example the parity block + the other data blocks would cause us to think that this data block is incorrect), then no action is taken, but the event is logged (see below). This "do nothing" allows admins to inspect the data in the sector and the data that would be produced by rebuilding the sectors from redundant information and pick the correct data to keep.
The wiki however does not say HOW to allow admins to inspect the data, only how to get the bad data count.
Does anyone know how to verify what drive the errors are on? Or figure out which files are corrupted?
current ideas: get my last backup drive (taken before installing crap card) and copy all the data from it back to the array and hope it overwrites the problem, run rsync with checksums as a dry run and see if any files have different hashes that shouldn't, if I can confirm that it is just the one drive that was in the card that is corrupted I can mark it as faulty, wipe it, and rejoin it to the array. Any thoughts on how to fix this mess?
What I've tried:
looking at individual drive stats by running cat /sys/block/md1/md/dev-sdx1/bad_blocks. Every device on the array returns an empty string.
Offline
If dmesg gave you sector numbers for mismatches you can try mapping those to files but in general it doesn't tell you directly. If you have a backup you could simply compare files.
It's also possible to (manually) do a read-only, overlay mount of array in degraded state with different drives missing and compare files that way. But other than the generic overlay advice in the raid kernel wiki, I have no specific guide for this.
I think there was an external utility at some point that could also check for raid parity mismatches (and give you sector offsets) before the kernel printed these out in dmesg (if it still does that).
To "fix" the mismatches themselves you can just run mdadm repair cycle but it will simply recalculate parity, regardless whether data or parity was correct. This is just to make sure that if another drives fails and you rebuild, the data won't change due to parity mismatches.
Re-writing files on an RAID 5/6 array does not necessarily fix parity mismatches. The RAID sometimes recalculates parity from parity (instead of calculating parity from data), it's an optimization that works under the assumption that the parity was correct in the first place. So once you have mismatches, even if you re-copy all files over, you might still have to run the repair in addition to that.
Offline
That makes sense. Ok, new game plan is to run repair, then copy backup back to the array just in case (or at least see what differs from the backup). Thanks for the advice @frostschutz. Got a freeze coming tonight (and thanks to Texas's crap power grid), will likely be without power for a few days. Since this operation could take a while I wont really be able to start until the weekend most likely. Will update here how it goes after the fact
Last edited by piratebill (2022-02-02 17:09:30)
Offline
Further reading I found references to raid6check that comes with mdadm (https://unix.stackexchange.com/question … tch-repair):
raid6check in the latest version can be set to automatically fix errors. It also reports where the errors are, and can be run to manually repair a specific stripe. And while it's not installed by default, it can be compiled and run separately from the rest of mdadm
Can't find it in any Arch repos. Also appears missing from debian. That has me wondering if there is a reason why the tool is missing? I would hate to break things further compiling it myself. I'd imagine its missing for a reason. Does anyone have any details on this?
Last edited by piratebill (2022-02-02 17:50:50)
Offline
Pages: 1