Skip to content

ZFS Administration Cheat Sheet

A technical reference detailing essential commands for managing ZFS physical storage pools and logical datasets, including pool creation, dataset properties, snapshot replication, and disk replacement workflows.

1. Zpool Management (Physical Disks)

Check Pool Status and Health:

zpool status -v
zpool iostat -v 2

Create a New Pool:

zpool create mypool mirror /dev/sda /dev/sdb
zpool create mypool raidz1 /dev/sda /dev/sdb /dev/sdc

Import and Export Pools:

zpool export mypool
zpool import
zpool import mypool

2. Dataset Management (Logical Storage)

Create and Destroy Datasets:

zfs create mypool/data
zfs destroy mypool/data

Manage Properties:

zfs set compression=lz4 mypool/data
zfs set quota=500G mypool/data
zfs get all mypool/data

3. Snapshots and Replication

Take and View Snapshots:

zfs snapshot mypool/data@backup1
zfs list -t snapshot

Rollback and Clone:

zfs rollback mypool/data@backup1
zfs clone mypool/data@backup1 mypool/data-clone

Send and Receive (Replication):

zfs send mypool/data@backup1 | zfs receive backuppool/data-backup

4. Maintenance and Disk Replacement

Scrubbing (Data Integrity Check):

zpool scrub mypool
zpool status mypool

Replacing a Failed Disk:

zpool offline mypool /dev/sda
zpool replace mypool /dev/sda /dev/sde
zpool online mypool /dev/sde

Sources & Verification

  • ZFS Commands: Verified against the official OpenZFS Documentation (https://openzfs.github.io/openzfs-docs/). Syntax, dataset properties, and pool management parameters have been validated for correct structure and safe execution.