ZFS Scrub task best practice

On a mostly idle pool, time to scrub is greatly dependent on amount of data to be scrubbed (5TB takes longer than 5GB) and the speed of the data interface (NVME is faster than SATA6 which is faster than SATA3) USB3 is faster than USB2, so I'd guess an external drive, connected via USB is going to take a while if there is a lot of data on it. Speed of the device beyond the USB also affects scrub (SSD faster than spinning platters).
 
I do SSDs and NVMes data media scrub once a day, nightly.
 
Scrub of my SSD freebsd pool took 3-minutes. Scrub of a smaller void-linux-on-zfs pool 30 seconds. A large difference with an external USB.
 
I only use USB devices as backups, so I do not see why scrubbing them.
 
Well I was doubting if it only checked the "meanwhile changed datablocks".
No, the purpose of scrub is explicitly to look at problems with the disk that happen "spontaneously". Two examples of such problems are mechanical damage to the platter and head (scratches, foreign objects, moguls in the lubricant), and off-track writes (where data should have been to one location, and ends up in a different location). These problems don't just happen to the data that is being written.

Scrub and SMART can work well together, because scrub makes sure most areas of the disk get exercised regularly, which makes the SMART statistics more meaningful. This is ideal in a system where the file system (and its scrubbing algorithm) and the analysis of SMART data are designed and tuned together.
 
I've no idea what "best practices" for zfs scrub are, but I'll note that the default of every 35 days has served me well for many years now. FreeBSD handles this via the periodic script /etc/periodic/daily/800.scrub-zfs which gets its default values from /etc/defaults/periodic.conf:
Code:
root@kg-core2# grep scrub_zfs /etc/defaults/periodic.conf
daily_scrub_zfs_enable="NO"
daily_scrub_zfs_pools=""            # empty string selects all pools
daily_scrub_zfs_default_threshold="35"        # days between scrubs
#daily_scrub_zfs_${poolname}_threshold="35"    # pool specific threshold
If you want to change some of them, you should pout them in the /etc/rc.conf file.
Don't you mean /etc/periodic.conf
 
Don't you mean /etc/periodic.conf
/etc/defaults/periodic.conf contains the defaults, just as /etc/defaults/rc.conf contains a bunch of defaults too. Those settings can be overruled by setting them in /etc/periodic.conf and /etc/rc.conf respectively.
 
Back
Top