BTRFS-SPACE-CALCULATOR(1)

πŸ“¦
version 15 Β· 2 versions
  • 15 Β· debian bookworm, debian trixie, fedora 43, fedora 44, ubuntu noble, ubuntu resolute, ubuntu stonking (latest)
  • 12 Β· ubuntu jammy
, in debian bookworm, debian trixie, fedora 43, fedora 44, ubuntu noble, ubuntu resolute, ubuntu stonking

πŸ’« 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, dup or single. 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