Giter Club home page Giter Club logo

compsize's Introduction

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 /usr/share
Processed 120101 files.
Type       Perc     Disk Usage   Uncompressed
Data        58%      1.1G         1.9G
none       100%      351M         351M
zlib        29%       41M         137M
lzo         51%      776M         1.4G

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:

  • 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, usually installed as part of btrfs-progs. Required kernel: 3.16, btrfs-progs: 3.18 (untested!).

compsize's People

Contributors

kilobyte avatar nefelim4ag avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.