1BTRFS-QGROUP(8)                  Btrfs Manual                  BTRFS-QGROUP(8)
2
3
4

NAME

6       btrfs-qgroup - control the quota group of a btrfs filesystem
7

SYNOPSIS

9       btrfs qgroup <subcommand> <args>
10

DESCRIPTION

12       btrfs qgroup is used to control quota group (qgroup) of a btrfs
13       filesystem.
14
15           Note
16           To use qgroup you need to enable quota first using btrfs quota
17           enable command.
18
19           Warning
20           Qgroup is not stable yet and will impact performance in current
21           mainline kernel (v4.14).
22

QGROUP

24       Quota groups or qgroup in btrfs make a tree hierarchy, the leaf qgroups
25       are attached to subvolumes. The size limits are set per qgroup and
26       apply when any limit is reached in tree that contains a given
27       subvolume.
28
29       The limits are separated between shared and exclusive and reflect the
30       extent ownership. For example a fresh snapshot shares almost all the
31       blocks with the original subvolume, new writes to either subvolume will
32       raise towards the exclusive limit.
33
34       The qgroup identifiers conform to level/id where level 0 is reserved to
35       the qgroups associated with subvolumes. Such qgroups are created
36       automatically.
37
38       The qgroup hierarchy is built by commands create and assign.
39
40           Note
41           If the qgroup of a subvolume is destroyed, quota about the
42           subvolume will not be functional until qgroup 0/<subvolume id> is
43           created again.
44

SUBCOMMAND

46       assign [options] <src> <dst> <path>
47           Assign qgroup <src> as the child qgroup of <dst> in the btrfs
48           filesystem identified by <path>.
49
50           Options
51
52           --rescan
53               (default since: 4.19) Automatically schedule quota rescan if
54               the new qgroup assignment would lead to quota inconsistency.
55               See QUOTA RESCAN for more information.
56
57           --no-rescan
58               Explicitly ask not to do a rescan, even if the assignment will
59               make the quotas inconsistent. This may be useful for repeated
60               calls where the rescan would add unnecessary overhead.
61
62       create <qgroupid> <path>
63           Create a subvolume quota group.
64
65           For the 0/<subvolume id> qgroup, a qgroup can be created even
66           before the subvolume is created.
67
68       destroy <qgroupid> <path>
69           Destroy a qgroup.
70
71           If a qgroup is not isolated, meaning it is a parent or child
72           qgroup, then it can only be destroyed after the relationship is
73           removed.
74
75       limit [options] <size>|none [<qgroupid>] <path>
76           Limit the size of a qgroup to <size> or no limit in the btrfs
77           filesystem identified by <path>.
78
79           If <qgroupid> is not given, qgroup of the subvolume identified by
80           <path> is used if possible.
81
82           Options
83
84           -c
85               limit amount of data after compression. This is the default, it
86               is currently not possible to turn off this option.
87
88           -e
89               limit space exclusively assigned to this qgroup.
90
91       remove <src> <dst> <path>
92           Remove the relationship between child qgroup <src> and parent
93           qgroup <dst> in the btrfs filesystem identified by <path>.
94
95           Options
96
97           The same as assign subcommand.
98
99       show [options] <path>
100           Show all qgroups in the btrfs filesystem identified by <path>.
101
102           Options
103
104           -p
105               print parent qgroup id.
106
107           -c
108               print child qgroup id.
109
110           -r
111               print limit of referenced size of qgroup.
112
113           -e
114               print limit of exclusive size of qgroup.
115
116           -F
117               list all qgroups which impact the given path(include ancestral
118               qgroups)
119
120           -f
121               list all qgroups which impact the given path(exclude ancestral
122               qgroups)
123
124           --raw
125               raw numbers in bytes, without the B suffix.
126
127           --human-readable
128               print human friendly numbers, base 1024, this is the default
129
130           --iec
131               select the 1024 base for the following options, according to
132               the IEC standard.
133
134           --si
135               select the 1000 base for the following options, according to
136               the SI standard.
137
138           --kbytes
139               show sizes in KiB, or kB with --si.
140
141           --mbytes
142               show sizes in MiB, or MB with --si.
143
144           --gbytes
145               show sizes in GiB, or GB with --si.
146
147           --tbytes
148               show sizes in TiB, or TB with --si.
149
150           --sort=[+/-]<attr>[,[+/-]<attr>]...
151               list qgroups in order of <attr>.
152
153               <attr> can be one or more of
154               qgroupid,rfer,excl,max_rfer,max_excl.
155
156               Prefix '+' means ascending order and '-' means descending order
157               of <attr>. If no prefix is given, use ascending order by
158               default.
159
160               If multiple <attr>s is given, use comma to separate.
161
162           --sync
163               To retrieve information after updating the state of qgroups,
164               force sync of the filesystem identified by <path> before
165               getting information.
166

QUOTA RESCAN

168       The rescan reads all extent sharing metadata and updates the respective
169       qgoups accordingly.
170
171       The information consists of bytes owned exclusively (excl) or
172       shared/referred to (rfer). There’s no explicit information about which
173       extents are shared or owned exclusively. This means when qgroup
174       relationship changes, extent owners change and qgroup numbers are no
175       longer consistent unless we do a full rescan.
176
177       However there are cases where we can avoid a full rescan, if a
178       subvolume whose rfer number equals its excl number, which means all
179       bytes are exclusively owned, then assigning/removing this subvolume
180       only needs to add/subtract rfer number from its parent qgroup. This can
181       speed up the rescan.
182

EXIT STATUS

184       btrfs qgroup returns a zero exit status if it succeeds. Non zero is
185       returned in case of failure.
186

AVAILABILITY

188       btrfs is part of btrfs-progs. Please refer to the btrfs wiki
189       http://btrfs.wiki.kernel.org for further details.
190

SEE ALSO

192       mkfs.btrfs(8), btrfs-subvolume(8), btrfs-quota(8),
193
194
195
196Btrfs v5.1                        05/17/2019                   BTRFS-QGROUP(8)
Impressum