Linux – Cant enable quotas on XFS file system

centoslinuxquotaredhatxfs

I'm trying to enable quotas on Centos 7

I ran yum install quota

Edited fstab:

/dev/mapper/centos-root /                       xfs     defaults,usrquota,grpquota        0 0
UUID=6c443910-a7e9-4e97-8b51-de9d05407cf6 /boot                   xfs     defaults        0 0
/dev/mapper/centos-swap swap                    swap    defaults        0 0

And rebooted

When I try to create quota files I get an error:

quotacheck -cug /
quotacheck: Mountpoint (or device) / not found or has no quota enabled.
quotacheck: Cannot find filesystem to check or filesystem not mounted with quota option.

Best Answer

The quota system for the XFS file system needs to be enabled and managed in a slightly different manner to how it is/was done with other file systems.

The mount option to enable quota is not quota but one or more of:

  • uquota/uqnoenforce - User quotas
  • gquota/gqnoenforce - Group quotas
  • pquota/pqnoenforce - Project quota

Each mount option can also be specified as <option>noenforce; this will allow usage reporting without actually enforcing any quota limits.

Once enabled quota and usage can be managed and reported with the dedicated xfs_quota tool.