$linuxjunkies
>

zfs(8)

Manage ZFS filesystems, volumes, snapshots, and storage pools.

UbuntuDebianFedoraArch

Synopsis

zfs SUBCOMMAND [OPTIONS] [ARGUMENTS]

Description

zfs is the primary command for administering ZFS datasets, including filesystems, volumes, snapshots, and clones. It allows you to create, destroy, list, and modify ZFS storage objects and their properties.

ZFS is a combined filesystem and logical volume manager that provides advanced features like copy-on-write, snapshots, compression, deduplication, and RAID-like protection (via vdev redundancy managed by zpool).

Common subcommands include: create, destroy, list, get, set, snapshot, clone, send, receive, mount, and unmount.

Common options

FlagWhat it does
-rRecursively apply operation to all child datasets
-pPrint exact numeric values (no unit suffixes)
-HOmit headers and use tab delimiters in output
-o propertySpecify which properties to display or set
-s propertySort output by the specified property
-d depthLimit recursion depth for list operations

Examples

List all ZFS datasets with basic information (name, used, available, mountpoint)

zfs list

Create a new filesystem named 'data' as a child of the 'tank' pool

zfs create tank/data

Recursively display compression ratio for tank and all child datasets

zfs get -r compressratio tank

Enable LZ4 compression on the tank/data filesystem

zfs set compression=lz4 tank/data

Recursively create snapshots of tank and all children with tag 'backup-2024'

zfs snapshot -r tank@backup-2024

Create a writable clone of the snapshot at tank/restore

zfs clone tank@backup-2024 tank/restore

Stream a snapshot to another pool for backup or replication

zfs send tank@snap1 | zfs receive backup/tank

Recursively delete the tank/data filesystem and all its snapshots/children

zfs destroy -r tank/data

Related commands