Skip to content
프로젝트

소개

btrfs에서 파일 하나 또는 여러 파일의 압축 유형과 압축률을 확인합니다.

기타 프로젝트

이 수치를 측정하는 방법

측정된 스타 증가

in 24h
0
in 7 days
0
in 15 days
0
in 1 month
기록 수집 중

서로 겹치는 기간의 순증가량이며 일별 합계가 아닙니다. 측정값이 없으면 비워 둡니다. 스타는 관심도를 나타내며 품질을 보장하지 않습니다.

README.md

Original

compsize

compsize takes a list of files (given as arguments) on a btrfs filesystem and measures used compression types and effective compression ratio, producing a report such as:

[~]$ compsize /home
Processed 140058 files, 133128 regular extents (196786 refs), 80886 inline.
Type       Perc     Disk Usage   Uncompressed Referenced
TOTAL       93%       14G          15G          12G
none       100%       13G          13G          10G
zlib        41%      628M         1.4G         1.4G
zstd        28%       42M         148M         148M

A directory has no extents but has a (recursive) list of files. A non-regular file is silently ignored.

As it makes no sense to talk about compression ratio of a partial extent, every referenced extent is counted whole, exactly once -- no matter if you use only a few bytes of a 1GB extent or reflink it a thousand times. Thus, the uncompressed size will not match the number given by tar or du. On the other hand, the space used should be accurate (although obviously it can be shared with files outside our set).

The fields are:

  • Type: compression algorithm used
  • Perc: disk usage/uncompressed -- ie, effective compression ratio
  • Disk Usage: blocks actually used on the disk
  • Uncompressed: extents before compression
  • Referenced: apparent size of files (minus holes)

The ioctl used requires root.

Installation:

Besides regular C toolchain, you need btrfs userspace headers. On Debian (incl. derivatives like Ubuntu) they're in libbtrfs-dev, SuSE ships them inside libbtrfs-devel, they used to come with btrfs-progs before. Required kernel: 3.16, btrfs-progs: 3.18 (untested!).

관련 프로젝트 살펴보기

불러오는 중…