Managing disk quotas in Linux

Table of Contents

1. Setting quotas

Linux enables you to limit the amount of space that a user or group can consume on a given partition. To do this, you use the quotaon, quotaoff, and edquota commands.

You can configure a quota that includes the following properties for each user or group:

  • soft limit
  • grace period
  • hard limit
soft limit
A soft limit is the initial maximum disk space a user or group is granted on a particular partition. When this limit is reached, the user or group members can still exceed the limit for a specified period of time, but will receive warning reminders.
grace period
The grace period is the amount of time during which a user can exceed the soft limit specified in a quota. Its default value is seven days, but you can alter this value.
hard limit
A hard limit is an absolute limit on disk usage. Once users or groups reach this limit, they can no longer create new files, even if they are still in a specified grace period for a soft limit.

You can edit quotas, and set hard and soft limits for users or groups, using the edquota command.

Hard and soft limits can have one of three values:

  • 0 indicates that there are no space limits
  • -1 instructs edquota to use default values
  • a number greater than 0 specifying the limit, expressed in kilobytes

You can use the following options with the edquota command:

  • -u username
  • -g groupname
  • -p username
  • -t
-u username
The -u username option enables you to change a user’s quota limits.
-g groupname
The -g groupname option enables you to change a group’s quota limits.
-p username
The -p username option enables you to set quotas for many different users in one step, by copying one user’s quota information to other users.

Leave a Reply

Your email address will not be published. Required fields are marked *