Включаем компрессию:

zfs set compression=on zroot

Включаем дедупликацию:

zfs set dedup=on zroot

Создаем новый пул, в котором существующие файлы будут сжаты:

dd if=/dev/zero of=/mnt/zroot-comp
service zfs-fuse restart

Сжимаем существующие файлы:

zfs set compression=on tank/fs

Send a snapshot to a temporary name

zfs snapshot tank/f…@1 zfs send -R tank/f…@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/f…@2 zfs send -i tank/f…@1 tank/f…@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

Enter your comment. Wiki syntax is allowed:
P X A A O
 
  • linux_faq/freebsd_optimize_zfs_for_higher_capacity.txt
  • Last modified: 2019/02/11 09:13
  • (external edit)