Solaris ZFS Administration Guide

The dedup Property

This property controls whether duplicate data is removed from the file system. If a file system has the dedup property enabled, duplicate data blocks are removed synchronously. The result is that only unique data is stored and common components are shared between files.

When dedup is enabled, the dedup checksum algorithm overrides the checksum property. Setting the value to verify is equivalent to specifying sha256,verify. If the property is set to verify and two blocks have the same signature, ZFS does a byte-for-byte comparison with the existing block to ensure that the contents are identical.

This property can be enabled per file system as follows:


# zfs set dedup=on tank/home

You can use the zfs get command to determine if the dedup property is set.

Although deduplication is set as a file system property, the scope is pool-wide. For example, you can identify the deduplication ratio as follows:


# zpool list tank
NAME    SIZE  ALLOC   FREE    CAP  DEDUP  HEALTH  ALTROOT
rpool   136G  55.2G  80.8G    40%  2.30x  ONLINE  -

The DEDUP column indicates how much deduplication has occurred. If the dedup property is not enabled on any dataset or if the dedup property was just enabled on the dataset, the DEDUP ratio is 1.00x.

You can use the zpool get command to determine the value of the dedupratio property.


# zpool get all export
NAME     PROPERTY       VALUE       SOURCE
export   size           33.8G       -
export   capacity       0%          -
export   altroot        -           default
export   health         ONLINE      -
export   guid           2064230982813446135  default
export   version        22          default
export   bootfs         -           default
export   delegation     on          default
export   autoreplace    off         default
export   cachefile      -           default
export   failmode       wait        default
export   listsnapshots  off         default
export   autoexpand     off         default
export   dedupditto     0           default
export   dedupratio     3.00x       -
export   free           33.6G       -
export   allocated      105M        -

This pool property illustrates how much deduplication we have been able to achieve.