The Btrfs (B-tree file system) is an advanced, copy-on-write (CoW) filesystem increasingly popular in modern Linux distributions like Ubuntu Server. One of its powerful enterprise features is Qgroups (Quota Groups), which allows system administrators to enforce strict disk space limits on specific subvolumes or user directories. This ensures that a single runaway process or user cannot consume the entire storage array.
However, Btrfs quotas are notoriously resource-intensive. Because Btrfs utilizes copy-on-write and relies heavily on snapshots, calculating the exact amount of “exclusive” versus “shared” disk space consumed by a quota group requires the filesystem to constantly traverse massive internal data trees. On active servers with thousands of snapshots (e.g., those using tools like Snapper or LXD containers), enabling quotas can bring the system to its knees. Disk I/O operations stall, CPU usage spikes as the kernel attempts to reconcile the tree, and the server becomes utterly unresponsive. To restore performance on snapshot-heavy systems, you must completely disable Btrfs quotas.
Why Disable Btrfs Quotas (Qgroups)?
System administrators generally disable this feature to resolve severe performance degradation:
- Extreme I/O Bottlenecks: On filesystems with complex snapshot hierarchies, dropping a snapshot while quotas are enabled forces a massive recalculation, locking up the disk queue and causing I/O waits to spike near 100%.
- Kernel CPU Spikes: The
btrfs-cleanerandbtrfs-transactionkernel threads will aggressively consume CPU cycles for extended periods trying to balance the quota accounting trees. - LXD/Docker Performance: Containerization platforms that rely on Btrfs subvolumes for instant provisioning suffer massive latency penalties when Qgroups are enforced.
How to Turn Off ‘Btrfs Quotas’ (Qgroups) in Ubuntu Server
You can dynamically disable the quota system on a live mounted filesystem using the native btrfs command-line utility. No reboot is required, and the performance benefits are usually instantaneous.
- Connect to your Ubuntu server via SSH or open the local terminal.
- First, verify the current status of the quota system on your target mount point (e.g., the root filesystem
/). Execute the following command:sudo btrfs qgroup show /
If it returns a table of data, quotas are active. If it returns an error stating quotas are disabled, no further action is required. - To completely disable quotas and destroy the accounting trees, execute the following command against your mount point:
sudo btrfs quota disable / - (Optional) If you have multiple Btrfs arrays or mount points (e.g.,
/mnt/data), you must repeat the command for each specific mount:sudo btrfs quota disable /mnt/data
Disabling the feature instantly kills the background quota calculation threads. You should immediately observe a significant drop in CPU usage and I/O latency, restoring the high-performance throughput expected from a modern Btrfs array.