@
Jirajine 同一个文件,一个虚拟机镜像,raw 格式的,btrfs 根本压不动,btrfs 压缩正常。
我的测试程序:
```
zpool create tank /dev/sdc
zfs create tank/lz4
zfs create tank/gzip9
zfs create tank/zstd
zfs set compression=lz4 tank/lz4
zfs set compression=gzip-9 tank/gzip9
zfs set compression=zstd tank/zstd
zfs set dedup=on tank
time cp ~/fedora33-1.img /tank/lz4
zfs list;zpool list
time cp ~/fedora33-1.img /tank/gzip9
zfs list;zpool list
time cp ~/fedora33-1.img /tank/zstd
zfs list;zpool list
```
结果:
```
# real 0m3.000s
# user 0m0.030s
# sys 0m2.325s
# NAME USED AVAIL REFER MOUNTPOINT
# tank 3.93G 285G 26K /tank
# tank/gzip9 24K 285G 24K /tank/gzip9
# tank/lz4 3.92G 285G 3.92G /tank/lz4
# tank/zstd 24K 285G 24K /tank/zstd
# NAME SIZE ALLOC FREE CKPOINT EXPANDSZ FRAG CAP DEDUP HEALTH ALTROOT
# tank 298G 3.89G 294G - - 0% 1% 1.00x ONLINE -
#
# real 1m0.327s
# user 0m0.052s
# sys 0m2.019s
# NAME USED AVAIL REFER MOUNTPOINT
# tank 7.13G 283G 26K /tank
# tank/gzip9 2.70G 283G 2.70G /tank/gzip9
# tank/lz4 4.39G 283G 4.39G /tank/lz4
# tank/zstd 24K 283G 24K /tank/zstd
# NAME SIZE ALLOC FREE CKPOINT EXPANDSZ FRAG CAP DEDUP HEALTH ALTROOT
# tank 298G 6.10G 292G - - 0% 2% 1.17x ONLINE -
#
# real 0m20.419s
# user 0m0.038s
# sys 0m2.241s
<忘记拷贝了,现在已经被冲刷了>
```