BTRFS-SPACE-CALCULATOR(1)
π« BTRFS-SPACE-CALCULATOR(1) β btrfs-space-calculator π«
okay bestie, welcome to the btrfs-space-calculator page, from the Btrfs Space Calculator manual. sit down, hydrate, and let's talk about how much space your btrfs filesystem actually gets to use versus how much it justβ¦ can't. π
β¨ NAME β¨
btrfs-space-calculator β calculate usable and wasted space π
πΈ SYNOPSIS πΈ
btrfs-space-calculator [args] sizes
π¦ DESCRIPTION π¦
so the whole vibe of btrfs-space-calculator is: it shows you the amount of allocatable space on btrfs at both the physical and the virtual level, AND it shows you the amount of unallocatable space that happens when you've added differently sized block devices to the same filesystem. like, the math doesn't math, and this tool tells you exactly how much it doesn't math. π
here's the situation. in a btrfs filesystem, raw storage is shared by data of different types (System, MetaData and Data) and profiles (e.g. single, DUP, RAID1). also β and this is the part that gets messy β a filesystem can have multiple block devices of different sizes attached. iconic behavior, honestly. π«Ά
an example, because examples slay:
-$ btrfs-space-calculator -m raid1 -d raid1 2TB 500G 1TB
Target metadata profile: RAID1
Target data profile: RAID1
Mixed block groups: False
Total raw filesystem size: 3.18TiB
Device sizes:
Device 1: 1.82TiB
Device 2: 465.66GiB
Device 3: 931.32GiB
Metadata to data ratio: 1:200
Estimated virtual space to use for metadata: 7.00GiB
Estimated virtual space to use for data: 1.36TiB
Total unallocatable raw amount: 465.66GiB
Unallocatable raw bytes per device:
Device 1: 465.66GiB
Device 2: 0.00B
Device 3: 0.00B
heads up bestie π most physical disk vendors specify their sizes in GB or TB, while partitions created in your average partition table or with lvm2 etcβ¦ are usually using MiB, GiB and TiB. so the numbers you bought are not the numbers you got. no cap.
π OPTIONS π
-h,--helpβ show the built-in help message and exit. the classic "help me please" button β¨-m,--metadata PROFILEβ metadata profile, values like for data profile. yep, same energy as-d. π«-d,--data PROFILEβ data profile:raid0,raid1,raid5,raid6,raid10,duporsingle. pick your fighter π-M,--mixedβ use mixed block groups (data and metadata profile must match). they have to match, bestie, it's giving coordinated outfits or nothing. π-r,--ratio RATIOβ data to metadata ratio, e.g.200(the default), which means allocate 0.5% for metadata. setting this ratio only makes sense for non-mixed filesystems. and when you use this option in combination with-M, it will be ignored β like, straight up not read. π
π SEE ALSO π
this program is an example of what can be done using the python-btrfs library. π
source and documentation on github: https://github.com/knorrie/python-btrfs
and that's the whole page, bestie!! β¨π this one's from 2018, part of the Btrfs Space Calculator manual β go forth and calculate your space, you absolute main character. π¦ππ
π¦ where this page comes from
- debian bookworm: python3-btrfs 13-1 Β· LGPL-3.0-only
- debian trixie: python3-btrfs 15-1 Β· LGPL-3.0-only
- fedora 43: python3-btrfs 15-5.fc43 Β· LGPL-3.0-or-later AND LicenseRef-Callaway-MIT
- fedora 44: python3-btrfs 15-6.fc44 Β· LGPL-3.0-or-later AND LicenseRef-Callaway-MIT
- ubuntu noble: python3-btrfs 13-1 Β· LGPL-3.0-only
- ubuntu resolute: python3-btrfs 15-1 Β· LGPL-3.0-only
- ubuntu stonking: python3-btrfs 15-1 Β· LGPL-3.0-only
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms