Hi everyone,
These are the steps I used to enable quota support for all my managed plain Red Hat Linux servers so that you can set user or/and group quota.
What is Quota?
Quoted from
http://www.tldp.org/HOWTO/Quota-1.html#ss1.1
Quote:
Quota allows you to specify limits on two aspects of disk storage: the number of inodes a user or a group of users may possess; and the number of disk blocks that may be allocated to a user or a group of users.
The idea behind quota is that users are forced to stay under their disk consumption limit, taking away their ability to consume unlimited disk space on a system. Quota is handled on a per user, per file system basis. If there is more than one file system which a user is expected to create files, then quota must be set for each file system separately. Various tools are available for you to administer and automate quota policies on your system.
|
Step 1: Gain root access to your server using SSH.
Step 2: Check whether the quota package is install or otherwise please install it before continue.
Step 3: Modify /etc/fstab file
Partitions that you have not yet enabled quota normally look something like:
Code:
/dev/hda5 /home ext3 default 1 2
To enable user quota support for that partition, simply add in
usrquota next to default such as below:
Code:
/dev/hda5 /home ext3 default,usrquota 1 2
To enable group quota, just add
grpquota.
To enable both user and group quotas, add in both
usrquota,grpquota.
Step 4: Reboot or Not to Reboot.
Normally I won't reboot, you can try this command on the partition that you have modified or added in quota support:
Code:
mount -o remount /home
Step 5: Quota Check
Code:
/sbin/quotacheck -cguvamf -F vfsv0
Step 6: Rerun Quota Check for old version
Code:
/sbin/quotacheck -cguvamf -F vfsold
Step 7: Turn on Quotas
To see the report of quotas, issue this command:
To set a user quota, issue the following command:
Code:
setquota -u USERNAME SOFTQUOTA HARDQUOTA SOFTFILELIMIT HARDFILELIMIT -a
Where:
USERNAME is the user
SOFTQUOTA in kilobytes
HARDQUOTA in kilobytes
SOFTFILELIMIT set it to 0 normally
HARDFILELIMIT set it to 0 also
You are done

)
References:
Quota mini-HOWTO
Thanks.
Kindest regards,
Choon