Answer the question
In order to leave comments, you need to log in
Why doesn't btrfs compress everything?
I have been noticing for a long time that btrfs does not compress all data.
For the test, install a minimal ubuntu xenial system per partition.
Pure btrfs:
And now btrfs with zlib compression (btrfs property set /mnt compression zlib):
And now let's defragment (btrfs fil defrag -rvczlib /mnt) and the result is simply shocking:
In theory, compression works based on the comparison of 1 and 2 screens , but at the same time, the system seems to skip compressing some files, because the difference between 2 and 3 is enormous, with the compress-force=zlib option, about the same crap. And, yes, the occupied space df should show normally, this free space cannot be recognized normally.
Answer the question
In order to leave comments, you need to log in
Before compressing a piece of a certain size, a test takes place: a chunk is taken that is much smaller than the compressible one, and they try to compress it. If the compression ratio is low enough, then the rest of the piece is not compressed, but written raw.
And don't the free/occupied data show the commands btrfs fi du /
and btrfs fi df /
?
According to the Dirichlet principle , not all data is compressed as we would like, in which case they are simply not compressed.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question