Managing quota is not so simple, but it’s important to save place when you use multi-user system to avoid abuses.
- Install quota
# apt-get install quota
- Enable quota
To enable quota, we need to give « rights » to quota to manage a filesystem. So we need to add an option when mouting a disk :
# vi /etc/fstab
/dev/sda3 /home ext3 defaults,usrquota 0 0
# reboot
I added usrquota as option to the disk, but we can also define group restriction with grpquota
finally, To apply options, reboot is required (well, easier and I didn’t search another way to apply it)
- Manage quota for user
We want to define quota for user nunix on the disk /dev/sda3, 256MB sounds fine. This command open a temporary file where you can edit values for the user nunix on the filesystem /dev/sda3. The blocks number seems to be the number of kilobyte.
# edquota -u nunix -f /dev/sda3
Disk quotas for user nunix (uid 1001):
Filesystem blocks soft hard inodes soft hard
/dev/sda3 32 256000 384000 9 25600 38400
- Show quotas
When you are a user, you can display your quota using the command quota
$ quota
Disk quotas for user nunix (uid 1001):
Filesystem blocks quota limit grace files quota limit grace
/dev/sda3 32 256000 384000 9 25600 38400
Resources :
- http://www.lea-linux.org/documentations/index.php/Admin-admin_fs-quotas
- http://ubuntuforums.org/showthread.php?t=289571 {jcomments on}