zfs tools

zfs is one of the strong points of FreeBSD.

Nowadays it is available also on Linux, although we tested it quite thoroughly numerous times, only to find subtle bugs.

Here is a curated lists of tools that makes using zfs features easier.

beadm

sudo pkg install -y beadm

beadm takes snapshots of the boot disk to manage Boot Environments on ZFS filesystems.

I use it every time I do a majot pkg upgrade.

zfsnap

sudo pkg install -y zfsnap2

This will take a snaphot of zpool/dataset flagged to last 1h

zfsnap snapshot -s -S -a 1h zpool/dataset

This will destroy all snapshots that are expired from those two pools

sudo /usr/local/sbin/zfsnap destroy zroot/usr/home backup/backup/home

zxfer

sudo pkg install -y zxfer

This will copy all snapshots to backup (via zfs send/receive). It could be any remote zpool too.

zxfer -dFkPv -R zroot/usr/home backup

zfs-snap-diff

sudo pkg install -y zfs-snap-diff

It allows to browse snapshots of a given zpool, showing diffs.

This tools shows how zfs is way better that Apple TimeMachine.

Example:

sudo zfs-snap-diff zpool

will launch a web server. Navigating to 127.0.0.1:12345 will show its interface and allow to see all the snapshots and navigate the diffs.