Ubuntu: How to mount zfs snapshot?

As of today, ZFS on Linux (ZoL) now also supports read-only access to snapshots via a invisible (not hidden, invisible) directory in the root of the dataset.

# ls -a /tank/test
./  ../  boot.tar  text.tar  text.tar.2
# cd /tank/test/.zfs/
# ls -a
./  ../  shares/  snapshot/

In the snapshot directory you'll find read-only copies of all your snapshots.

You can make .zfs visible via zfs set snapdir=visible tank/test.

Source: https://pthree.org/2012/12/19/zfs-administration-part-xii-snapshots-and-clones/


Running ZoL, just use the regular mount command like this:

mount -t zfs tank/www@zfs-auto-snap_hourly-2012-02-11-1917 /mnt/snapshot/tank/www

Dismount it like this:

umount /mnt/snapshot/tank/www

This is a bug that is being tracked at https://github.com/zfsonlinux/zfs/issues/173