In Ubuntu, configuration of settings such as the following can be done via console:

  • Enabling and disabling compression, choice of compression algorithm and compression strength.
  • Enabling and disabling deduplication.

In which configuration file are these settings stored and is it allowed to edit them with an editor?

1 Answer 1

ZFS pool and filesystem properties

This is not how ZFS (or any modern filesystem for that matter) works. All properties in ZFS is stored as metadata in the filesystem itself.

Use this command to get all Zpool properties: (in total 29 properties and 34 feature flags for ZFS 2.1.4)

zpool get all

Use this command to get all filesystem properties: (in total 74 properties for ZFS 2.1.4 for each filesystem/snapshot)

zfs get all

To get compression properties use:

zfs get compression [Zpool-name]

Similarly, properties are set with zfs set instead of zfs get.

So to enable lz4 compression on a Zpool use:

zfs set compression=lz4 [Zpool-name]

This compression setting will be inherited on any underlying datasets in the Zpool by default.

ZFS kernel parameters

There are a number of ZFS kernel module parameters that are controlled elsewhere.

These options are set in /etc/modprobe.d/zfs.conf. A common option would be to set the ZFS ARC size here, for instance:

# Setting up ZFS ARC size on Ubuntu as per our needs
# Set Max ARC size => 2GB == 2147483648 Bytes
options zfs zfs_arc_max=2147483648
# Set Min ARC size => 1GB == 1073741824
options zfs zfs_arc_min=1073741824

These setting will be applied after a reboot with the next kernel update, or if you update the initramfs manually:

sudo update-initramfs -u -k all

The full list of tunable ZFS kernel parameters (291 kernel parameters for ZFS 2.1.4).

  • It should be obvious why at least the values which are required to correctly decode the filesystem cannot be stored in a regular file on the filesystem. Dec 3, 2022 at 1:14

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.