Over time, files can become corrupted due to bit rot.
sudo snapraid scrub
NOTE: This command verifies the data in your array comparing it with the hash computed in the “sync” command.
The -p, –plan option can be used to specify a different amount, and the -o, –older-than option to specify a different age in days.
For example, to check 5% of the array older than 20 days use:
sudo snapraid scrub -p 10
NOTE: Scrubbing should be run periodically to catch issues before they become serious.
If during the scrub process, silent or input/output errors are found, the corresponding blocks are marked as bad in the “content” file, and listed in the “status” command.
snapraid status
To fix them, you can use the “fix” command filtering for bad blocks with the -e, –filter-error options:
snapraid -e fix
NOTE: At the next “scrub” the errors will disappear from the “status” report if really fixed.
snapraid -p bad scrub
WARNING: Take care that running “scrub” on a not synced array may result in errors caused by removed or modified files.