Data integrity check ("scrub") for T10-PI or dm-integrity

Hypothetically, suppose I were to use T10-PI or dm-integrity as a means of detecting bit rot on a normal single-disk filesystem (ext4 or xfs for example). Specifically, without using any form of RAID. Let’s also say I have regular backups, and I just want a way to scan through the drive and detect bitrot, so I know what files I need to restore from backup. How would I go about doing this?

If the filesystem were on md raid, I would do a raid scrub, but if it’s just a single disk, what would I do? Cat the block device to dev null (or do the same with dd)? Reading the whole drive would certainly trigger a read error from dm-integrity or T10-PI if any bit rot happened, but it wouldn’t be clear which file the problem was in.

I’m also interested in alternative solutions to the same problem, as long as they aren’t “use zfs/btrfs”. I’m not opposed to those, I’m just interested specifically in alternatives.

Mounting the device and reading every file is not an option in your scenario?

1 Like

I guess it is! some variant of find /| xargs cat would technically do it. Not sure why I didn’t think of it earlier. Still interested in hearing any related experiences or ideas that anyone else has, though (single disk, normal filesystem, bit rot management)