25.7 ZFS 压缩

查看各个 ZFS 文件系统的数据压缩属性及其当前设置:

# zfs get compression
NAME                PROPERTY     VALUE           SOURCE
zroot               compression  lz4             local
zroot/ROOT          compression  lz4             inherited from zroot
zroot/ROOT/default  compression  lz4             inherited from zroot
zroot/home          compression  lz4             inherited from zroot
zroot/home/ykla     compression  lz4             inherited from zroot
zroot/tmp           compression  lz4             inherited from zroot
zroot/usr           compression  lz4             inherited from zroot
zroot/usr/ports     compression  lz4             inherited from zroot
zroot/usr/src       compression  lz4             inherited from zroot
zroot/var           compression  lz4             inherited from zroot
zroot/var/audit     compression  lz4             inherited from zroot
zroot/var/crash     compression  lz4             inherited from zroot
zroot/var/log       compression  lz4             inherited from zroot
zroot/var/mail      compression  lz4             inherited from zroot
zroot/var/tmp       compression  lz4             inherited from zroot

将 zroot 文件系统的数据压缩算法设置为 zstd-5 级别:

# zfs set compression=zstd-5 zroot

系统重启后,再次列出各个 ZFS 文件系统的数据压缩属性及其当前设置:

查看各个 ZFS 文件系统的实际数据压缩比:

最后更新于