This is an old revision of the document!
<https://denisbondar.github.io/post/zfs-manual-rus/> - manual <https://xakep.ru/2014/07/08/zfs-at-home/#toc07.> old one
# zfs pools and mount points
tree /dev/zvol/
/dev/zvol/
├── rpool
├── data
│ ├── vm-100-disk-1 -> ../../../zd0
│ └── vm-100-disk-1-part1 -> ../../../zd0p1
└── swap -> ../../zd16
zfs get compressratio
NAME PROPERTY VALUE SOURCE
rpool compressratio 1.07x -
rpool/ROOT compressratio 1.78x -
rpool/ROOT/pve-1 compressratio 1.78x -
rpool/data compressratio 1.06x -
rpool/data/subvol-110-disk-0 compressratio 1.77x -
# start trim operation
zpool trim rpool
# show status
zpool status -t rpool
Recompress zfs
#You basically have to rewrite every block of every file.
#A reasonably safe and simple way to do it is like this, however this
#assumes you have sufficient space.
#First set the new value for compression.
zfs set compression=on tank/fs
#Send a snapshot to a temporary name
zfs snapshot tank/***@1
zfs send -R tank/***@1 | zfs recv -vFd tank/fs-recompressed
#Mark the original as readonly and send anything newly written
#since the 'zfs send' above started.
zfs set readonly=on tank/fs
zfs snapshot tank/***@2
zfs send -i tank/***@1 tank/***@2 | zfs recv -v tank/fs-recompressed
#Now delete the original and rename the newone into its place.
zfs delete tank/fs
zfs rename tank/fs-recompressed tank/fs
#Note that the new tank/fs will have all the the snapshots of
#the original as well since -R was used with the zfs send.