Securing-Optimizing-RH-Linux-1_2_222
Comments and suggestions concerning this book should be mailed to gmourani@videotron.ca
© Copyright 1999-2000 Gerhard Mourani and Open Network Architecture ®
222
·
To assign 5MB of quota for user wahib, change the following parameters in the vi editor:
Quotas for user wahib:
/dev/sda6: blocks in use: 6, limits (soft = 0, hard = 0)
inodes in use: 5, limits (soft = 0, hard = 0)
To read:
Quotas for user wahib:
/dev/sda6: blocks in use: 6, limits (soft = 5000, hard = 0)
inodes in us e: 5, limits (soft = 0, hard = 0)
The soft limit (soft =) specifies the maximum amount of disk usage a quota user is allowed to
have.
The hard limit (hard =) specifies the absolute limit on the disk usage a quota user can't go
beyond it. Take a note that the hard limit value works only when the grace period parameter is
set.
The grace period parameter
The grace period parameter allow you to set a time limit before the soft limit value is enforced
on a file system with quota enabled (see the soft limit above for more information). For example
this parameter can be used to warn your users about a new politic that will set a quota of 5MB of
disk space in their home directory in 7 days. You can set the 0 days default part of this parameter
to any length of time you feel reasonable.
The changes of this setting require two steps as follow (in my story example I assume 7 days).
Step 1
·
Edit the default grace period parameter, by using the following command:
[root@deep /]# edquota -t
Time units may be: days, hours, minutes, or seconds
Grace period before enforcing soft limits for users:
/dev/sda6: block grace period: 0 days, file grace period: 0 days
Step 2
·
Modify the grace period to 7 days. Change or set the following parameters in the vi editor:
Time units may be: days, hours, minutes, or seconds
Grace period before enforcing soft limits for users:
/dev/sda6: block grace period: 0 days, file grace period: 0 days
To read:
Time units may be: days, hours, minutes, or seconds
Grace period before enforcing soft limits for users:
/dev/sda6: block grace period: 7 days, file grace period: 7 days
NOTE: The command edquota -t edits the soft time limits for each file system with quota enable.
Assigning quota for a particular group
If for example, you have a group with the group id webusers on your system. The following
command takes you into the vi editor to edit quota for group webusers on each partition that has
quota enabled:
·
To edit and modify quota for group webusers, use the following command:
[root@deep /]# edquota -g webusers
Quotas for group webusers:
/dev/sda6: blocks in use: 6, limits (soft = 0, hard = 0)
inodes in use: 6, limits (soft = 0, hard = 0)