S
S
syxoi2017-03-02 12:52:51
*nix-like systems
syxoi, 2017-03-02 12:52:51

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:
c4edde962f6b4db8a3590e68fc13efff.png
And now btrfs with zlib compression (btrfs property set /mnt compression zlib):
289b720f178146109ca0f657020d8152.png
And now let's defragment (btrfs fil defrag -rvczlib /mnt) and the result is simply shocking:
20e7fbc9a2d64b0dbfb7ce4fb93b9e19.png
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

2 answer(s)
D
Dmitry, 2017-03-02
@TrueBers

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 /?

C
chupasaurus, 2017-03-02
@chupasaurus

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 question

Ask a Question

731 491 924 answers to any question