Is it possible to get the compressed and uncompressed sizes of a file on a btrfs file system?

gandalf3 picture gandalf3 · Oct 20, 2013 · Viewed 15.6k times · Source

Is it possible to determine what the compressed size (I assume that is what is listed by ls -l) and uncompressed size of files on a btrfs filesystem with transparent compression enabled?

Answer

Ayush picture Ayush · Nov 12, 2017

there is a 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