BTRFS-QGROUP(8)
π NAME π
okay so we're doing btrfs-qgroup β the manual page for the command that controls the quota group of a btrfs filesystem. yes, quota group. we call it qgroup around here, everybody does, it's fine π
β¨ SYNOPSIS β¨
btrfs qgroup <subcommand> <args>
π¦ DESCRIPTION π¦
btrfs qgroup is the tool for controlling the quota group (qgroup) of a btrfs filesystem. that's the whole job. that's the vibe.
Note, bestie: to use qgroup you need to enable quota first using thebtrfs quota enablecommand, go peek atbtrfs-quota(8)for that. no quota enabled means no qgroup anything. π
π QGROUP π
Quota groups β qgroups β in btrfs make a tree hierarchy, and the leaf qgroups are attached to subvolumes. The size limits are set per qgroup and they apply when any limit is reached in the tree that contains a given subvolume.
The limits are separated between shared and exclusive, and they reflect the extent ownership. so like, a fresh snapshot shares almost all the blocks with the original subvolume, and new writes to either subvolume will raise towards the exclusive limit. Extent sharing is also a result of reflink or deduplication. shared is shared, no way around it π«Ά
Note: qgroup limit only works when the qgroup is in a consistent state. If some workload marks qgroup inconsistent (like assigning a qgroup to another qgroup), the limit will no longer work until the inconsistent flag is cleared by btrfs quota rescan. that's the rule. periodt.
The qgroup identifiers conform to level/id where level 0 is reserved to the qgroups associated with subvolumes. Such qgroups are created automatically β you don't lift a finger, they just exist. iconic behavior honestly β¨
The qgroup hierarchy is built by the commands btrfs qgroup create and btrfs qgroup assign.
Note: if the qgroup of a subvolume is destroyed, quota related to the subvolume will not be functional until qgroup 0/<subvolume id> is created again. so don't be shocked when it ghosts you, just recreate it.
πΈ SUBCOMMAND πΈ
assign
assign [options] <src> <dst> <path>
Assign qgroup src as the child qgroup of dst in the btrfs filesystem identified by path. making the family tree grow π§
Options
--rescanβ (default since: 4.19) Automatically schedule quota rescan if the new qgroup assignment would lead to quota inconsistency. See QUOTA RESCAN for more information.--no-rescanβ Explicitly ask not to do a rescan, even if the assignment will make the quotas inconsistent. This may be useful for repeated calls where the rescan would add unnecessary overhead. lowkey the move if you're batching.
create
create <qgroupid> <path>
Create a subvolume quota group. new baby qgroup, slay π
For the 0/<subvolume id> qgroup, a qgroup can be created even before the subvolume is created. manifesting, essentially.
destroy
destroy <qgroupid> <path>
Destroy a qgroup. rip to that one π
If a qgroup is not isolated, meaning it is a parent or child qgroup, then it can only be destroyed after the relationship is removed. you can't just delete a qgroup that still has family, bestie, that's not how this works.
clear-stale
clear-stale <path>
Clear all stale qgroups whose subvolume does not exist anymore β this is the level 0 qgroup like 0/subvolid. Higher level qgroups are not deleted even if they don't have any child qgroups, as they are always created by the user and their deletion should be verified first. π
we do not touch user-created things without asking.
limit
limit [options] <size>|none [<qgroupid>] <path>
Limit the size of a qgroup to size or no limit (none) in the btrfs filesystem identified by path.
If qgroupid is not given, the qgroup of the subvolume identified by path is used if possible.
Options
-cβ limit amount of data after compression. This is the default, it is currently not possible to turn off this option. so yeah, it's-cforever, no notes.-eβ limit space exclusively assigned to this qgroup.
remove
remove <src> <dst> <path>
Remove the relationship between child qgroup src and parent qgroup dst in the btrfs filesystem identified by path. it's giving family therapy π
Options
--rescanβ (default since: 4.19) Automatically schedule quota rescan if the removed qgroup relation would lead to quota inconsistency. See QUOTA RESCAN for more information.--no-rescanβ Explicitly ask not to do a rescan, even if the removal will make the quotas inconsistent. This may be useful for repeated calls where the rescan would add unnecessary overhead.
show
show [options] <path>
Show all qgroups in the btrfs filesystem identified by path. the receipts, basically.
Options
-pβ print parent qgroup id.-cβ print child qgroup id.-rβ print limit of referenced size of qgroup.-eβ print limit of exclusive size of qgroup.-Fβ list all qgroups which impact the given path (include ancestral qgroups)-fβ list all qgroups which impact the given path (exclude ancestral qgroups)--rawβ raw numbers in bytes, without theBsuffix.--human-readableβ print human friendly numbers, base 1024, this is the default.--iecβ select the 1024 base for the following options, according to the IEC standard.--siβ select the 1000 base for the following options, according to the SI standard.--kbytesβ show sizes in KiB, or kB with--si.--mbytesβ show sizes in MiB, or MB with--si.--gbytesβ show sizes in GiB, or GB with--si.--tbytesβ show sizes in TiB, or TB with--si.--sort=[+/-]<attr>[,[+/-]<attr>]...β list qgroups in order of attr.
attr can be one or more of qgroupid,rfer,excl,max_rfer,max_excl.
Prefix + means ascending order and - means descending order of attr. If no prefix is given, use ascending order by default.
If multiple attr values are given, use comma to separate.
--syncβ To retrieve information after updating the state of qgroups, force sync of the filesystem identified by path before getting information.
π SPECIAL PATHS π
For the btrfs qgroup show command, the path column can print special values:
<toplevel>β The toplevel subvolume.<under deletion>β The subvolume has been deleted (its directory removed), but the subvolume metadata not yet fully cleaned.<squota space holder>β For simple quota mode only. By its design, a fully deleted subvolume may still have accounting on it, so even if the subvolume is gone, the numbers are still here for future accounting. it's haunting the place a little bit ngl π»<stale>β The qgroup has no corresponding subvolume anymore, and the qgroup can be cleaned up under most cases. The only exception is that, if the qgroup numbers are inconsistent and the qgroup numbers are not all zeros, some older kernels may refuse to delete such qgroups until a full rescan.
π₯ QUOTA RESCAN π₯
The rescan reads all extent sharing metadata and updates the respective qgroups accordingly. big cleanup energy.
The information consists of bytes owned exclusively (excl) or shared/referenced to (rfer). There's no explicit information about which extents are shared or owned exclusively. This means when qgroup relationship changes, extent owners change and qgroup numbers are no longer consistent unless we do a full rescan. so if the numbers look unhinged, that's why.
However there are cases where we can avoid a full rescan: if a subvolume whose rfer number equals its excl number, which means all bytes are exclusively owned, then assigning/removing this subvolume only needs to add/subtract rfer number from its parent qgroup. This can speed up the rescan. shortcuts, we love them π
π EXAMPLES π
Make a parent group that has two quota group children
Given the following filesystem mounted at /mnt/my-vault
Label: none uuid: 60d2ab3b-941a-4f22-8d1a-315f329797b2
Total devices 1 FS bytes used 128.00KiB
devid 1 size 5.00GiB used 536.00MiB path /dev/vdb
Enable quota and create subvolumes. Check subvolume ids.
$ cd /mnt/my-vault
$ btrfs quota enable .
$ btrfs subvolume create a
$ btrfs subvolume create b
$ btrfs subvolume list .
ID 261 gen 61 top level 5 path a
ID 262 gen 62 top level 5 path b
Create qgroup and set limit to 10MiB.
$ btrfs qgroup create 1/100 .
$ btrfs qgroup limit 10M 1/100 .
$ btrfs qgroup assign 0/261 1/100 .
$ btrfs qgroup assign 0/262 1/100 .
And check qgroups.
$ btrfs qgroup show .
qgroupid rfer excl
-------- ---- ----
0/5 16.00KiB 16.00KiB
0/261 16.00KiB 16.00KiB
0/262 16.00KiB 16.00KiB
1/100 32.00KiB 32.00KiB
β EXIT STATUS β
btrfs qgroup returns a zero exit status if it succeeds. Non zero is returned in case of failure. zero = ate, non-zero = not ate, simple as. π
π«Ά AVAILABILITY π«Ά
btrfs is part of btrfs-progs. Please refer to the documentation at <https://btrfs.readthedocs.io>.
π SEE ALSO π
btrfs-quota(8), btrfs-subvolume(8), mkfs.btrfs(8)
and that's the whole page, bestie π this was btrfs-progs version 7.3, dated Oct 24, 2026 β go forth and qgroup responsibly, ily π¦π
π¦ where this page comes from
- arch rolling: btrfs-progs 7.3-1 Β· GPL-2.0-only
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms