Sharing Knowledge | System Admin Articles

Disk Quotas in Linux - Quick HOWTO



Here is the simple quick guide to setup disk quotas in Linux. Please post your comments

 Uses of Disk quotas:

  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

  Add  defaults,usrquota,grpquota in end of the line for the file system you want enable quota

 2. Remount the file system(s)

  a. mount -o remount /

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

 3. Create quota database files and generate disk usage table

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

  b. quotacheck -mavug

 4. Assign quota policies

  a. 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

  a. quota username

     quota student1 

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

6. Report on usage

  a. repquota -a - this reports on usage

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



Labels: Linux, Quick HOWTO

My Profile PhotoAbout the Author

I'm Parthiban, An UNIX System Admin by Profession. I'm Experienced in Linux/Unix System Administration and Scripting. I have done lot of work on the infrastructure Mgmt side in Linux, UNIX and Windows system administration, Hardware, Storage and Data center. I'm blogging since 2008.
Follow Me On Twitter or On Facebook

0 Comments for "Disk Quotas in Linux - Quick HOWTO"

What do you think about this Article? Add your Opinion..!

Back To Top