March 8, 2009

How to: Configure disk quotas on CentOS 5

Quota is installed by default.

To check if quota is enabled in the kernel, run this command:

# grep CONFIG_QUOTA /boot/config-`uname -r`

if quota is enabled, then the result is

CONFIG_QUOTA=y
CONFIG_QUOTACTL=y

To check if quota is installed

# rpm -q quota

To configure quota to user1 on /home having 80000M for soft and 100000M for hard

  1. Add usrquota and grpquota to the home directory in fstab
    # vi /etc/fstab
  2. Add the following line:
    /dev/hda10 /home      ext3 defaults,usrquota,qrpquota 1 2
  3. Reboot the system or run this command
    # mount -o remount /home
  4. Create quota files
    # quotacheck -cugm /home
  5. Set disk quotas for user1
    # edquota -u user1
  6. Under the soft and hard columns, change the 0 to 80000 and 100000, respectively.

To set the grace period

# edquota -t

To display quotas

# repquota -a
RHCE Red Hat Certified Engineer Linux Study Guide (Exam RH302) (Certification Press)

Spread the word

del.icio.us Digg Furl Reddit Help

Permalink • Print

Related Entries

Made with WordPress and an easy to use WordPress theme • Sky Gold skin by Denis de Bernardy