ZFS cheatsheet

ZFS cheatsheet

Plug in USB device, then run

zpool import

It will list available pools

then import a pool

zpool import paulmedia

when done run

zpool export paulmedia

scrub

zpool scrub 

check on status of scrub

zpool status

Pools are mounted in the root directory. paulmedia would be in /paulmedia.

Some information about the pool, such as storage use, can be done with:

zpool list paulmedia

Get feature/property information of a pool

zfs get all paulmedia

Creating a new ZFS pool for replication.

First use parted to initialize the partition with a GUID.

gparted print rm 1 rm 2 quit

mkpart "paulbackup" ext4 0% 100% quit

create pool "snaps" from paulbackup

zpool create snaps paulbackup

in case you want to destroy the pool and start over zpool destroy snaps

zfs snapshot paulmedia/shows@init zfs send paulmedia/shows@init | zfs receive snaps/shows@init

incremental zfs send -i paulmedia/shows@init paulmedia/shows@next | zfs receive -dF snaps/shows

The -i flag is the reference snapshot from a previous snapshot, the argument after that is the snapshot to send

list snapshots

zfs list -t snapshot

set lz4 compression on snaps zfs set compression=lz4 snaps

create dataset in pool

zfs create pool/new_dataset

(shows up as subdirectory)

list datasets:

zfs list


home | index