• Skip to primary navigation
  • Skip to main content
  • Skip to primary sidebar
  • Skip to footer navigation

The Geek Diary

  • OS
    • Linux
    • CentOS/RHEL
    • VCS
  • Interview Questions
  • Database
    • MariaDB
  • DevOps
    • Docker
    • Shell Scripting
  • Big Data
    • Hadoop
    • Cloudera
    • Hortonworks HDP

How to Re-Balance BTRFS to Free Disk Space

by admin

The Problem

The BTRFS filesystem has filled on the server, and thus some space needs to be freed up on it. There is a re-balancing feature available in btrfs. The primary purpose of the re-balance feature is to spread block groups across all devices so they match constraints defined by the respective profiles and this is done when btrfs need re-balancing to fix issues with chunks being unbalanced.

The Solution

It is common for a btrfs device to fill up due to the fact that it does not re-balance chunks and the filesystem becomes full due to this.

Re-balance the filesystem as shown in the example below

# mount
/dev/sdb on /var/lib/docker type btrfs (rw,relatime,seclabel,space_cache)
# df -h /var/lib/docker
Filesystem Size Used Avail Use% Mounted on
/dev/sdb 12G 852M 9.8G 8% /var/lib/docker
# btrfs bal start /var/lib/docker
Done, had to relocate 4 out of 4 chunks

Output after re-balancing

# df -h /var/lib/docker
Filesystem Size Used Avail Use% Mounted on
/dev/sdb 12G 851M 11G 8% /var/lib/docker

Filed Under: Linux

Some more articles you might also be interested in …

  1. cuyo: command not found
  2. bitwise Command Examples in Linux
  3. csvsql: Generate SQL statements for a CSV file or execute those statements directly on a database
  4. lxterminal: command not found
  5. csvsort: Sorts CSV files
  6. “az storage blob” Command Examples (Manage blob storage containers and objects in Azure)
  7. aws-google-auth: Command-line tool to acquire AWS temporary (STS) credentials using Google Apps as a federated (Single Sign-On) provider
  8. man: command not found
  9. bedtools Command Examples (A swiss-army knife of tools for genomic-analysis tasks)
  10. csvpy: Loads a CSV file into a Python shell

You May Also Like

Primary Sidebar

Recent Posts

  • Vanilla OS 2 Released: A New Era for Linux Enthusiasts
  • mk Command Examples
  • mixxx Command Examples
  • mix Command Examples

© 2025 · The Geek Diary

  • Archives
  • Contact Us
  • Copyright