Ubuntu – How to list compression ratio on compression enabled btrfs

btrfscompressionfilesystem

I enabled compression on a btrfs volume. Now how do I know the compression ratio of files or directories? Or at least the overall stats?

Best Answer

there is third party tool that can do this.

https://github.com/kilobyte/compsize

usage:

ayush@devbox:/code/compsize$ sudo compsize /opt
Processed 54036 files, 42027 regular extents (42028 refs), 27150 inline.
Type       Perc     Disk Usage   Uncompressed Referenced  
Data        82%      5.3G         6.4G         6.4G       
none       100%      4.3G         4.3G         4.3G       
zlib        37%      427M         1.1G         1.1G       
lzo         56%      588M         1.0G         1.0G