我已经创建了 pool tank1 和 fs tank/home。
[root@zfs]# zfs list
NAME USED AVAIL REFER MOUNTPOINT
tank1 3.22G 381G 32.0K /tank1
tank1/home 3.22G 16.8G 1.95G /tank1/home
Run Code Online (Sandbox Code Playgroud)
我在/dev/zero
tank1 /home 中创建了两个 1G 文件,其中.Deduplication 已打开,压缩已关闭:
# zfs get all | egrep 'dedup|compression'
tank1 compression off default
tank1 dedup on local
tank1/home compression off default
tank1/home dedup on inherited from tank1
# zpool list
NAME SIZE ALLOC FREE EXPANDSZ FRAG CAP DEDUP HEALTH ALTROOT
tank1 596G 4.84G 591G - 0% 0% 1.00x ONLINE -
# zdb -D tank1
All DDTs are empty
# zdb -S tank1
Simulated DDT histogram:
bucket allocated referenced
______ ______________________________ ______________________________
refcnt blocks LSIZE PSIZE DSIZE blocks LSIZE PSIZE DSIZE
------ ------ ----- ----- ----- ------ ----- ----- -----
16K 1 128K 128K 128K 25.8K 3.22G 3.22G 3.22G
Total 1 128K 128K 128K 25.8K 3.22G 3.22G 3.22G
dedup = 26400.00, compress = 1.00, copies = 1.00, dedup * compress / copies = 26425.81
Run Code Online (Sandbox Code Playgroud)
为什么zdb
输出并zpool list
没有显示任何重复数据删除和模拟zdb -S tank1
显示26400?如何开启重复数据删除?我也试过了zfs set dedup=verify tank1
,问题依旧。什么是zdb -DD tank1/home
menas的输出?
# zdb -DD tank1/home
Dataset tank1/home [ZPL], ID 165, cr_txg 963, 1.95G, 8 objects
Run Code Online (Sandbox Code Playgroud)
ZFS 重复数据删除仅对启用重复数据删除后部署的文件生效。
在启用重复数据删除之前,它不会影响旧文件。
要查看重复数据删除节省了多少,请使用该命令zpool status -D poolname
并注意Total allocated blocks
vs Total referenced blocks
。