Index Micro HowTos
index of all micro how-tos System Administration |
|
Wednesday, 07 March 2007 |
| | | | | Disk quotas | | | | | | | | | | | | | | The Linux kernel supports disk quotas if the support for quotas is compiled into it. The kernel configuration option is CONFIG_QUOTA=y. Most distributions include this option in their kernels. There are four steps to enabling quotas on a file system. - Add the usrquota option to the /etc/fstab entry
- Use quotacheck filesystem to create initial quota files
- Use edquota to set quota limits for users/groups
- Enable quotas with quotaon filesystem
Quota files (binary) Two quota files are stored in the root of the file system where they apply. They are: - quota.user (v1) or aquota.user (v2)/li>
- quota.group (v1) or aquota.group (v2)
To set quotas for a user: edquota -u user To set quotas for a many users based on a another user: edquota -p protouser -u user [user] To set quotas for a group: edquota -g group To see a summary report on all quotas repquota -a To disable quotas: quotaoff filesystem To scan/update/repair quota files (unmount file system first): quotacheck -u -g Hard and Soft Limits There are two limits that are enforced in the quota system. The first is a limit on the total amount of space used by all files owned by the user (block limit). The second is a limit on the maximum number of inodes used (file limit). Each limit has a soft (warning level) and hard limit (stop level). If a user exceeds the soft level, they have a grace period (7 days) to correct the problem. When they hit the hard limit, the system will not allocate any more space to them until they remove some files. | | | | | | | | | | | | | | |
|