3.5. GFS2 Quota Management
File-system quotas are used to limit the amount of file system space a user or group can use. A user or group does not have a quota limit until one is set. GFS2 keeps track of the space used by each user and group even when there are no limits in place. GFS2 updates quota information in a transactional way so system crashes do not require quota usages to be reconstructed.
To prevent a performance slowdown, a GFS2 node synchronizes updates to the quota file only periodically. The "fuzzy" quota accounting can allow users or groups to slightly exceed the set limit. To minimize this, GFS2 dynamically reduces the synchronization period as a "hard" quota limit is approached.
Two quota settings are available for each user ID (UID) or group ID (GID): a hard limit and a warn 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 warn limit is usually a value less than the hard limit. The file system will notify the user or group when the warn limit is reached to warn them of the amount of space they are using. A warn limit value of zero means that no limit is enforced.
Limits are set using the gfs2_quota
command. The command only needs to be run on a single node where GFS2 is mounted.
Setting Quotas, Hard Limit
gfs2_quota limit -u User
-l Size
-f MountPoint
gfs2_quota limit -g Group
-l Size
-f MountPoint
Setting Quotas, Warn Limit
gfs2_quota warn -u User
-l Size
-f MountPoint
gfs2_quota warn -g Group
-l Size
-f MountPoint
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.
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 warn limit for group ID 21 to 50 kilobytes on file system /mygfs2
.
gfs2_quota warn -g 21 -l 50 -k -f /mygfs2