• 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

btrfs balance Command Examples in Linux

by admin

The btrfs balance command is a command-line utility in Linux that is used to balance the data in a btrfs file system. btrfs balance is a utility that is included in the btrfs-progs package, which is a collection of tools and libraries for managing btrfs file systems.

Btrfs is a copy-on-write (CoW) file system that is included in the Linux kernel and is known for its advanced features and capabilities, such as snapshotting, incremental backups, and more. One of the key features of btrfs is the ability to balance the data stored on the file system, which refers to the process of distributing the data evenly across all available devices and disks.

The btrfs balance command allows you to perform this process manually, in order to optimize the performance and efficiency of the file system. btrfs balance can be used to balance data across different devices or disks, or to balance data within a single device or disk.

To use btrfs balance, you will need to have the btrfs-progs package installed on your Linux system. btrfs-progs is usually available as a package in the repositories of popular Linux distributions, and you can install it using the package manager for your specific distribution.

btrfs balance Command Examples

1. Show the status of a running or paused balance operation:

# btrfs balance status /path/to/btrfs_filesystem

2. Balance all block groups (slow; rewrites all blocks in filesystem):

# btrfs balance start /path/to/btrfs_filesystem

3. Balance data block groups which are less than 15% utilized, running the operation in the background:

# btrfs balance start --bg -dusage=15 /path/to/btrfs_filesystem

4. Balance a max of 10 metadata chunks with less than 20% utilization and at least 1 chunk on a given device devid (see btrfs filesystem show):

# btrfs balance start -musage=20,limit=10,devid=devid /path/to/btrfs_filesystem

5. Convert data blocks to the raid6 and metadata to raid1c3 (see mkfs.btrfs(8) for profiles):

# btrfs balance start -dconvert=raid6 -mconvert=raid1c3 /path/to/btrfs_filesystem

6. Convert data blocks to raid1, skipping already converted chunks (e.g. after a previous cancelled conversion operation):

# sudo btrfs balance start -dconvert=raid1,soft path/to/btrfs_filesystem

7. Cancel, pause, or resume a running or paused balance operation:

# btrfs balance [cancel|pause|resume] /path/to/btrfs_filesystem

Filed Under: Linux

Some more articles you might also be interested in …

  1. copyq: Clipboard manager with advanced features
  2. lpr: command not found
  3. ledctl: command not found
  4. esptool.py: Bootloader utility for Espressif chips (e.g. ESP8266)
  5. rpcinfo: command not found
  6. qm destroy Command Examples in Linux
  7. hakyl-init Command Examples
  8. upower: command not found
  9. chntpw Command Examples in Linux
  10. apt-file Command Examples in Linux

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