btrfs-progs: qgroup assign: add option to schedule rescan
[platform/upstream/btrfs-progs.git] / Documentation / btrfs-qgroup.asciidoc
1 btrfs-qgroup(8)
2 ===============
3
4 NAME
5 ----
6 btrfs-qgroup - control the quota group of a btrfs filesystem
7
8 SYNOPSIS
9 --------
10 *btrfs qgroup* <subcommand> <args>
11
12 DESCRIPTION
13 -----------
14 *btrfs qgroup* is used to control quota group(qgroup) of a btrfs filesystem.
15
16 NOTE: To use qgroup, it needs to enable quota first using *btrfs quota*
17 command.
18
19 WARNING: Qgroup is not stable yet and will impact performance in current mainline
20 kernel(v3.14 so far).
21
22 QGROUP
23 ------
24 Quota group or qgroup in btrfs has its hierarchy like subvolume.
25 One subvolume/snapshot can reach its quota limits if it consumes all the quota
26 assigned to it or any of the parent qgroup(s).
27
28 Also for snapshot, it consumes no quota initially since all its data
29 shares with its parent, so only modification in snapshot consumes quota.
30
31 Every subvolume/snapshot will have its own qgroup with id '0/<subvolume id>'
32 upon creating, but can be later destroyed by *btrfs qgroup destroy* command.
33
34 NOTE: If the qgroup of a subvolume is destroyed, quota about the subvolume
35 will not be functional until qgroup '0/<subvolume id>' is created again.
36
37 SUBCOMMAND
38 ----------
39 *assign* [options] <src> <dst> <path>::
40 Assign qgroup <src> as the child qgroup of <dst> in the btrfs filesystem
41 identified by <path>.
42 +
43 `Options`
44 +
45 --rescan::::
46 Automatically schedule quota rescan if the new qgroup assignment leads to
47 quota inconsistency.
48 --no-rescan::::
49 Explicitly ask not to do a rescan.
50
51 *create* <qgroupid> <path>::
52 Create a subvolume quota group.
53 +
54 For the '0/<subvolume id>' qgroup, a qgroup can be created even before the
55 subvolume created.
56
57 *destroy* <qgroupid> <path>::
58 Destroy a qgroup.
59 +
60 If a qgroup is no isolated,which means it is a parent or child qgroup, it
61 can't be destroyed.
62
63 *limit* [options] <size>|none [<qgroupid>] <path>::
64 Limit the size of a qgroup to <size> or no limit in the btrfs filesystem
65 identified by <path>.
66 +
67 If <qgroupid> is not given, qgroup of the subvolume identified by <path>
68 is used if possible.
69 +
70 `Options`
71 +
72 -c::::
73 limit amount of data after compression. This is the default, it is currently not
74 possible to turn off this option.
75 +
76 -e::::
77 limit space exclusively assigned to this qgroup.
78
79 *remove* <src> <dst> <path>::
80 Remove the relationship between child qgroup <src> and parent qgroup <dst> in
81 the btrfs filesystem identified by <path>.
82
83 *show* [options] <path>::
84 Show all qgroups in the btrfs filesystem identified by <path>.
85 +
86 `Options`
87 +
88 -p::::
89 print parent qgroup id.
90 -c::::
91 print child qgroup id.
92 -r::::
93 print limit of referenced size of qgroup.
94 -e::::
95 print limit of exclusive size of qgroup.
96 -F::::
97 list all qgroups which impact the given path(include ancestral qgroups)
98 -f::::
99 list all qgroups which impact the given path(exclude ancestral qgroups)
100 --raw::::
101 raw numbers in bytes, without the 'B' suffix.
102 --human-readable::::
103 print human friendly numbers, base 1024, this is the default
104 --iec::::
105 select the 1024 base for the following options, according to the IEC standard.
106 --si::::
107 select the 1000 base for the following options, according to the SI standard.
108 --kbytes::::
109 show sizes in KiB, or kB with --si.
110 --mbytes::::
111 show sizes in MiB, or MB with --si.
112 --gbytes::::
113 show sizes in GiB, or GB with --si.
114 --tbytes::::
115 show sizes in TiB, or TB with --si.
116 --sort=[\+/-]<attr>[,[+/-]<attr>]...::::
117 list qgroups in order of <attr>.
118 +
119 <attr> can be one or more of qgroupid,rfer,excl,max_rfer,max_excl.
120 +
121 Prefix \'+' means ascending order and \'-' means descending order of <attr>.
122 If no prefix is given, use ascending order by default.
123 +
124 If multiple <attr>s is given, use comma to separate.
125
126 EXIT STATUS
127 -----------
128 *btrfs qgroup* returns a zero exit status if it succeeds. Non zero is
129 returned in case of failure.
130
131 AVAILABILITY
132 ------------
133 *btrfs* is part of btrfs-progs.
134 Please refer to the btrfs wiki http://btrfs.wiki.kernel.org for
135 further details.
136
137 SEE ALSO
138 --------
139 `mkfs.btrfs`(8),
140 `btrfs-subvolume`(8),
141 `btrfs-quota`(8),