home
OpenZFS
The smartest reliable filesystem
print

zpool – configure ZFS storage pools

A ZFS storage pool is a logical collection of devices that provide space for datasets.

List pool health status and space usage zpool list

Display the detailed health status zpool status zpool status -x

Create a new storage pool zpool create <pool> <disk>

Create a new storage pool (RAID1) zpool create <pool> mirror <first_disk> <second_disk>

Grow-up a storage pool zpool add <pool> <disk>

Remove a storage pool zpool destroy <pool>

Import a storage pool zpool import <pool>|<pool_id>

Export a storage pool zpool export <pool>|<pool_id>

Display I/O statistics zpool iostat <interval>

Display the command history zpool history <pool>

zfs – configure ZFS file systems

A ZFS dataset of type filesystem can be mounted.

List the property information for the fs-type datasets zfs list

Create a new ZFS file system zfs create <pool>/<dataset>

Remove a ZFS file system zfs destroy <pool>/<dataset>

Set mount point for a dataset zfs set mountpoint=<path> <pool>/<dataset>

Mount and umount a ZFS file system zfs mount [-o mountpoint=<dir>]<pool>/<dataset> zfs umount <pool>/<dataset>

Limit the amount of space a dataset can consume zfs set refquota=<size> <pool>/<dataset>

Guaranty minimum amount of space to a dataset zfs set refreservation=<size> <pool>/<dataset>

zfs – configure ZFS volumes

A ZFS dataset of type volume is a logical volume exported as a raw or block device.

Create a volume with reservation (thick) zfs create -V <size> <volume>

Creates a sparse volume with no reservation zfs create -s -V <size> <volume>


zfs – configure ZFS snapshots

A snapshot is a read-only copy of a file system.

File system snapshots can be accessed under the .zfs/snapshot directory in the root of the file system.

List snapshots zfs list -t snapshot

Create a snapshot zfs snapshot <pool>/<dataset>@<snapshot>

Rollback a snapshot zfs rollback <pool>/<dataset>@<snapshot>

Remove a snapshot zfs destroy <pool>/<dataset>@<snapshot>

Remove a snapshot and his descendent snapshots zfs destroy -r <pool>/<dataset>@<snapshot>

zfs – configure ZFS CLONES

A clone is a writable volume or file system whose initial contents are the same as the original dataset.

Create a clone zfs clone <snapshot> <filesystem>|<volume>

zfs – configure backup and restore

ZFS implements data protection feature

Backup a snapshot in a file zfs send <pool>/<dataset>@<snapshot> > <file>

Restore a file system from a file zfs recv <pool>/<dataset> < <file>

Perform increment backup in a file zfs send -i <snapshot_n> <snapshot_n+1> > <file>

Perform differential backup in a file zfs send -I <snapshot_n> <snapshot_n+p> > <file>

Duplicate a snapshot as a new file system zfs send <pool>/<dataset>@<snapshot> | zfs recv <pool>/<other_dataset>

Duplicate a snapshot on a different host zfs send <pool>/<dataset>@<snapshot> | ssh <host> zfs recv <pool>/<dataset>

zfs – set ZFS file systems properties

Properties control ZFS behaviour.

List properties of a dataset zfs get all <pool>/<dataset>

Create a NFS share zfs set sharenfs=on <pool>/<dataset>

Activate compression zfs set compression=gzip <pool>/<dataset>

Activate encryption (only at the creation of the dataset), with Oracle ZFS zfs create -o encryption=on <pool>/<dataset>

Activate read-only mode zfs set readonly=on <pool>/<dataset>

Prevent executing from within this file system zfs set exec=off <pool_name>/<dataset_name>