TL;DR

Cheat sheet: zpool create, export/import, lz4, L2ARC, SLOG, labelclear, destroy — the 2 a.m. set.

Short reference. Longer procedures are linked at the bottom.

Pool

1
2
3
4
5
6
zpool create vol1 raidz sda sdb sdc
zpool status vol1
zpool export vol1
zpool import -f vol1
zpool destroy tank          # irreversible
zpool labelclear ada0       # wipe ZFS labels from a spare disk

raidz here is RAIDZ1 (one parity). For two, raidz2. Address disks as /dev/disk/by-id/…, not sdX, which reorder.

Mountpoint

1
2
3
zfs unmount vol1
zfs set mountpoint=/mnt/vol1 vol1
zfs mount vol1

L2ARC (cache) and SLOG (ZIL)

1
2
3
4
zpool add vol1 cache <disk-id>
zpool add vol1 log <disk-id>
zpool add vol1 log mirror <disk-id-a> <disk-id-b>
zpool remove vol1 <device>

Cache = hot reads. Log = sync writes (NFS, VMs). A “fast” USB SLOG is worse than no SLOG: if it dies mid-txg, you feel it. Mirror the log.

Compression

1
2
3
zfs set compression=lz4 newvol
zfs set compression=off newvol
zfs get compressratio newvol

lz4 is the sane default on modern OpenZFS. zstd compresses more and costs CPU. The property inherits to child datasets that do not override it.

See also