I'm running Snapraid on my hard drives. However, I want to test it's data integrity features, to see how/if they actually work.
But I don't really understand how to 'corrupt' my data. I can just manually change the contents of my files. However, Snapraid will just sync this change normally. And Snapraid fix will automatically revert the files to before the change.
But how do I test an actual data corruption, and how do I know if Snapraid has actually fixed it?
Maybe this works. At first sync your data:
Now check the size and timestamps of your file
Now create a backup of the timestamps:
Next step is to change
foo.txt
through an file editor likevi
/nano
without changing the filesize (replace one character).After that restore the timestamps:
Delete the timestamp backup file:
Check and compare the results
Check for new files
It shouldn't return anything as we did not change the filesize and timestamp of foo.txt.
Finally start a full scrub:
Now snapraid creates checksums of all files and compares them with the metadata and foo.txt should be listed as fixable file.
Looks like snapraid backups the parity info of your raid array. If you using a hardware raid controller that supports hot plug and you using anything but a raid 0, unplug a drive then plug it back in. A rebuild will start on the virtual disk. Once the rebuild starts run a chkdsk or fsck on the virtual disk. That will cause the parity bits and file system to become out of order this corrupting your array. Snap drive documentation says it cannot handle large parity corruption so, might not be the best way.