The software described in this documentation is either in Extended Support or Sustaining Support. See https://www.oracle.com/us/support/library/enterprise-linux-support-policies-069172.pdf for more information.
Oracle recommends that you upgrade the software described by this documentation as soon as possible.
User and group quotas are supported by other file systems, such
as ext4. The XFS file system additionally
allows you to set quotas on individual directory hierarchies in
the file system that are known as managed
trees. Each managed tree is uniquely identified by a
project ID and an optional
project name. Being able to control the
disk usage of a directory hierarchy is useful if you do not
otherwise want to set quota limits for a privileged user (for
example, /var/log) or if many users or groups
have write access to a directory (for example,
/var/tmp).
To define a project and set quota limits on it:
Mount the XFS file system with project quotas enabled:
#
mount -o pquotadevicemountpointFor example, to enable project quotas for the
/myxfsfile system:#
mount -o pquota /dev/vg0/lv0 /myxfsDefine a unique project ID for the directory hierarchy in the
/etc/projectsfile:#
echoproject_ID:mountpoint/directory>> /etc/projectsFor example, to set a project ID of 51 for the directory hierarchy
/myxfs/testdir:#
echo 51:/myxfs/testdir >> /etc/projectsCreate an entry in the
/etc/projidfile that maps a project name to the project ID:#
echoproject_name:project_ID>> /etc/projidFor example, to map the project name
testprojto the project with ID 51:#
echo testproj:51 >> /etc/projidUse the project subcommand of xfs_quota to define a managed tree in the XFS file system for the project:
#
xfs_quota -x -c ’project -sproject_name’mountpointFor example, to define a managed tree in the
/myxfsfile system for the projecttestproj, which corresponds to the directory hierarchy/myxfs/testdir:#
xfs_quota -x -c ’project -s testproj’ /myxfsUse the limit subcommand to set limits on the disk usage of the project:
#
xfs_quota -x -c ’limit -pargumentsproject_name’mountpointFor example, to set a hard limit of 10 GB of disk space for the project
testproj:#
xfs_quota -x -c ’limit -p bhard=10g testproj’ /myxfs
For more information, see the projects(5),
projid(5), and
xfs_quota(8) manual pages.

