Accessing ZFS snapshots

Per default the snapshot directory is not visible in the filesystem, but
can be used by the zfs command.

# zfs list
NAME USED AVAIL REFER MOUNTPOINT
pool/zones/soldemoprogvsk@zfs-auto-snap:daily-2008-07-09-00:00:00 316K - 90,9M -
pool/zones/soldemoprogvsk@zfs-auto-snap:daily-2008-07-10-00:00:00 206K - 90,9M -
pool/zones/soldemoprogvssap 278M 8,13G 269M /zones/soldemoprogvssap

Here are the zfs filesystems with the snapshots. Listing the directory reveals, that the snapshot is not visible.

# ls -al /zones/soldemoprogvssap
Gesamt 14
drwx------ 4 root sys 4 Mrz 21 08:51 .
drwxr-xr-x 10 root sys 10 Jul 8 13:23 ..
dr-xr-xr-x 3 root root 3 Mrz 21 08:48 .zfs
drwxr-xr-x 12 root root 51 Mrz 21 08:53 dev
drwxr-xr-x 20 root root 24 Mai 6 17:51 root


Now we fetch the property defining the visibility:
# zfs get snapdir pool/zones/soldemoprogvssap
NAME EIGENSCHAFT WERT QUELLE
pool/zones/soldemoprogvssap snapdir hidden local

Now we set the property to visible:

# zfs set snapdir=visible pool/zones/soldemoprogvssap


And here is the content:

# pwd
/zones/soldemoprogvssap/.zfs/snapshot/zfs-auto-snap:daily-2008-07-09-00:00:00
# ls
dev root

As you see, there is the hidden directory .zfs accessbile. Now we can copy
old files from the snapshot.