Quotas are used to enforce a disk space limit or an inode maximum on individual user or group. Setting a quota limit to a disk eliminates system inaccessibility. There are cases; when a disk is full, a user can’t login or use the system. There are five types of quota limits:
user hard: the maximum size for a user
user soft: a user’s warning threshold
group hard: the maximum size for a group
group soft: the group’s warning threshold
grace period: a soft limit time restriction
To set quota limits, add an entry in in /etc/fstab
e.g.:
No Quota: /dev/hda2 /home ext2 default 1 1 User Quota Set: /dev/hda2 /home ext2 default,usrquota 1 1 Group Quota Set: /dev/hda2 /home ext2 default,grpquota 1 1
After adding an entry, create a quota record in the user’s home directory. (Use sudo mount -a to reload all mounted devices.)
e.g:
sudo touch /home/quota.user sudo touch /home/quota.group
Then, manage user privileges on the created quota record.
e.g:
chmod 600 /home/quota.user chmod 600 /home/quota.group
Reboot the system or remount the partition for the changes to take effect.
Assigning quota for users and groups
Setup quota for a user/group: edquota -u user Setup a grace period: edquota -t time_units
QUOTA COMMANDS
quotacheck – scan the disk usage and update the ”quota.user”.
Options:
-v produce some useful information about what it is doing
-d debug (very detail -v)
-u user (all files with uid)
-g group (all fule with gid)
-a all
-R except root (when used with -a)
repquota – produces a summarized report on the quotas on the system.
Options:
-a all file system indicated in /etc/fstab
-v report all quotas, even if there is no usage
-g report group quotas
-u report user quotas (default)
quotaon/quotaoff – turn quota on.
-a all (as in /etc/fstab).
-v display message for each ?le system.
-g manipulate user quotas.
-u manipulate group quotas