As indicated in the previous ZFS post, I'm using ZFS for my servers.

This is a post so that I can share interesting commands that you might not know about and so I save it somewhere I can quickly look for.

Snapshoting

ZFS has a mechanism to do CoW (Copy on Write) for datasets. This is a very neat feature that works as the following :

Suppose my volume is called zroot/local/root snapshoting is as easy as running the following :

zfs snapshot zroot/local/root@blank

Blank being the name of my snapshot.

You can also diff :

zfs diff $DS1 $DS2

VOL1 and 2 can be snapshot or live datasets!

You can also rollback to a previous volume state :

zfs rollback -r zpool/local/root@blank

This is used to do a "clean slate" setup at reboot like in https://grahamc.com/blog/erase-your-darlings/.