Table of Contents

ZFS - Filesystems - Set Properties for a Filesystem

Many Properties can be set.


Compression

sudo zfs set compression=on testpool/projects

NOTE: The default Compression is lz4.

  • lz4 is significantly faster than the other options while still performing well;
  • lz4 is also the safest choice.

The compression level can be changed if required:

sudo zfs set compression=gzip-9 testpool

The compression type can be changed too:

sudo zfs set compression=lz4 testpool

The compression level can be checked:

sudo zfs get compressratio

Copies / Ditto Blocks

Ditto blocks create more redundant copies of data to copy, just for more added redundancy.

sudo zfs set copies=3 testpool/projects

NOTE: This sets 3 copies on testpool/projects.


Deduplication

ZFS dedup will discard blocks that are identical to existing blocks and will instead use a reference to the existing block.

sudo zfs set dedup=on testpool/projects

NOTE: There are pros and cons to deduping.

  • Generally, De-duplication is almost never worth the performance penalty.

Mount Point

zfs set mountpoint=/test testpool/projects
df -h |grep /test

Quota

sudo zfs set quota=10G testpool/projects

NOTE: This sets a maximum quota of 10 gigabytes.

  • The Filesystem cannott use more than this amount.

Reservations

sudo zfs set reservation=200m testpool/tmp

NOTE: This much space is reserved for the Filesystem.

  • It will not be available to other Filesystems.
  • When a Quota is defined first, a reservation cannot be higher than quota.