Is there a change in how automatic scrubbing is setup?
Thank you.
Thank you.
daily_scrub_zfs_enable="YES" to /etc/periodic.conf. The default period is 35 days. If you want to override it, add daily_scrub_zfs_default_threshold=value to the periodic.conf file. You can also choose different defaults for different pools. All this doesn't seem to be documented in any man-page -- zfs-scrub(8) still talks about systemd!I had no idea about that. I had been using cron to do it every month.I had to adddaily_scrub_zfs_enable="YES"to /etc/periodic.conf. The default period is 35 days. If you want to override it, adddaily_scrub_zfs_default_threshold=value to the periodic.conf file. You can also choose different defaults for different pools. All this doesn't seem to be documented in any man-page -- zfs-scrub(8) still talks about systemd!
daily_trim_zfs_{enable,pools,flags} if you are so inclined (for SSDs, NVME and thinly provisioned virtual disks).Note that it is *checked* daily for scrubbing but actual scrubbing happens once everya daily scrub can be too much.
daily_scrub_zfs_default_threshold days. For HDDS that have lots of files, it can take hours so you certainly don't want to scrub too often!I don't understand what you are asking for, at least the "more flexible time spec" part. mro has a reasonable way to specify "the second saturday" which I don't think is natively supported in crontab format. I'm just trying to understand what you meanI want a crontab with a more flexible time spec -- basically a crontab is a repeating Tasks to do list and cron is a task scheduler!
That is essentially how /etc/periodic/daily/800.scrub-zfs works. The idea is to factor out all "time to do something* specification in one place.You let cron execute the script every saturday, and the script tests if it's the second saturday of a month, and only then executes the command, else just exits.
It is rather unfortunate that there is no specific FreeBSD information mentioned or referenced inI had to adddaily_scrub_zfs_enable="YES"to /etc/periodic.conf. The default period is 35 days. If you want to override it, adddaily_scrub_zfs_default_threshold=value to the periodic.conf file. You can also choose different defaults for different pools. All this doesn't seem to be documented in any man-page -- zfs-scrub(8) still talks about systemd!
PERIODIC SCRUB of zpool-scrub(8) (while the systemd example is obviously not relevant).DESCRIPTION
[...]
daily_scrub_zfs_enable
(bool) Set to "YES" if you want to run a zfs scrub periodically.
daily_scrub_zfs_pools
(str) A space separated list of names of zfs pools to scrub. If
the list is empty or not set, all zfs pools are scrubbed.
daily_scrub_zfs_default_threshold
(int) Number of days between a scrub if no pool-specific threshold
is set. If not set, the default value is 35, corresponding to 5
weeks.
daily_scrub_zfs_<poolname>_threshold
(int) The same as daily_scrub_zfs_default_threshold but specific to
the pool <poolname>.
daily_trim_zfs_enable
(bool) Set to "YES" if you want to run a zfs trim daily.
daily_trim_zfs_pools
(str) A space separated list of names of zfs pools to trim. If the
list is empty or not set, all zfs pools are trimmed.
daily_trim_zfs_flags. It seems that PR 292074 did not trigger an update/inclusion for this in periodic.conf(5) for periodic/801.trim-zfs: Fix daily-trim-zfs-flags.SEE ALSO section of zpool-scrub(8).That is a very interesting question. Meaning it's insanely complicated, and nobody knows the answer. Why? Because it's a tradeoff. Pro: Scrub finds silent data corruption (disk contains wrong content, but drive did not have a read error), and it makes sure all sectors remain readable, or at least latent read errors in hardware are found earlier, and redundancy can be restored. Con: Scrub costs lots of system resources, and if implemented badly (ZFS is OK but not great in that) can impact performance of foreground workload. Really big con: The mere act of reading data wears out a disk drive, and increases the number of read errors. The fact that scrub both "cures" read errors (by creating extra redundant copies if needed) and causes them means that the balance is subtle.This may start another discussion how often a scrub makes sense
That is definitely wrong. Scrub really helps. Whether ZFS scrub is perfect, whether it could be improved, and what the scrub frequency should be: those are good questions. But "never" is wrong.(some may even say 'never')
If you are paranoid about your data, you should also invest in ECC RAM. But that argument can't be turned around: If you can't use ECC RAM for some reason, that doesn't immediately mean that you should give up on RAID and scrub.If you are paranoid about your stored data resp. it's of extreme value and importance, or you just can afford it, you may consider using error correcting RAM.