Quota- Linux User Quota HowTo
From Free Knowledge Base- The DUCK Project: information for everyone
REDHAT _ _ _ _ _ _ _ _ _ _ _ _ ___ _ _ _ ___ __ | | |_ _| \ | | | | \ \/ / | | | || \| | | | |\ / | |___ | || |\ | |_| |/ \ |_____|___|_| \_|\___//_/\_\ USER QUOTA HOWTO Verifiably applicable to Redhat 7.2 - 9.0 and reasonably applicable to any Linux distribution. ___________________________________________________________ Created Sept 2003 v2.0
section A: Ten Steps to User Quotas
1). Do you need to patch your kernel?
- if you are using a recent version of RH with the RH supplied kernel, then no.
2). Do you need to install quota?
- if you are using a recent version of RH with quota installed, then no. The most recent version of quota as of this writing is quota 3.06 - 9.
3.) Modify /etc/fstab and add support for quota on the file system(s) you intend to regulate. Hopefully, when you installed linux you allocated partitions appropriately to benefit the most from user quota implementation.
example: Adding quota to a mail server, the path /var/spool/mail is a seperate partition. In fstab it looked like this prior to modification:
LABEL=/var/spool/mail /var/spool/mail ext3 defaults 1 2
To enable user quota support on a file system, add "usrquota" to the 4th field containing the word "defaults"
LABEL=/var/spool/mail /var/spool/mail ext3 defaults,userquota 1 2
Replace "usrquota" with "grpquota", should you need group quota support on a file system.
4.) Since you modified fstab, reboot the computer.
5.) create the necessary files on the partition where you enabled quota. Create the files 'aquota.group' and 'aquota.user'. Activate the quota database.
example: 'touch /var/spool/mail/aquota.user' 'touch touch /var/spool/mail/aquota.group' 'chmod /var/spool/mail/aquota.* 600' 'quotacheck /var/spool/mail'
6.) Create a cron job to update the quota database. Quota automatically should work with periodical checks, it sometimes helps to run quotacheck periodically.
example: 0 3 * * 0 /sbin/quotacheck -avug