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
└── tank
├── vm-100-disk-1 -> ../../zd48
├── vm-100-disk-1-part1 -> ../../zd48p1
├── vm-100-disk-1-part2 -> ../../zd48p2
├── vm-100-disk-2 -> ../../zd64
├── vm-100-disk-2-part1 -> ../../zd64p1
├── vm-101-disk-1 -> ../../zd32
└── vm-101-disk-1-part1 -> ../../zd32p1
# 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.