ZFS Management
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
| Command | Description | Action |
|---|---|---|
| zpool list | List all ZFS pools | |
| zpool status | Show detailed pool status and health | |
| zpool status -v | Show verbose pool status with errors | |
| zpool history | Show 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
| Command | Description | Action |
|---|---|---|
| zfs list | List 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
| Command | Description | Action |
|---|---|---|
| zfs list -t snapshot | List 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
| Command | Description | Action |
|---|---|---|
| zfs clone <pool>/<dataset>@<snapshot> <pool>/<clone-name> | Create a clone from a snapshot | |
| zfs send <pool>/<dataset>@<snapshot> > backup.zfs | Send a snapshot to a file | |
| zfs receive <pool>/<dataset> < backup.zfs | Receive a snapshot from a file | |
| zfs send -i <pool>/<dataset>@<snap1> <pool>/<dataset>@<snap2> > incr.zfs | Send incremental snapshot | |
| zfs send -R <pool>/<dataset>@<snapshot> > full-recursive.zfs | Send recursive snapshot |
Maintenance and Repair
| Command | Description | Action |
|---|---|---|
| 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
| Command | Description | Action |
|---|---|---|
| zpool iostat | Show I/O statistics for pools | |
| zpool iostat -v | Show detailed I/O statistics | |
| zpool iostat 5 | Show I/O statistics every 5 seconds | |
| arc_summary | Show 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
- Storage and Disks — generic block-device and LVM commands.
- Backup and Restore — vzdump, qmrestore.
- Help and Info overview.