Appendix A. GFS2 Quota Management with the gfs2_quota Command
As of the Red Hat Enterprise Linux 6.1 release, GFS2 supports the standard Linux quota facilities. In order to use this you will need to install the quota RPM. This is the preferred way to administer quotas on GFS2 and should be used for all new deployments of GFS2 using quotas. For information on using the standard Linux quota facilities, see Section 4.5, “GFS2 Quota Management”.
For earlier releases of Red Hat Enterprise Linux, GFS2 required the
gfs2_quota
command to manage quotas. This appendix documents the use of the gfs2_quota
command for managing GFS2 file system quotas.
A.1. Setting Quotas with the gfs2_quota
command
Two quota settings are available for each user ID (UID) or group ID (GID): a hard limit and a soft limit.
A hard limit is the amount of space that can be used. The file system will not let the user or group use more than that amount of disk space. A hard limit value of zero means that no limit is enforced.
A soft limit is usually a value less than the hard limit. The file system will notify the user or group when the soft limit is reached to warn them of the amount of space they are using. A soft limit value of zero means that no limit is enforced.
You can set limits using the
gfs2_quota
command. The command only needs to be run on a single node where GFS2 is mounted.
By default, quota enforcement is not set on GFS2 file systems. To enable quota accounting, use the
quota=
of the mount
command when mounting the GFS2 file system, as described in Section A.4, “Enabling/Disabling Quota Enforcement”.
Usage
Setting Quotas, Hard Limit
gfs2_quota limit -uUser
-lSize
-fMountPoint
gfs2_quota limit -gGroup
-lSize
-fMountPoint
Setting Quotas, Warn Limit
gfs2_quota warn -uUser
-lSize
-fMountPoint
gfs2_quota warn -gGroup
-lSize
-fMountPoint
User
- A user ID to limit or warn. It can be either a user name from the password file or the UID number.
Group
- A group ID to limit or warn. It can be either a group name from the group file or the GID number.
Size
- Specifies the new value to limit or warn. By default, the value is in units of megabytes. The additional
-k
,-s
and-b
flags change the units to kilobytes, sectors, and file system blocks, respectively. MountPoint
- Specifies the GFS2 file system to which the actions apply.
Examples
This example sets the hard limit for user Bert to 1024 megabytes (1 gigabyte) on file system
/mygfs2
.
# gfs2_quota limit -u Bert -l 1024 -f /mygfs2
This example sets the soft limit for group ID 21 to 50 kilobytes on file system
/mygfs2
.
# gfs2_quota warn -g 21 -l 50 -k -f /mygfs2