Skip to content

Role: zfs

ZFS pool tuning, health verification, and automated scrub scheduling.

Hosts: proxfold

Tasks

Task Tag
Deploy ZFS ARC config to /etc/modprobe.d/zfs.conf zfs, tuning
Trigger initramfs rebuild on config change zfs, tuning
Run zpool status <pool> health check zfs, health
Fail playbook if pool is DEGRADED or FAULTED zfs, health
Deploy systemd scrub timer zfs, scrub
Deploy systemd scrub service zfs, scrub
Enable and start scrub timer zfs, scrub
LXC fstrim cron (when lxc_fstrim_enabled) zfs, fstrim
Render ZED Discord webhook script (when zed_webhook_enabled) zfs, zed
Symlink ZED hooks to the webhook script zfs, zed

Key variables

Variable Source Value
zfs_pool group_vars stash
zfs_arc_max_bytes proxfold host_vars 15032385536 (14 GB)
zfs_scrub_schedule proxfold host_vars monthly
zed_webhook_enabled proxfold host_vars true (from Phase 5B) — opts the host into ZED Discord alerts
vault_discord_webhook_homelab_ops vault shared webhook (Phase 5B)

Templates

Template Deploys to
zfs-arc.conf.j2 /etc/modprobe.d/zfs.conf
zfs-scrub.timer.j2 /etc/systemd/system/zfs-scrub-stash.timer
zfs-scrub.service.j2 /etc/systemd/system/zfs-scrub-stash.service
zed-discord.sh.j2 /etc/zfs/zed.d/discord.sh (+ symlinks for statechange, scrub_finish, resilver_finish)

Handlers

  • Rebuilds initramfs (update-initramfs -u) when the ARC config changes — takes effect on next reboot
  • Reloads systemd when scrub unit files change
  • Restarts zfs-zed when the Discord webhook script or symlinks change

Note

The health check task will fail the playbook if the pool reports DEGRADED or FAULTED. This is intentional — don't run full plays against a degraded pool without addressing the fault first.

  • Storage — ZFS ARC cap
  • nvidia — Both rpool (boot) and stash (data) share the ARC, hence the cap
  • beszel — complementary stack; Beszel watches host metrics + SMART, ZED watches pool-level events