snapraid-btrfs-runner icon indicating copy to clipboard operation
snapraid-btrfs-runner copied to clipboard

btrfs scrub pre snapraid sync

Open o010b opened this issue 3 years ago • 2 comments

I would like to suggest checking data volumes for bit rot or otherwise corruption using btrfs scrub before updating the snapraid parity. Cheers.

o010b avatar Feb 19 '22 13:02 o010b

Since btrfs automatically verifies checksums on read, running a full scrub should not be necessary (not to mention it would take an incredibly long time to scrub all volumes if you have large drives). If the checksum of the file fails to verify, it should result in a read error of the file, which presumably snapraid would detect as it would any other read error like a bad sector.

Check out this SO answer for some more detailed info and an example script to confirm it works this way: https://superuser.com/a/1285549/66111

einsteinx2 avatar May 05 '22 15:05 einsteinx2

Hi, I'm coming back to this to understand, btrfs already checks the files in reading but only if they are read, so if the file is not used for 2 years, an error can be created? I use NixOS I have a service that launches a scrub of the mount points every month do you think that's enough?

Nosirus avatar Aug 11 '24 11:08 Nosirus