compsize - Online Linux Manual PageSection : 8
Updated : 2017-09-04
Source : btrfs
Note : btrfs

NAMEcompsize − calculate compression ratio of a set of files on btrfs

SYNOPSIScompsize file-or-dir [ file-or-dir ​... ]

DESCRIPTIONcompsize takes a list of files on a btrfs filesystem (recursing directories) and measures used compression types and the effective compression ratio. Besides compression, compsize shows the effect of reflinks (cp --reflink, snapshots, deduplication), and certain types of btrfs waste. The program gives a report similar to:
Processed 90319 files.
Type Perc Disk Usage Uncompressed Referenced
TOTAL 79% 1.4G 1.8G 1.9G
none 100% 1.0G 1.0G 1.0G
lzo 53% 446M 833M 843M
The fields above are: Type  compression algorithm Perc  disk usage/uncompressed (compression ratio) Disk Usage  blocks on the disk; this is what storing these files actually costs you (save for RAID considerations) Uncompressed  uncompressed extents; what you would need without compression − includes deduplication savings and pinned extent waste Referenced  apparent file sizes (sans holes); this is what a traditional filesystem that supports holes and efficient tail packing, or tar -S, would need to store these files Let's see this on an example: a file 128K big is stored as a single extent A which compressed to a single 4K page. It then receives a write of 32K at offset 32K, which also compressed to a single 4K page, stored as extent B. The file now appears as:

         +-------+-------+---------------+
extent A | used | waste | used |

         +-------+-------+---------------+
extent B | used |

                 +-------+
The "waste" inside extent A can't be gotten rid until the whole extent is rewritten (for example by defrag). If compressed, the whole extent needs to be read every time that part of the file is being read, thus the "waste" is still required. In this case, we have: Disk Usage: 8KB, Uncompressed: 160K, Referenced: 128K.

OPTIONS-b/--bytes  Show raw byte counts rather than human-friendly sizes. -x/--one-file-system  Skip files and directories on different file systems.

SIGNALSUSR1  Displays partial data for files processed so far.

CAVEATSRecently written files may show as not taking any space until they're actually allocated and compressed; this happens once they're synced or on natural writeout, typically on the order of 30 seconds. The ioctls used by this program require root. Inline extents are considered to be always unique, even if they share the same bytes on the disk. This program doesn't currently support filesystems above 8TB on 32-bit machines \*- but neither do other btrfs tools.
0
Johanes Gumabo
Data Size   :   8,446 byte
man-compsize.8Build   :   2024-12-05, 20:55   :  
Visitor Screen   :   x
Visitor Counter ( page / site )   :   2 / 182,335
Visitor ID   :     :  
Visitor IP   :   3.145.179.30   :  
Visitor Provider   :   AMAZON-02   :  
Provider Position ( lat x lon )   :   39.962500 x -83.006100   :   x
Provider Accuracy Radius ( km )   :   1000   :  
Provider City   :   Columbus   :  
Provider Province   :   Ohio ,   :   ,
Provider Country   :   United States   :  
Provider Continent   :   North America   :  
Visitor Recorder   :   Version   :  
Visitor Recorder   :   Library   :  
Online Linux Manual Page   :   Version   :   Online Linux Manual Page - Fedora.40 - march=x86-64 - mtune=generic - 24.12.05
Online Linux Manual Page   :   Library   :   lib_c - 24.10.03 - march=x86-64 - mtune=generic - Fedora.40
Online Linux Manual Page   :   Library   :   lib_m - 24.10.03 - march=x86-64 - mtune=generic - Fedora.40
Data Base   :   Version   :   Online Linux Manual Page Database - 24.04.13 - march=x86-64 - mtune=generic - fedora-38
Data Base   :   Library   :   lib_c - 23.02.07 - march=x86-64 - mtune=generic - fedora.36

Very long time ago, I have the best tutor, Wenzel Svojanovsky . If someone knows the email address of Wenzel Svojanovsky , please send an email to johanes_gumabo@yahoo.co.id .
If error, please print screen and send to johanes_gumabo@yahoo.co.id
Under development. Support me via PayPal.

ERROR : Need New Coding :         (rof_escape_sequence|91|compsize.8|96|\*- but neither do other btrfs tools. |machines \*- but neither do other btrfs tools. )