ZFS Management

Help and Info~5 minView script

Curated reference for zpool and zfs commands: pool inspection, dataset CRUD, snapshots, clone and send/receive (incremental and recursive), scrub / clear / replace for maintenance, plus I/O statistics and ARC summary.

Two command families

zpool * manages the storage pools (physical layer — disks, vdevs, redundancy). zfs * manages the datasets and snapshots that live inside those pools (logical layer — filesystems, volumes, snapshots, properties).

Pool Information

CommandDescriptionAction
zpool listList all ZFS pools
zpool statusShow detailed pool status and health
zpool status -vShow verbose pool status with errors
zpool historyShow command history for all pools
zpool history <pool>Show command history for specific pool
zpool get all <pool>Show all properties of a pool

Dataset Management

CommandDescriptionAction
zfs listList all ZFS datasets
zfs list -r <pool>List all datasets in a pool recursively
zfs create <pool>/<dataset>Create a new dataset
zfs destroy <pool>/<dataset>Destroy a dataset
zfs rename <pool>/<dataset> <pool>/<new-name>Rename a dataset
zfs get all <pool>/<dataset>Show all properties of a dataset
zfs set compression=on <pool>/<dataset>Enable compression on a dataset

Snapshot Management

CommandDescriptionAction
zfs list -t snapshotList all snapshots
zfs list -t snapshot -r <pool>List all snapshots in a pool
zfs snapshot <pool>/<dataset>@<snapshot-name>Create a snapshot
zfs destroy <pool>/<dataset>@<snapshot-name>Delete a snapshot
zfs rollback <pool>/<dataset>@<snapshot-name>Rollback to a snapshot
zfs hold <tag> <pool>/<dataset>@<snapshot-name>Place a hold on a snapshot
zfs release <tag> <pool>/<dataset>@<snapshot-name>Release a hold on a snapshot

Clone and Send/Receive

CommandDescriptionAction
zfs clone <pool>/<dataset>@<snapshot> <pool>/<clone-name>Create a clone from a snapshot
zfs send <pool>/<dataset>@<snapshot> > backup.zfsSend a snapshot to a file
zfs receive <pool>/<dataset> < backup.zfsReceive a snapshot from a file
zfs send -i <pool>/<dataset>@<snap1> <pool>/<dataset>@<snap2> > incr.zfsSend incremental snapshot
zfs send -R <pool>/<dataset>@<snapshot> > full-recursive.zfsSend recursive snapshot

Maintenance and Repair

CommandDescriptionAction
zpool scrub <pool>Start a scrub operation on a pool
zpool scrub -s <pool>Stop a running scrub
zpool clear <pool>Clear error counts in a pool
zpool clear <pool> <device>Clear errors on a specific device
zpool replace <pool> <old-device> <new-device>Replace a failed device
zpool offline <pool> <device>Take a device offline
zpool online <pool> <device>Bring a device online

Performance and Monitoring

CommandDescriptionAction
zpool iostatShow I/O statistics for pools
zpool iostat -vShow detailed I/O statistics
zpool iostat 5Show I/O statistics every 5 seconds
arc_summaryShow ARC statistics (if installed)
zfs get compressratio <pool>/<dataset>Show compression ratio
zfs get used,available,referenced <pool>/<dataset>Show space usage

Operational best practices

Run zpool scrub weekly or monthly to detect silent corruption. Keep at least 10-15% of pool space free — ZFS performance degrades sharply over 80% full. Always replace failed devices with zpool replace (in-place) rather than detach + add (which loses redundancy temporarily).

Related