Quotas on the ufs filesystem
The quota system
(available only on
ufs and
vxfs
filesystems)
is built around limits on
the two principal resources of a filesystem:
For each of these resources, users can be assigned quotas.
A quota in this case consists of two
limits, known as the soft and hard limits.
The hard limit represents
an absolute limit on the resource, blocks or inodes,
that the user can never exceed under any circumstances.
Associated with the soft limit
is a time limit set by the administrator.
Users can exceed the soft limits assigned to them,
but only for a limited amount of time--the time limit
set by the administrator.
This allows users to
temporarily exceed limits if needed,
as long as they are back under those limits
before the time limit expires.
An example of such a situation might be the generation
of a large file that is printed and then deleted.
In summary, for each user, you can assign quotas
(soft and hard limits)
for both blocks and inodes.
You can also define a time limit that applies
to all users on a filesystem
indicating how long they can exceed the soft limits.
There are actually two time limits: one for blocks
and one for inodes.
You can define different time limits
for different filesystems.
Using quotas
Before turning quotas on
for a filesystem for the first time, do the following:
-
Mount the filesystem and
change directory
to the mount point.
-
Create a file called
quotas,
owned by root; others should not be able to
write to it.
-
To change the time limits for exceeding the soft
limits for blocks owned and/or inodes owned, enter:
edquota -t
These limits are
initially set to the values defined for
DQ_FTIMELIMIT
and
DQ_BTIMELIMIT
in
/usr/include/sys/fs/sfs_quota.h--604800 (the number of seconds in one week).
If you leave either time limit
(the one for exceeding the block limit
or the one for exceeding the inode limit)
at 0, or if you set either limit to 0,
the default values apply.
You can change them to something else.
-
To set user quotas,
enter:
edquota
See
edquota(1M)
for details on its use.
Once you have set the quotas for a user, you can use the
-p
option to set the same quotas for another user.
Because you are not limited to
UIDs that are already being used,
you can set quotas for future users.
NOTE:
Before turning on quotas on a filesystem, always run
quotacheck(1M)
on the filesystem.
This will sync up the quotas
with the actual state of the filesystem, so that if
the filesystem has been used
since the last time the quotas were turned on,
all of the quotas will be updated to reflect the
current state.
This also provides a sanity check on the
quotas
file.
You can also do other quota-related functions:
-
To turn quotas on, enter:
quotaon
-
To turn quotas off, enter:
quotaoff
-
To report on quotas, enter:
repquota
-
To get information on all users on a filesystem, enter:
quot
-
To get information on a single user, enter:
quota
NOTE:
Regular users can use
quota
to get information on their own quotas;
they cannot get information on other user's quotas.
What effect do quotas have on the user?
The following are
the major effects of the use of quotas on users:
-
If a user exceeds the soft limit
for blocks or inodes, the timer is started.
If the user then reduces usage to a level
under the soft limit,
the timer is turned off and all is well.
But if the user still has not reduced usage
to an appropriate level when the timer expires,
any further attempts by the user
to acquire more filesystem resources fail
and the user receives error messages
saying that the filesystem is full.
These messages persist
until the user has reduced usage to
a level below the soft limit.
-
If a user tries to exceed the hard limit at any time,
the attempt fails and the utility indicates
it has run out of space.
-
Because no warning is given
when the user has exceeded the soft limit,
advise users to run
quota
frequently.
Encourage users
to include
quota
in their
.profile
so it runs when they log in.
© 2004 The SCO Group, Inc. All rights reserved.
UnixWare 7 Release 7.1.4 - 22 April 2004