问题在底部。
我有几个 ZFS 文件系统我想使用 ZFS 压缩,但是由于启用压缩只会影响写入文件系统的新数据,我想编写一个可以迁移文件系统的脚本,因此所有数据都被压缩。
这是我的测试尝试
du -h /tmp/dump.txt
zfs create -p tank3/xtest1/fs
cp /tmp/dump.txt /tank3/xtest1/fs
zfs list | grep xtest
zfs create tank3/xtest2
zfs set compression=lzjb tank3/xtest2
zfs inherit compression tank3/xtest2
zfs snapshot tank3/xtest1/fs@snap
zfs send tank3/xtest1/fs@snap | zfs receive tank3/xtest2/fs
zfs get compression tank3/xtest2/fs
zfs list | grep xtest
zfs destroy -r tank3/xtest1
zfs destroy -r tank3/xtest2
echo "test 2"
zfs create tank3/xtest2
zfs set compression=lzjb tank3/xtest2
zfs list | grep xtest
cp /tmp/dump.txt /tank3/xtest2
zfs list …Run Code Online (Sandbox Code Playgroud)