Have you ever encountered a situation where your children who are using your PC are hoarding music and video on the harddisk and filling up all the space ? In linux, there is a way for you to prohibit others from hogging all the disk space. This you do by using quotas. Here I will explain how to setup disk quotas in Linux.
Step 1. First mount the partition with quota file system
In my example I mount “/dev/sdb1” mount on “/home” with usrquota.
Step 2. Update this information in “/etc/fstab”
Step 3. Check aquota.user file created in the “/home” directory.
Step 4. Create a user and locate home directory in quota enabled partition “/home”
Check all the information of quota on /home directory with “repquota –s /home”
Step 5. Now apply quota for user “eric”
In my example I set 5MB space for user “eric”
Blocks : The amount of space in 1k blocks the user is currently using
inodes : The number of files the user is currently using.
Soft Limit : The maximum blocks/inodes a quota user may have on a partition. The role of a soft limit changes if grace periods are used. When this occurs, the user is only warned that their soft limit has been exceeded. When the grace period expires, the user is barred from using additional disk space or files. When set to zero, limits are disabled.
Hard Limit : The maximum blocks/inodes a quota user may have on a partition when a grace period is set. Users may exceed a soft limit, but they can never exceed their hard limit.
Check the information update in “repquota”
Step 6. Check quota is working or not.
In my example I login with eric user and create two files “test” and “test1” with approx 4Mb each.
As we know we set quota for eric is 5Mb so 1st file created successfully but in 2nd file quota limit reached from 5Mb so it’s print error.
In case of size (block)
To set grace time for user.
[root@feenixdv data]# edquota -t
To send notification about quota limit exceed, quota crash etc.
[root@feenixdv data]# vi /etc/warnquota.conf
· Set mailing list.