On Linux, I use RAID mirror (mdadm - software reaid). How to configure it so that data is read from both underlying devices and compared, to detect data bitrot and fail in such case?
Is that at all supported?
Would be good option to have.
(Of course as one of layers of protection, for important data)
I believe you can get this if you setup the underlying disks with dm-integrity, though I’m not sure it’s really worth it since it’s a very manual setup and has lots of potential edge cases and performance issues. Basically when the underlying disks are setup with dm-integrity, each read is verified with a checksum, if the checksum doesn’t match, the dm-integrity layer will return a read error and mdadm will log an error and automatically fallback to the secondary mirror. A “scrub” in this case would simply be reading the disk to /dev/null with dd, then checking the mdadm logs for any errors.
Note that it’s been a long time since I’ve messed with this, so it’s possible I got the exact details of the setup wrong.
Red Hat made Stratis to layer all this stuff together but I’ve never tried it.
https://en.wikipedia.org/wiki/Stratis_(configuration_daemon)
https://access.redhat.com/documentation/en-us/red_hat_enterprise_linux/8/html/managing_file_systems/setting-up-stratis-file-systems_managing-file-systems
https://stratis-storage.github.io/