Enable File System Quota On Debian
  • For example we want to apply disk quota on /dev/md5 to each user, say 2000MBytes soft limit & 2500MB/2.5GB hard limit.
  • 1. install **quota package
    • sudo apt-get install quota
  • 2. edit /etc/fstab to enable quota on /dev/md5 file system
    • /dev/md5 /home ext3 defaults,usrquota,grpquota 0 2
  • 3. re-mount /dev/md5
    • sudo mount -o remount /home
  • 4. edit user quota one by one
    • sudo edquota -u tom -f /dev/md5
Disk quotas for user tom (uid 3050):
  Filesystem                   blocks       soft       hard     inodes     soft     hard
  /dev/md5                          0    2000000   2500000          0        0        0

* the above assigns 2000000KB/2GB soft limit and 2500000/2.5GB hard limit to user tom.
  • 5. set grace period to 0seconds
    • sudo edquota -t -f /dev/md5
Grace period before enforcing soft limits for users:
Time units may be: days, hours, minutes, or seconds
  Filesystem             Block grace period     Inode grace period
  /dev/md5                   0seconds               0seconds
  • 6. disable then re-enable the quota to make it work
    • sudo quotaoff -a
    • sduo quotaon -vug /dev/md5
      • on error:see this
        • quotaon: using /home/aquota.user on /dev/md5: Invalid argument
        • quotaon: using /home/aquota.group on /dev/md5: Invalid argument
      • quotacheck -vugm /dev/md5
  • 7. to list the current quota settings
    • repquota -a

Unless otherwise stated, the content of this page is licensed under Creative Commons Attribution-ShareAlike 3.0 License