geerlingguy/arm-nas

Work on enabling ZFS maintenance and quality-of-life improvements

Opened this issue · 5 comments

ZFS really needs a few things added to ensure the pools and data are operating at peak efficiency.

  • zpool scrub
  • zpool status
  • fmdump -eV

Anything else? And how should I notify on problems? smtp-notify? Some other service?

See: https://openzfs.github.io/openzfs-docs/man/master/8/zpool-scrub.8.html#PERIODIC_SCRUB

I know that TrueNAS and other storage software takes care of some of these things click-and-point, but I'm running on Arm64, plus it would be nice to have a super efficient setup that doesn't require the extra software running on top.

Basically, I know I need to set up:

  • Periodic scrubs
  • Periodic SMART checks
  • Periodic zfs snapshots (see #3).
  • Notification for scrub or SMART failures
  • Notification for pool reaching 70% capacity

Any other notifications or periodic maintenance?

I would check out zed for notifications. This is pretty much the go-to tool for monitoring and notifying about what's going on with zfs.

@onedr0p - Just be sure to not taunt the ZED.

I just noticed there's a cron job added inside /etc/cron.d/zfsutils-linux with the following configuration:

jgeerling@nas01:~$ cat /etc/cron.d/zfsutils-linux 
PATH=/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin

# Scrub the second Sunday of every month.
24 0 8-14 * * root if [ $(date +\%w) -eq 0 ] && [ -x /usr/lib/zfs-linux/scrub ]; then /usr/lib/zfs-linux/scrub; fi

So I'd assume that will run every Second Sunday...

Checking with zpool status, it looks like the last scrub was run on Sunday April 14:

jgeerling@nas01:/etc/samba$ zpool status
  pool: hddpool
 state: ONLINE
  scan: scrub repaired 0B in 0 days 04:32:46 with 0 errors on Sun Apr 14 04:56:48 2024

If my theory above is correct, the next scrub should've happened yesterday... Hmm...

Ah... my estimate above was off—the schedule runs At 00:24 on every day-of-month from 8 through 14., meaning on one of those days, the if statement will trigger ($(date +\%w) -eq 0 — Sunday is 0), so this is currently set for a monthly scrubbing, on whatever Sunday falls between the 8th - 14th of the month.

That means next scrub should be May 12, mother's day!