Categories
BSD/Linux Tech

ZFS notes

Ignore this post if you have no idea what ZFS is.

ZFS related notes for posterity. I’ve got it up and running as well as BTRFS. ZFS seems better. So that’s settled.

Create a pool

Create a mirrored pool of 2 disks:

sudo zpool create -f thepool mirror /dev/sdc /dev/sdd

Or a raidz pool with 5 disks:

sudo zpool create -f thepool raidz /dev/xvdh /dev/xvdi /dev/xvdj /dev/xvdk /dev/xvdl

Create a <something> (subfolder thingie) in the pool:

sudo zfs create thepool/TS200V

Set the entire pool to compressed:

zfs set compression=gzip thepool

Check compression:

zfs get all | grep compr

Show all the info including snapshots

zfs list -rt all

Snapshots

Take a snapshot and send it somewhere

zfs snapshot thepool/TS200V@20160711

zfs send thepool/TS200V@20160711 | ssh server.com zfs receive thepool/Backup_TS200V

Take a snapshot and send it somewhere incrementally on top of old snapshot

zfs snapshot thepool/TS200V@20161127

sudo zfs send -i thepool/TS200V@20160711 thepool/TS200V@20161127 | ssh server.com zfs receive thepool/Backup_TS200V

Reimport pool

After upgrading Ubuntu once it forgot the pools for whatever reason. Easy to re-add them. This finds all available pools

zpool import

Then you just import it:

zpool import thepool

Leave a Reply

Your email address will not be published. Required fields are marked *