Skip to content

Histogram of how much total space is unused per usage ratio for BTRFS chunks

License

Notifications You must be signed in to change notification settings

Redjard/btrfs-chunk-wastage

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

8 Commits
 
 
 
 
 
 

Repository files navigation

Btrfs Chunk Wastage Histogram

Usage:
btrfs-chunk-wastage.py [path to filesystem]

Btrfs allocates itself (usually) 1 GiB sized chunks of storage space to store files on disk. As files are created, resized, and deleted, those chunks may not get filled one after another, Btrfs may accumulate partially filled chunks.
This can cause some problems, so there are commands to split up partially filled chunks and add them into other partially filled chunks, leaving fewer more filled chunks as a result.
For example btrfs balance start -dusage=30 / will split up all chunks with less than 30% space utilization.
But when typing out such a command, it's hard to know how many chunks will be moved, how much space will be saved. Will usage=30 be enough or should you do usage=60? When do diminishing returns kick in? What sort of runtime can be expected? What is the current state of the file system?

This script will generate a histogram that can answer all those questions.

image

image

The histograms width will attempt to match your terminals width.

About

Histogram of how much total space is unused per usage ratio for BTRFS chunks

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages