2014-04-02 08:29:24 +00:00
|
|
|
btrfs-qgroup(8)
|
|
|
|
===============
|
|
|
|
|
|
|
|
NAME
|
|
|
|
----
|
|
|
|
btrfs-qgroup - control the quota group of a btrfs filesystem
|
|
|
|
|
|
|
|
SYNOPSIS
|
|
|
|
--------
|
2014-05-19 15:49:35 +00:00
|
|
|
*btrfs qgroup* <subcommand> <args>
|
2014-04-02 08:29:24 +00:00
|
|
|
|
|
|
|
DESCRIPTION
|
|
|
|
-----------
|
2015-07-27 15:36:03 +00:00
|
|
|
*btrfs qgroup* is used to control quota group (qgroup) of a btrfs filesystem.
|
2014-04-02 08:29:24 +00:00
|
|
|
|
2015-07-27 15:36:03 +00:00
|
|
|
NOTE: To use qgroup you need to enable quota first using *btrfs quota enable*
|
2014-04-02 08:29:24 +00:00
|
|
|
command.
|
|
|
|
|
|
|
|
WARNING: Qgroup is not stable yet and will impact performance in current mainline
|
2017-12-07 20:26:09 +00:00
|
|
|
kernel (v4.14).
|
2014-04-02 08:29:24 +00:00
|
|
|
|
|
|
|
QGROUP
|
|
|
|
------
|
2015-07-27 15:36:03 +00:00
|
|
|
Quota groups or qgroup in btrfs make a tree hierarchy, the leaf qgroups are
|
|
|
|
attached to subvolumes. The size limits are set per qgroup and apply when any
|
|
|
|
limit is reached in tree that contains a given subvolume.
|
2014-04-02 08:29:24 +00:00
|
|
|
|
2016-03-14 13:10:16 +00:00
|
|
|
The limits are separated between shared and exclusive and reflect the extent
|
2015-07-27 15:36:03 +00:00
|
|
|
ownership. For example a fresh snapshot shares almost all the blocks with the
|
|
|
|
original subvolume, new writes to either subvolume will raise towards the
|
|
|
|
exclusive limit.
|
2014-04-02 08:29:24 +00:00
|
|
|
|
2015-07-27 15:36:03 +00:00
|
|
|
The qgroup identifiers conform to 'level/id' where level 0 is reserved to the
|
|
|
|
qgroups associated with subvolumes. Such qgroups are created automatically.
|
|
|
|
|
|
|
|
The qgroup hierarchy is built by commands *create* and *assign*.
|
2014-04-02 08:29:24 +00:00
|
|
|
|
|
|
|
NOTE: If the qgroup of a subvolume is destroyed, quota about the subvolume
|
|
|
|
will not be functional until qgroup '0/<subvolume id>' is created again.
|
|
|
|
|
|
|
|
SUBCOMMAND
|
|
|
|
----------
|
2015-07-27 14:27:28 +00:00
|
|
|
*assign* [options] <src> <dst> <path>::
|
2014-04-02 08:29:24 +00:00
|
|
|
Assign qgroup <src> as the child qgroup of <dst> in the btrfs filesystem
|
|
|
|
identified by <path>.
|
2015-07-27 14:27:28 +00:00
|
|
|
+
|
|
|
|
`Options`
|
|
|
|
+
|
|
|
|
--rescan::::
|
2018-08-06 06:00:07 +00:00
|
|
|
(default since: 4.19) Automatically schedule quota rescan if the new qgroup
|
2018-08-06 06:00:08 +00:00
|
|
|
assignment would lead to quota inconsistency. See 'QUOTA RESCAN' for more
|
|
|
|
information.
|
2015-07-27 14:27:28 +00:00
|
|
|
--no-rescan::::
|
2018-08-06 06:00:08 +00:00
|
|
|
Explicitly ask not to do a rescan, even if the assignment will make the quotas
|
2018-11-26 16:32:10 +00:00
|
|
|
inconsistent. This may be useful for repeated calls where the rescan would add
|
2018-08-06 06:00:08 +00:00
|
|
|
unnecessary overhead.
|
2014-04-02 08:29:24 +00:00
|
|
|
|
2014-05-19 15:49:35 +00:00
|
|
|
*create* <qgroupid> <path>::
|
2014-04-02 08:29:24 +00:00
|
|
|
Create a subvolume quota group.
|
|
|
|
+
|
|
|
|
For the '0/<subvolume id>' qgroup, a qgroup can be created even before the
|
2017-12-07 20:26:09 +00:00
|
|
|
subvolume is created.
|
2014-04-02 08:29:24 +00:00
|
|
|
|
2014-05-19 15:49:35 +00:00
|
|
|
*destroy* <qgroupid> <path>::
|
2014-04-02 08:29:24 +00:00
|
|
|
Destroy a qgroup.
|
|
|
|
+
|
2017-12-07 20:26:09 +00:00
|
|
|
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.
|
2014-04-02 08:29:24 +00:00
|
|
|
|
2015-01-03 01:19:31 +00:00
|
|
|
*limit* [options] <size>|none [<qgroupid>] <path>::
|
|
|
|
Limit the size of a qgroup to <size> or no limit in the btrfs filesystem
|
|
|
|
identified by <path>.
|
|
|
|
+
|
|
|
|
If <qgroupid> is not given, qgroup of the subvolume identified by <path>
|
|
|
|
is used if possible.
|
2015-01-13 03:53:16 +00:00
|
|
|
+
|
|
|
|
`Options`
|
|
|
|
+
|
|
|
|
-c::::
|
|
|
|
limit amount of data after compression. This is the default, it is currently not
|
|
|
|
possible to turn off this option.
|
|
|
|
+
|
|
|
|
-e::::
|
|
|
|
limit space exclusively assigned to this qgroup.
|
2015-01-03 01:19:31 +00:00
|
|
|
|
|
|
|
*remove* <src> <dst> <path>::
|
|
|
|
Remove the relationship between child qgroup <src> and parent qgroup <dst> in
|
|
|
|
the btrfs filesystem identified by <path>.
|
2018-08-06 06:00:08 +00:00
|
|
|
+
|
|
|
|
`Options`
|
|
|
|
+
|
|
|
|
The same as *assign* subcommand.
|
2015-01-03 01:19:31 +00:00
|
|
|
|
2014-05-19 15:49:35 +00:00
|
|
|
*show* [options] <path>::
|
2014-04-02 08:29:24 +00:00
|
|
|
Show all qgroups in the btrfs filesystem identified by <path>.
|
|
|
|
+
|
|
|
|
`Options`
|
|
|
|
+
|
|
|
|
-p::::
|
|
|
|
print parent qgroup id.
|
|
|
|
-c::::
|
|
|
|
print child qgroup id.
|
|
|
|
-r::::
|
2015-01-27 16:07:40 +00:00
|
|
|
print limit of referenced size of qgroup.
|
2014-04-02 08:29:24 +00:00
|
|
|
-e::::
|
2015-01-27 16:07:40 +00:00
|
|
|
print limit of exclusive size of qgroup.
|
2014-04-02 08:29:24 +00:00
|
|
|
-F::::
|
|
|
|
list all qgroups which impact the given path(include ancestral qgroups)
|
|
|
|
-f::::
|
|
|
|
list all qgroups which impact the given path(exclude ancestral qgroups)
|
2015-01-19 07:18:18 +00:00
|
|
|
--raw::::
|
|
|
|
raw numbers in bytes, without the 'B' suffix.
|
2015-01-21 17:47:24 +00:00
|
|
|
--human-readable::::
|
|
|
|
print human friendly numbers, base 1024, this is the default
|
2015-01-19 07:18:18 +00:00
|
|
|
--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.
|
2014-05-19 15:08:56 +00:00
|
|
|
--sort=[\+/-]<attr>[,[+/-]<attr>]...::::
|
|
|
|
list qgroups in order of <attr>.
|
2014-04-02 08:29:24 +00:00
|
|
|
+
|
2014-05-19 15:08:56 +00:00
|
|
|
<attr> can be one or more of qgroupid,rfer,excl,max_rfer,max_excl.
|
2014-04-02 08:29:24 +00:00
|
|
|
+
|
2014-05-19 15:08:56 +00:00
|
|
|
Prefix \'+' means ascending order and \'-' means descending order of <attr>.
|
2014-04-02 08:29:24 +00:00
|
|
|
If no prefix is given, use ascending order by default.
|
|
|
|
+
|
2014-05-19 15:08:56 +00:00
|
|
|
If multiple <attr>s is given, use comma to separate.
|
2016-12-15 04:29:28 +00:00
|
|
|
+
|
|
|
|
--sync::::
|
|
|
|
To retrieve information after updating the state of qgroups,
|
|
|
|
force sync of the filesystem identified by <path> before getting information.
|
2014-04-02 08:29:24 +00:00
|
|
|
|
2018-08-06 06:00:08 +00:00
|
|
|
QUOTA RESCAN
|
|
|
|
------------
|
|
|
|
The rescan reads all extent sharing metadata and updates the respective qgoups
|
|
|
|
accordingly.
|
|
|
|
|
|
|
|
The information consists of bytes owned exclusively ('excl') or shared/referred
|
|
|
|
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.
|
|
|
|
|
|
|
|
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.
|
|
|
|
|
2014-04-02 08:29:24 +00:00
|
|
|
EXIT STATUS
|
|
|
|
-----------
|
2014-09-19 01:49:59 +00:00
|
|
|
*btrfs qgroup* returns a zero exit status if it succeeds. Non zero is
|
2014-04-02 08:29:24 +00:00
|
|
|
returned in case of failure.
|
|
|
|
|
|
|
|
AVAILABILITY
|
|
|
|
------------
|
2014-05-19 16:04:26 +00:00
|
|
|
*btrfs* is part of btrfs-progs.
|
2014-04-02 08:29:24 +00:00
|
|
|
Please refer to the btrfs wiki http://btrfs.wiki.kernel.org for
|
|
|
|
further details.
|
|
|
|
|
|
|
|
SEE ALSO
|
|
|
|
--------
|
|
|
|
`mkfs.btrfs`(8),
|
|
|
|
`btrfs-subvolume`(8),
|
|
|
|
`btrfs-quota`(8),
|