Managing ZFS File Systems in Oracle® Solaris 11.2

Exit Print View

Updated: December 2014

Displaying and Accessing ZFS Snapshots

By default, snapshots are no longer displayed in the zfs list output. You must use the zfs list –t snapshot command to display snapshot information. Or, enable the listsnapshots pool property. For example:

# zpool get listsnapshots tank
tank  listsnapshots  off        default
# zpool set listsnapshots=on tank
# zpool get listsnapshots tank
tank  listsnapshots  on         local

Snapshots of file systems are accessible in the .zfs/snapshot directory within the root of the file system. For example, if tank/home/cindy is mounted on /home/cindy, then the tank/home/cindy@thursday snapshot data is accessible in the /home/cindy/.zfs/snapshot/thursday directory.

# ls /tank/home/cindy/.zfs/snapshot
thursday   tuesday    wednesday

You can list snapshots as follows:

# zfs list -t snapshot -r tank/home
NAME                       USED  AVAIL  REFER  MOUNTPOINT
tank/home/cindy@tuesday     45K      -  2.11G  -
tank/home/cindy@wednesday   45K      -  2.11G  -
tank/home/cindy@thursday      0      -  2.17G  -

You can list snapshots that were created for a particular file system as follows:

# zfs list -r -t snapshot -o name,creation tank/home
NAME                       CREATION
tank/home/cindy@tuesday    Fri Aug  3 15:18 2012
tank/home/cindy@wednesday  Fri Aug  3 15:19 2012
tank/home/cindy@thursday   Fri Aug  3 15:19 2012
tank/home/lori@today       Fri Aug  3 15:24 2012
tank/home/mark@today       Fri Aug  3 15:24 2012

Disk Space Accounting for ZFS Snapshots

When a snapshot is created, its disk space is initially shared between the snapshot and the file system, and possibly with previous snapshots. As the file system changes, disk space that was previously shared becomes unique to the snapshot, and thus is counted in the snapshot's used property. Additionally, deleting snapshots can increase the amount of disk space unique to (and thus used by) other snapshots.

A snapshot's space referenced property value is the same as the file system's was when the snapshot was created.

You can identify additional information about how the values of the used property are consumed. New read-only file system properties describe disk space usage for clones, file systems, and volumes. For example:

$ zfs list -o space -r rpool
rpool                      124G  9.57G         0    302K              0      9.57G
rpool/ROOT                 124G  3.38G         0     31K              0      3.38G
rpool/ROOT/solaris         124G  20.5K         0       0              0      20.5K
rpool/ROOT/solaris/var     124G  20.5K         0   20.5K              0          0
rpool/ROOT/solaris-1       124G  3.38G     66.3M   3.14G              0       184M
rpool/ROOT/solaris-1/var   124G   184M     49.9M    134M              0          0
rpool/VARSHARE             124G  39.5K         0   39.5K              0          0
rpool/dump                 124G  4.12G         0   4.00G           129M          0
rpool/export               124G    63K         0     32K              0        31K
rpool/export/home          124G    31K         0     31K              0          0
rpool/swap                 124G  2.06G         0   2.00G          64.7M          0

For a description of these properties, see Table 5–1.