Set user quotas using xfs_quota


The XFS file system supports user, group, and project quotas. It is often useful to implement quotas of for a particular user. To do so you will first need to add “usrquota,grpquota” to your xfs entry in the /etc/fstab file.

Then one can set the user quota as follows:

xfs_quota -x -c 'limit bhard=500m someuser' /somedir/xfsdirectory

This will set a hard block size limit to 500 MegaBytes for someuser on xfs filesystem mounted at /somedir/xfsdirectory.

To get a report on the quotas one can use

xfs_quota -x -c "report"

And to remove a quota from a user, just set their limit to 0:

xfs_quota -x -c 'limit bhard=0 someuser' /somedir/xfsdirectory

XFS on Linux makes it easy to set and manage user quotas.