I recently needed to enable quotas on a larger XFS file system. This is quite easy, because everything you have to do is setting the proper mount options and then mount the file system again. XFS will automatically index all files and update all quota associations while mounting:
Type | enforced | not enforced |
---|---|---|
User quota | uquota | uqnoenforce |
Group quota | gquota | gqnoenforce |
Project quota | pquota | pqnoenforce |
But: Depending on how full the file system is, this update process may take a long time. This means, you should not try this while booting because modern Linux distributions (like RHEL7) will have a timeout detection and may thus interrupt the process.
So when enabling quota on an existing file system:
- edit fstab
- unmount the file system
- mount it again
- wait for the quota log update to finish