User quotas with Ubuntu

This step by step tutorial shows how to install and implement user quotas, to limit disk space available for selected users in a Linux system (tested on Ubuntu, using repositories).To add support for user disk quotas on Ubuntu:

Install quota from repository:
sudo apt-get install quota
Edit, as root, /etc/fstab adding usrquota and grpquota to desired partitions:
/dev/hda3       /home           ext3    defaults,usrquota,grpquota        0       2
Reboot the system.

sudo edquota -u username -f /dev/desiredpartition
Editing the file:
Disk quotas for user username (uid 1050):
  Filesystem                   blocks       soft       hard     inodes     soft     hard
  /dev/hdaN                         0     31457280     31457280          0        0        0
Save that file… now do:
sudo edquota -t -f /dev/hda3
set grace periods to 0 seconds like this:
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/hda3                  0seconds               0seconds
Save, and finally:
quotaoff -a
quotaon /dev/hda3

Leave a Reply

Please log in using one of these methods to post your comment: Logo

You are commenting using your account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s