Dedup Example in Solaris

As of Solaris 11, and formerly open solaris, the dedup option is available as a standard feature of a zfs pool. To enable dedup it is just a quick parameter adjustment. Below is an example of how to enable dedup and a quick test to verify it works.

root@solaris:~# zfs list
NAME                         USED  AVAIL  REFER  MOUNTPOINT
pool                         233K   357M  41.4K  /pool
pool/share                  40.6K   100M  40.6K  /pool/share
root@solaris:~# zfs set dedup=on pool/share
root@solaris:/pool/share# zfs get dedup pool/share
pool/share  dedup     on             local
root@solaris:/pool/share# dd if=/dev/zero of=testfile bs=1K count=10240
10240+0 records in
10240+0 records out
10485760 bytes (10 MB) copied, 10.7363 s, 977 kB/s
root@solaris:/pool/share# zfs list
NAME                         USED  AVAIL  REFER  MOUNTPOINT
pool                        10.2M   356M  41.4K  /pool
pool/share                  10.0M  90.0M  10.0M  /pool/share

Notice the pool available is 357M starting, after writing 10MB worth of zeros to a file on pool/share using the dd command we notice the pool size is 356M. Since deduplication works at a block level it is of reasonable speed. For what you get, it is a good option to conserve pool space in solaris.