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?
Btrfs supports transparent file compression. There are three algorithms available: ZLIB, LZO and ZSTD(since v4. 14).
To enable Btrfs filesystem-level compression, you have to mount the Btrfs filesystem you have created on the sdb1 partition with either the compress or compress-force mount option. i) compress mount option: The compress mount option will simply enable Btrfs filesystem-level compression.
Advantages of Btrfs over Ext4:Btrfs removes duplicate data from disk directly while Ext4 cannot do that, Btrfs support CoW so users can create writable and read-only snapshots of files. Ext4 lacks this feature. Btrfs Can handle more data than Ext4.
The Btrfs filesystem is a modern Copy-on-Write (CoW) filesystem that supports deduplication. If you need to keep a lot of redundant data (i.e., file backups, database) on your computer, then the Copy-on-Write (CoW) and deduplication feature of the Btrfs filesystem can save a huge amount of disk spaces.
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
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With