Setting Quota Limits

Set soft and hard quota limits using the xfs_quota command.

You can set quota limits on inode count and on block usage, effectively limiting the number of files or the amount of disk space that a user, group, or project can create or use.

XFS lets you set a soft limit and a hard limit. The soft limit is used to provide a notification when the quota is exceeded, but to avoid enforcing. A hard limit stops the creation of any more files, or the allocation of any further disk space.

To set limits, you use the specify the xfs_quota with the -x option to enter expert mode. You can then run the limit subcommand to set limits as required.

  • Set quota limits for a user.

    Use the limit subcommand to set soft and hard limits for block and inode usage by an individual user, for example:

    sudo xfs_quota -x -c 'limit bsoft=200m bhard=250m isoft=200 ihard=250 guest' /mnt 

    Note that this command requires that you have mounted the file system with user quotas enabled.

  • Set quota limits for a group.

    To set limits for a group on an XFS file system that you have mounted with group quotas enabled, specify the -g option to limit:

    sudo xfs_quota -x -c 'limit -g bsoft=5g bhard=6g devgrp' /mnt