Quotas

This page describes how to set, maintain, and manage user and group quotas on a Linux system.

Concepts
There are 3 important concepts with quotas in Linux.


 * softlimit
 * hardlimit
 * grace

These concepts can be applied to blocks and inodes. blocks are portions of space on the hard drive, usually (almost always) 1024 bytes. inodes are pointers to files, one inode per file. Therefore, the block limit limits the space of the user/group, and the inode limit limits the number of files the user/group is allowed to store.

The hardlimit may never be exceeded; the kernel will intervene. The softlimit may be exceeded, but once it is, a grace period countdown begins. Once the grace period is over, the softlimit becomes a hardlimit, and no new data/files can be written. The user can only release their account by deleting data or files until they are below the softlimit, at which point the grace period is reset and the user account is unlocked.

Each quota configuration will consist of 8 pieces of info:

* block-softlimit, block-hardlimit, inode-softlimit, inode-hardlimit, blockgrace, inodegrace, user, partition

Any of the numerical settings may be set to 0, meaning "unlimited"

Example
Let us use an example for illustration.

User reaper has 5 files on the /home partition. The user's inode softlimit is 10, hardlimit is 20, and grace is 1 day. The user places 7 more files on the partition--making a total of 12--and exceeds the softlimit. This will cause the grace period to begin expiring, or counting down. The user attempts to place an additional 10 files on the partition, however, after adding 8, hits the hardlimit. At the hardlimit, the kernel prevents the user from writing any more files. During this time, the grace period has been reduced, and this can be observed with the quota tool. After the grace time has expired, no files are deleted, but the user cannot add any more files until they have reduced the number of files to the softlimit or less, thus resetting the grace period timer.

Users
Users can check their own quotas using the quota tool.

This shows the current user's quotas on mounted filesystems

This shows the current user's group quotas. It will show quotas for each group the user is in.

This shows the current user's quotas, their group quotas, and presents it in easy-to-read units (M and K and whatnot)

Administrators
This allows the super-user to see quotas of any user, the example being reaper, here.