最後更新: 2024-10-21
目錄
Compression in ZFS
compression is enabled on a dataset (show on `zfs list`)
ZFS tries to compress all new blocks before writing them and decompresses them on reading
Enable Compression
# recommend: lz4 (focused on compression and decompression speed)
zfs set compression=<algorithm> <dataset>
# off
zfs set compression=off <dataset>
ie.
zfs create MyPool/data
zfs set compression=lz4 MyPool/data
Compression Info.
zfs get compression MyPool/data
NAME PROPERTY VALUE SOURCE MyPool/data compression lz4 local
zfs get compressratio MyPool/data compressratio
NAME PROPERTY VALUE SOURCE MyPool/data compressratio 1.28x -
ZFS Pool Features (ZFS pool on-disk format Versions)
* enabling new features can render a pool not importable by an older version of ZFS
ZFS pool on-disk format versions are specified via "features" which replace the old on-disk format numbers
– allow a uniquely named pool property for each change to the on-disk format.
Feature states:
- active,
- enabled,
- disabled (Features cannot be disabled once they have been enabled.)
Enable a feature
zpool upgrade # All feature
zpool set feature@feature-name=enabled
# Displays a list of file systems that are not the most recent version.
zpool upgrade
# To see what new features the upgrade provides
zpool upgrade -v
VER DESCRIPTION --- -------------------------------------------------------- 1 Initial ZFS filesystem version 2 Enhanced directory entries 3 Case insensitive and filesystem user identifier (FUID) 4 userquota, groupquota properties 5 System attributes
# Upgrades file systems to a new on-disk version
zfs upgrade PoolName