Use this when automating ZFS pools, datasets, properties, snapshots and replication.
ZFS Automation
ZFS automation creates pools and datasets with zpool and zfs, sets properties like compression and quotas, schedules snapshots and scrubs and replicates with zfs send/receive or syncoid.
1. ZFS automation: datasets, properties, snapshots, replication (sanoid/syncoid).
2. Check pool capacity.
3. Set properties consistently.
4. Verify.
5. Avoid destructive operations without confirmation.
desired dataset → zfs module → properties
Context & applicabilityCommon mistakes · platform/version boundaries
Operational reference
Fast context before you go deeper.
Verification & Troubleshooting
Start with the observed symptom, prove the nearest boundary, and move outward only when the current state is understood.
Use the operational verification above to establish the expected state.
Capture the concrete output, symptom, packet, log or counter before changing anything.
Step 1 Common mistakes Narrow the fault
- Setting
dedup=onwithout RAM sizing. - Properties that differ between primary and replica.
Evidence · 1 on this Topic
Expected observations and documentation recipes are reference material. Record actual output, device identity, scope and time before claiming a verified result.
- zpool and zfs commands manage pools and datasets.
- Set properties like compression and quotas.
- Schedule snapshots and replication.
ansible <h> -m community.general.zfs -a 'name=<pool>/<ds> state=present extra_zfs_properties={compression: lz4}' --check— datasetzfs list -o name,used,avail,compression— verify- Pool capacity check (<80 %) — safety
ReferenceWhy it matters1 section · depth on demand
What it is
ZFS automation creates datasets with properties and schedules snapshots and replication.
ReferenceHow it works1 section · depth on demand
In depth
ZFS automation manages pools, datasets, snapshots and replication with scripts or configuration management. ZFS commands are scriptable and largely idempotent-friendly, which makes them well suited to automation.
zfs create -o compression=lz4 -o quota=500G tank/backups/netconfig
zfs snapshot tank/backups/netconfig@$(date +%Y%m%d-%H%M)
zfs list -t snapshot -o name,used -s creation tank/backups/netconfig | tail -5
zfs send -i @prev tank/data@now | ssh backup01 zfs receive -F pool/data
zpool status -x # "all pools are healthy" or details
Tools such as sanoid/syncoid automate snapshot schedules and retention plus replication. Monitor zpool status, scrub results and capacity — performance drops sharply above roughly 80% pool usage.
ReferenceImportant terms & boundaries2 sections · depth on demand
Example
zfs create -o compression=lz4 -o recordsize=128K tank/app
zfs list -o name,used,avail,compressratio
Mechanics
The linked authority for bounded mechanics is OpenZFS Documentation; documentation support is separate from observed lab/production Evidence.
Additional reference context Scope · expected state · examples · history · terminology Open only when you need the supporting context
Verification history & basis
When and against what this Topic was checked. Later text edits do not count as a new check.
Authoritative/upstream documentation reviewed for bounded claims in Storage Automation > ZFS Automation. Documentation verification only; this is not observed lab or production Evidence.
Basis: https://openzfs.github.io/openzfs-docs/ · confidence 94%