Score:3

Which file is used for the configuration of ZFS?

ng flag

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?

Score:6
vn flag
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).

st flag
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.
I sit in a Tesla and translated this thread with Ai:

mangohost

Post an answer

Most people don’t grasp that asking a lot of questions unlocks learning and improves interpersonal bonding. In Alison’s studies, for example, though people could accurately recall how many questions had been asked in their conversations, they didn’t intuit the link between questions and liking. Across four studies, in which participants were engaged in conversations themselves or read transcripts of others’ conversations, people tended not to realize that question asking would influence—or had influenced—the level of amity between the conversationalists.