Back to Help and Info

ZFS Management Commands

This section provides commands for managing ZFS file systems in Proxmox VE. Learn how to create and manage pools, datasets, snapshots, and perform maintenance operations on your ZFS storage.

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

ZFS Best Practices

  • Replace <pool> with your ZFS pool name
  • Replace <dataset> with your dataset name
  • Replace <snapshot-name> with a descriptive name, often including a timestamp (e.g., daily-2023-05-01)
  • Run regular scrubs to maintain data integrity (weekly or monthly)
  • Keep at least 10-15% of pool space free for optimal performance (ZFS performance degrades significantly when pools are over 80% full)
  • Use meaningful snapshot names and consider implementing an automated snapshot rotation policy for important datasets
  • When replacing devices, always use zpool replace rather than removing and adding to preserve data redundancy