4

I have created a btrfs filesystem with compression, using the compress option in fstab and it seems to be working. I would quite like to try the higher level of compression. I can change this in fstab, but if I understand it this will affect only new files. I can also recompress with btrfs filesystem defragment. This allows me to set the algorithm but I can't see how to change the level.

Is there a way to achieve this? I was going to try zlib level 9.

Phil Lord
  • 141

1 Answers1

1

From btrfs-progs version 4.15 you can recompress with another compression level for zlib like this:

btrfs fi defrag -czlib:9 ...

For zstd compression level is supported from version 5.1.

See https://btrfs.wiki.kernel.org/index.php/Changelog

But be careful with defrag as it will unreference the snapshot structure of the btrfs filesystem, which might lead to a substantial increase in disk usage.

Christian
  • 185