ZFS dataset compression

ZFS dataset compression

Tags :

Category : How-to

Get Social!

ZFS datasets support a host of features to help you manage your storage mounts as effectively as possible. Compression is a feature common in many file systems and it’s also included in ZFS!

See this post for information on installing ZFS and setting up a volume with a data set.

First of all, we need to identify the dataset name to apply compression with zfs list.

With the result looking similar to below. In my example, there are three datasets; backups, binaries and homes.

Let’s apply compression to the datastore/homes dataset. Check to see if compression is already applied to the dataset with zfs get compression.

Our current datastore/homes dataset is not currently compressed. To enable compression, use the zfs set command.

Check the compression status again to make sure the change has taken effect.

By default, ZFS uses gzip-6. There are various options we can use here, to override the default.

  • The compression library gzip ranges from gzip-1, with the lowest compression, up to gzip-9 with the highest compression.
  • ZLE is the fastest compression method but it’s only compresses one scenario – a run of zeros.
  • The older library LZJB exists, however this usually offers inferior compression compared with gzip.

For a few more examples, see below.

Finally, to remove compression from a dataset, run:

 


Related posts:


Leave a Reply

Visit our advertisers

Search

Quick Poll

Which type of virtualisation do you use?
  • Add your answer

Visit our advertisers