Recommended best practices for protecting your data with ZFS include using ECC memory, configuring pool redundancy and hot spares, and always having current backups of critical data. Because storage devices can fail over time, pool scrubs are also recommended to identify and resolve data inconsistencies caused by failing devices or other issues. Additionally:
The Oracle Solaris 11.4 release includes a new pool property for scheduling a pool scrub and also introduces a read-only property for monitoring when the last pool scrub occurred.
On-going pool scrubs are recommended for routine pool maintenance. The general best practice is to either scrub once per month or per quarter for data center quality drives. This new feature enables you to more easily schedule routine pool scrubs.
If you install a new Solaris 11.4 system or upgrade your existing Solaris 11 system to Solaris 11.4, a new scrubinterval pool property is set to 30 days (1 month) by default. For example:
% zpool get scrubinterval export NAME PROPERTY VALUE SOURCE export scrubinterval 1m default
If you have multiple pools on your system, the default scheduled scrub is staggered so not all scrubs begin at the same time.
You can specify your own scrubinterval in days, weeks, or months. If scrubinterval is set to manual, this feature is disabled.
The read-only lastscrub property identifies the start time of the last scrub as follows:
% zpool get lastscrub export NAME PROPERTY VALUE SOURCE export lastscrub Apr_03 local
A pool scrub runs in the background and at a low priority. When a scrub is scheduled using this feature, a best effort is made not to impact an existing scrub or resilver operation and might be cancelled if these operations are already running.
Any running scrub (scheduled or manually started) can be cancelled by using the following command:
# zpool scrub -s tank # zpool status tank pool: tank state: ONLINE scan: scrub canceled on Mon Apr 16 13:23:00 2018 config: NAME STATE READ WRITE CKSUM tank ONLINE 0 0 0 mirror-0 ONLINE 0 0 0 c3t2d0 ONLINE 0 0 0 c4t2d0 ONLINE 0 0 0 errors: No known data errors
In summary, pool scrubs are an important part of routine pool maintenance to identify and repair any data inconsistencies. ZFS scheduled scrubs provide a way to automate pool scrubs in your environment.