zfs:filesystems:set_properties_for_a_filesystem
Differences
This shows you the differences between two versions of the page.
Next revision | Previous revision | ||
zfs:filesystems:set_properties_for_a_filesystem [2021/10/13 13:20] – created peter | zfs:filesystems:set_properties_for_a_filesystem [2021/10/13 22:09] (current) – [Deduplication] peter | ||
---|---|---|---|
Line 1: | Line 1: | ||
====== ZFS - Filesystems - Set Properties for a Filesystem ====== | ====== ZFS - Filesystems - Set Properties for a Filesystem ====== | ||
+ | |||
+ | Many Properties can be set. | ||
+ | |||
+ | ---- | ||
+ | |||
+ | ===== Compression ===== | ||
+ | |||
+ | <code bash> | ||
+ | sudo zfs set compression=on testpool/ | ||
+ | </ | ||
+ | |||
+ | <WRAP info> | ||
+ | **NOTE: | ||
+ | |||
+ | * 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: | ||
+ | |||
+ | <code bash> | ||
+ | sudo zfs set compression=gzip-9 testpool | ||
+ | </ | ||
+ | |||
+ | The compression type can be changed too: | ||
+ | |||
+ | <code bash> | ||
+ | sudo zfs set compression=lz4 testpool | ||
+ | </ | ||
+ | |||
+ | The compression level can be checked: | ||
+ | |||
+ | <code bash> | ||
+ | sudo zfs get compressratio | ||
+ | </ | ||
+ | |||
+ | </ | ||
+ | |||
+ | ---- | ||
+ | |||
+ | ===== Copies / Ditto Blocks ===== | ||
+ | |||
+ | Ditto blocks create more redundant copies of data to copy, just for more added redundancy. | ||
+ | |||
+ | * With a storage pool of just one device, ditto blocks are spread across the device, trying to place the blocks at least 1/8 of the disk apart. | ||
+ | * With multiple devices in a pool, ZFS tries to spread ditto blocks across separate VDEVs. | ||
+ | * 1 to 3 copies can be can be set. | ||
+ | |||
+ | |||
+ | <code bash> | ||
+ | sudo zfs set copies=3 testpool/ | ||
+ | </ | ||
+ | |||
+ | <WRAP info> | ||
+ | **NOTE: | ||
+ | </ | ||
+ | |||
+ | ---- | ||
+ | |||
+ | ===== Deduplication ===== | ||
+ | |||
+ | ZFS dedup will discard blocks that are identical to existing blocks and will instead use a reference to the existing block. | ||
+ | |||
+ | * This saves space on the device but comes at a large cost to memory. | ||
+ | * The dedup in-memory table uses ~320 bytes per block. | ||
+ | * The greater the table is in size, the slower write performance becomes. | ||
+ | |||
+ | <code bash> | ||
+ | sudo zfs set dedup=on testpool/ | ||
+ | </ | ||
+ | |||
+ | <WRAP info> | ||
+ | **NOTE: | ||
+ | |||
+ | * Generally, De-duplication is almost never worth the performance penalty. | ||
+ | |||
+ | </ | ||
+ | |||
+ | ---- | ||
+ | |||
+ | ===== Mount Point ===== | ||
+ | |||
+ | <code bash> | ||
+ | zfs set mountpoint=/ | ||
+ | df -h |grep /test | ||
+ | </ | ||
+ | |||
+ | ---- | ||
+ | |||
+ | ===== Quota ===== | ||
+ | |||
+ | <code bash> | ||
+ | sudo zfs set quota=10G testpool/ | ||
+ | </ | ||
+ | |||
+ | <WRAP info> | ||
+ | **NOTE: | ||
+ | |||
+ | * The Filesystem cannott use more than this amount. | ||
+ | |||
+ | </ | ||
+ | |||
+ | ---- | ||
+ | |||
+ | ===== Reservations ===== | ||
+ | |||
+ | <code bash> | ||
+ | sudo zfs set reservation=200m testpool/ | ||
+ | </ | ||
+ | |||
+ | <WRAP info> | ||
+ | **NOTE: | ||
+ | |||
+ | * It will not be available to other Filesystems. | ||
+ | * When a Quota is defined first, a reservation cannot be higher than quota. | ||
+ | |||
+ | </ | ||
+ | |||
zfs/filesystems/set_properties_for_a_filesystem.1634131214.txt.gz · Last modified: 2021/10/13 13:20 by peter