Thursday, December 31, 2009

USER QUOTAS IN REDHAT LINUX

USER QUOTAS

Features:

1. Limits disk usage (blocks or inodes)

2. Tied to file systems (set on a per file system basis)

3. Can be configured for users and groups

Steps to enable quota support:

1. Enable quota support per file system in: /etc/fstab

• defaults,usrquota,grpquota

2. Remount the file system(s)

• mount -o remount /

• use 'mount' to confirm that 'usrquota,grpquota' support are enabled

3. Create quota database files and generate disk usage table

• quotacheck -mcug / - this creates /aquota.user & /aquota.group

• quotacheck -mavug

4. Assign quota policies

• edquota username - set blocks/inodes soft_limits hard_limit

• edquota student1 - sets quotas for user 'student1'

• export EDITOR=nano - to have edquota default to 'nano' editor

5. Check quotas

• quota username

Ex: quota student1

Note: place 'quotacheck -avug' in /etc/cron.*(hourly,daily)

6. Report on usage

• repquota -a - this reports on usage

Note: The blocks are measured in 1K increments. i.e. 20000 blocks is roughly 20MB

No comments:

Post a Comment