Complete ZFS commands reference — 93 commands across 24 categories. Quick reference cheat sheet for Linux, FreeBSD & illumos.
OpenZFS is administered through two commands: zpool for the storage pool and its disks, and zfs for the datasets, snapshots and properties inside it. The table lists every subcommand from the manual pages; the notes below follow the order in which an administrator actually meets them.
| Shortcut | Action |
|---|---|
| zfs -? | Displays a help message |
| zfs -V, --version | Displays the software version of the zfs userland utility |
| zfs version [-j] | Displays the software version of the zfs userland utility |
| zpool -? | Displays a help message |
| zpool -V, --version | Displays the software version of the zpool userland |
| zpool version [-j] | Displays the software version of the zpool userland |
| Shortcut | Action |
|---|---|
| zfs list | Lists the property information for the given datasets |
| zfs create | Creates a new ZFS file system or volume |
| zfs destroy | Destroys the given dataset(s), snapshot(s), or bookmark |
| zfs rename | Renames the given dataset (filesystem or snapshot) |
| zfs upgrade | Manage upgrading the on-disk version of filesystems |
| Shortcut | Action |
|---|---|
| zfs snapshot | Creates snapshots with the given names |
| zfs rollback | Roll back the given dataset to a previous snapshot |
| zfs hold | Add or remove a hold reference to the specified snapshot |
| zfs release | Add or remove a hold reference to the specified snapshot |
| zfs diff | Display the difference between a snapshot of a given |
| Shortcut | Action |
|---|---|
| zfs clone | Creates a clone of the given snapshot |
| zfs promote | Promotes a clone file system to no longer be dependent |
| Shortcut | Action |
|---|---|
| zfs send | Generate a send stream, which may be of a filesystem |
| zfs receive | Creates a snapshot whose contents are as specified |
| zfs bookmark | Creates a new bookmark of the given snapshot or bookmark |
| zfs redact | Generate a new redaction bookmark |
| Shortcut | Action |
|---|---|
| zfs get | Displays properties for the given datasets |
| zfs set | Sets the property or list of properties to the given |
| zfs inherit | Clears the specified property |
| Shortcut | Action |
|---|---|
| zfs userspace | Displays space consumed by, and quotas on, each user |
| zfs groupspace | Displays space consumed by, and quotas on, each user |
| zfs projectspace | Displays space consumed by, and quotas on, each user |
| zfs project | List, set, or clear project ID and/or inherit flag |
| Shortcut | Action |
|---|---|
| zfs mount | Displays all ZFS file systems currently mounted |
| zfs unmount | Unmounts currently mounted ZFS file systems |
| Shortcut | Action |
|---|---|
| zfs share | Shares available ZFS file systems |
| zfs unshare | Unshares currently shared ZFS file systems |
| Shortcut | Action |
|---|---|
| zfs allow | Delegate permissions on the specified filesystem or volume |
| zfs unallow | Remove delegated permissions on the specified filesystem |
| Shortcut | Action |
|---|---|
| zfs change-key | Add or change an encryption key on the specified dataset |
| zfs load-key | Load the key for the specified encrypted dataset |
| zfs unload-key | Unload a key for the specified dataset |
| Shortcut | Action |
|---|---|
| zfs program | Execute ZFS administrative operations programmatically via |
| Shortcut | Action |
|---|---|
| zfs rewrite | Rewrite specified files without modification |
| Shortcut | Action |
|---|---|
| zfs jail | Attaches a filesystem to a jail |
| zfs unjail | Detaches a filesystem from a jail |
| Shortcut | Action |
|---|---|
| zfs wait | Wait for background activity in a filesystem to complete |
| Shortcut | Action |
|---|---|
| zpool create | Creates a new storage pool containing the virtual devices |
| zpool initialize | Begins initializing by writing to all unallocated regions |
| Shortcut | Action |
|---|---|
| zpool destroy | Destroys the given pool |
| zpool labelclear | Removes ZFS label information from the specified device |
| Shortcut | Action |
|---|---|
| zpool attach | Converts a non-redundant disk into a mirror |
| zpool detach | Converts a non-redundant disk into a mirror |
| zpool add | Adds the specified virtual devices to the given pool |
| zpool remove | Adds the specified virtual devices to the given pool |
| zpool replace | Replaces an existing device |
| zpool split | Creates a new pool by splitting all mirrors in an existing |
| Shortcut | Action |
|---|---|
| zpool list | Lists the given pools along with a health status and space |
| zpool get | Retrieves the given list of properties |
| zpool set | Retrieves the given list of properties |
| Shortcut | Action |
|---|---|
| zpool status | Displays the detailed health status for the given pools |
| zpool iostat | Displays logical I/O statistics for the given pools/vdevs |
| zpool events | Lists all recent events generated by the ZFS kernel |
| zpool history | Displays the command history of the specified pool(s) |
| Shortcut | Action |
|---|---|
| zpool prefetch | Prefetches specific types of pool data |
| zpool scrub | Begins a scrub or resumes a paused scrub |
| zpool condense | Condense, flush |
| zpool checkpoint | Checkpoints the current state of pool |
| zpool trim | Initiates an immediate on-demand TRIM operation |
| zpool sync | This command forces all in-core dirty data to be written |
| zpool upgrade | Manage the on-disk format version of storage pools |
| zpool wait | Waits until all background activity of the given types has |
| Shortcut | Action |
|---|---|
| zpool offline | Takes the specified physical device offline or brings |
| zpool online | Takes the specified physical device offline or brings |
| zpool resilver | Starts a resilver |
| zpool reopen | Reopen all the vdevs associated with the pool |
| zpool clear | Clears device errors in a pool |
| Shortcut | Action |
|---|---|
| zpool import | Make disks containing ZFS storage pools available |
| zpool export | Exports the given pools from the system |
| zpool reguid | Generates a new unique identifier for the pool |
| Shortcut | Action |
|---|---|
| ZFS_COLOR | Use ANSI color in zfs diff and zfs list output |
| ZFS_MOUNT_HELPER | Cause zfs mount to use mount(8) to mount ZFS datasets |
| ZFS_SET_PIPE_MAX | Tells zfs to set the maximum pipe size for sends/receives |
| ZFS_MODULE_TIMEOUT | Time, in seconds, to wait for /dev/zfs to appear |
| ZFS_ABORT | Cause zpool to dump core on exit for the purposes |
| ZPOOL_AUTO_POWER_ON_SLOT | Automatically attempt to turn on the drives enclosure slot |
| ZPOOL_POWER_ON_SLOT_TIMEOUT_MS | The maximum time in milliseconds to wait for a slot power |
| ZPOOL_IMPORT_PATH | The search path for devices or files to use with the pool |
| ZPOOL_IMPORT_UDEV_TIMEOUT_MS | The maximum time in milliseconds that zpool import will |
| ZPOOL_STATUS_NON_NATIVE_ASHIFT_IGNORE | If set, suppress warning about non-native vdev ashift |
| ZPOOL_VDEV_NAME_GUID | Cause zpool subcommands to output vdev GUIDs by default |
| ZPOOL_VDEV_NAME_FOLLOW_LINKS | Cause zpool subcommands to follow links for vdev names |
| ZPOOL_VDEV_NAME_PATH | Cause zpool subcommands to output full vdev path names |
| ZFS_VDEV_DEVID_OPT_OUT | Older OpenZFS implementations had issues when attempting |
| ZPOOL_SCRIPTS_AS_ROOT | Allow a privileged user to run zpool status/iostat -c |
| ZPOOL_SCRIPTS_PATH | The search path for scripts when running zpool |
| ZPOOL_SCRIPTS_ENABLED | Allow a user to run zpool status/iostat -c |
zpool create builds a pool from disks and a topology (mirror, raidz), and zpool status is the command you will run most often afterwards — it shows health, errors and any resilver or scrub in progress. zpool list shows capacity, zpool iostat live I/O per device. Inside the pool, zfs create makes a dataset (a filesystem with its own properties), zfs list shows them with used and available space, and zfs set and zfs get change and read properties such as compression, recordsize and mountpoint; zfs inherit resets one to its parent's value.
zfs snapshot is instant and free until data changes, zfs rollback returns a dataset to one, and zfs diff lists what changed between a snapshot and now. zfs clone makes a writable copy of a snapshot, and zfs promote swaps a clone into being the parent so the original can be destroyed. Replication is zfs send piped to zfs receive, incrementally between snapshots; zfs hold prevents a snapshot being destroyed while a send depends on it. zfs destroy removes datasets or snapshots and is the command to type slowly.
zpool scrub reads every block and repairs from redundancy; schedule it monthly. When a disk fails, zpool replace swaps it and starts a resilver, zpool offline and zpool online take devices out and back, and zpool clear resets error counters once the cause is fixed. zpool export and zpool import move a pool between hosts cleanly. zpool history shows every administrative command ever run on the pool, which settles "who changed that property". zpool trim issues discards to SSDs, and zpool checkpoint lets a risky change be rewound at the pool level.
zpool manages the pool and its physical devices; zfs manages datasets, snapshots and properties inside the pool.
zpool status. ONLINE with no errors is healthy; DEGRADED means a device is missing or failing.
Take a snapshot, then zfs send it through ssh to zfs receive on the other host. Later sends can be incremental between snapshots.
Monthly is a common default; zpool scrub reads all data and repairs silent corruption using redundancy.
Open your assistant with this page preloaded as the source — great for follow-up questions like "which of these work in other apps?"