The AdvFS file system allows you to activate quotas to track and control the amount of physical storage that each user, group, or fileset consumes. You must have root user privilege to set and edit quotas. Quota limits never restrict the root user; quota limits only apply to nonroot users.
This chapter covers the following:
Section 2.1 describes how to use quotas and grace periods.
Section 2.2 explains user and group quotas.
Section 2.3 describes fileset quotas.
The AdvFS quota system is compatible with the quotas of UFS. However, the AdvFS quota system differs in two ways:
AdvFS differentiates between quota maintenance and quota enforcement. Quota information is always maintained, but you can activate and deactivate enforcement can be activated and deactivated.
AdvFS supports fileset quotas; that is, you can set quota limits for the filesets in a domain.
The AdvFS file system creates
You can set quota values on the amount of disk storage and on the number
of files.
In addition, you can set two types of quotas:
User and group quotas
AdvFS user and group quotas are similar to UFS quotas.
You can set a
separate quota for each user or each group of users for each fileset.
Fileset quotas
For example, it is useful to set quotas on filesets that contain home
directories such as
Quota files and fileset quotas are saved when the root user
specifies a complete backup on a local system.
Limits are set on disk usage (number of blocks) or on number of files
(inodes) or both.
Table 2-1
shows the size limits
for both types of quota values.
* Prior to Version 5.0 of the operating system, the disk usage limit for
user and group quotas was 2 terabytes.
If your domain was created with an
operating system version earlier than Version 5.0, and if you are now running Version 5.0
or later operating system, you must upgrade your domain if you want to take
advantage of the new limits (see
Section 1.6.3).
All quotas can have a hard limit and soft limit.
A
The root user can set or change hard and soft limits at any time and
the changes take effect immediately on filesets where quotas are active.
Mounting or unmounting filesets and activating or deactivating quotas have
no effect on the limits.
Hard and soft limits can be set for users, for groups,
and for filesets.
The default is no quota limit.
You can also:
Set the hard limit to 0 blocks or files to impose no quota
limits
Set the hard limit to 1 block or file to permit no disk space
allocations
Set the soft limit to 1 block or file and the hard limit to
0 blocks or files to permit disk-space allocations on a temporary basis
Quota limits remain in effect until changed by the root user.
See
Section 5.8.2
for directions if your activities
cause you to run into limits.
Associated with each soft limit is a
When the grace period expires, the user or the group cannot create new
files or allocate more disk space until enough files are deleted to fall below
the soft limit.
Updating existing files can cause loss of data.
The timer for the grace period starts when the user exceeds the soft
limit.
If you allow no grace period, the user can exceed the soft limit only
once.
The grace period is turned off and reset each time usage drops below
the soft limit.
If you change the grace period after the user has exceeded
the soft limit, the old grace period stays in effect until usage drops below
the limit.
You can set grace periods for:
Users
For each fileset you can set only one grace period for all users (see
Section 2.2.2).
If the user grace period expires, the user cannot
allocate storage in the fileset until enough files are deleted to fall below
the soft limit.
The grace periods for the number of blocks and for the number
of files do not need to be the same.
Groups
For each fileset you can set only one grace period for all groups (see
Section 2.2.2).
If the group grace period expires, no one in the
group can allocate storage in the fileset until enough files are deleted to
fall below the soft limit.
The group grace period limits all users in the
group even if the user grace period is larger.
Filesets
The fileset grace period is the same as the group grace period (see
Section 2.3.2.2).
Any user or group can cause the fileset to exceed its
soft limit and thereby evoke the fileset grace period.
Any user or group (not
necessarily the one that exceeded the limit) can delete files to bring the
fileset below the soft limit.
AdvFS sets a default grace period of 7 days.
This period can be changed
(see
Section 2.2.2
and
Section 2.3.2).
You can:
Specify the grace period in days, hours, minutes, or seconds
Set the grace period to 0 days to impose the default grace
period of 7 days
Set the grace period to 1 second to allow no grace period
The following sections describe quota files and how quotas and grace
periods are set for users and groups.
The AdvFS file system keeps user and group quota information in the
root directory of the fileset in the
Hard block limit
Soft block limit
Block usage
Hard file limit
Soft file limit
File usage
Block grace period
File grace period
Quota files are sparse files (see
Section 1.3.3);
that is, there are holes in the file where no user IDs or group IDs fall.
Use the
Use the
To enforce user or group quotas for a fileset, the
If these options are present, you can use the
You can relocate the
For example, to relocate the
In this example, the group quota file is not moved.
Whether or not you relocate your quota files, you do not need to enforce
quotas.
See
Section 2.2.7
for instruction on deactivating
user and group quotas.
You are not required to set both user and group quotas.
If you specify
a group quota, it applies to all users belonging to that group.
If you specify
a user quota that is larger than the group quota, it has no effect because
the group quota takes effect before the user quota is reached.
Use the
Follow these general steps to set user and group quotas and grace periods:
Add quota file mount-point options ( Enter the
When the user or group quota information is displayed, modify
the values in the limits fields as needed.
Then, exit the editor, saving the
changes.
To set user or group grace periods, enter the
When the grace period information is displayed, modify the
grace period as desired.
Then, exit the editor, saving the changes.
To change the default editor and for more information, see
The quota limits you set for a fileset do not take effect until you
activate them by using the
If you have set quotas for a single user, you can use the
The following procedure sets quotas for the user
If they do not already exist, add quota mount-point options
to the
Enter the
The
values for
To change user quotas for
Exit the editor, saving the changes.
If quotas have already been activated for fileset
Quotas set for the group to which the user belongs take precedence over
quotas set for the user of the fileset.
When you impose soft limits for a fileset, you can set a grace period
for that fileset.
If you do not specify a grace period, the grace period remains
at the AdvFS default of 7 days.
You can set different grace periods for the
number of blocks and for the number of files.
If the group grace period is
less than a user grace period, the user is limited by the group grace period.
The following procedure sets the grace period for all users of fileset
Run the
To set the user grace period for the number of blocks and
for the number of files for
Exit the editor, saving the changes.
If quotas have already been activated for the fileset
The following procedure sets quotas on
If they do not already exist, add quota mount-point options
to the
Enter the
The values for
To change the group quotas for
Exit the editor, saving the changes.
If quotas have already been activated for fileset
When you impose soft limits, you can set one grace period per fileset
for all groups.
If you do not specify a grace period, the grace period remains
the AdvFS default of 7 days.
You can set different grace periods for the number
of blocks and for the number of files.
The group grace period takes precedence
over all user grace periods.
The following procedure sets the grace period for all groups for fileset
Run the
To set the group grace period for the number of blocks and
for the number of files for
Exit the editor, saving the changes.
If quotas have already been activated, this grace period becomes effective
immediately unless a group has already exceeded the soft limit for
The AdvFS file system allows you to use a single command to modify quotas
for a list of users or groups so you do not need to access and enter values
for each one individually.
Note that you do not have to set multiple grace
periods because, for each user or group quota, one grace period per fileset
applies to all users or to all groups.
Use the
For example, to set up all student accounts to have the same disk usage
quota:
Use the
Use the
The following procedure sets up prototype-user quotas that are then
used to modify the quotas for other users:
Set quotas for one user,
To create quotas for new users
To verify that the quotas were set, run the
The following procedure sets up prototype group quotas that are then
used to modify the quotas for another group:
Set quotas for the group
To create quotas for a new group,
To verify that the quotas were set, run the
Even if you are not enforcing quotas, you can monitor file and disk
space usage by using the
If you are enforcing quotas, you can periodically verify your quota
setup.
You can display user and group quota information in a number of ways.
If you are not the root user, you can display information only for your own
files.
The root user can display all user and all group quota information
for all filesets.
All disk quota values are displayed in 1 KB blocks.
The commands shown in
Table 2-2
are useful
for examining disk space and file usage for filesets for which user and group
quotas are enforced.
See the command reference pages for more information.
If your disk usage information appears to be corrupt, see
Section 5.1
for instructions on how to correct this.
The
The
The
The
The
You can choose to display quota information for users or groups, for
all filesets with usage over quota, or for all mounted filesets regardless
of whether quotas are activated.
The quota command displays the block usage of the fileset, soft limit
( The following example displays quota information for the user
The following example displays quota information for the group
The
The
By default both user and group quotas are checked, but you can specify
either by using the
The following example displays a verbose check of the fileset
The following example checks all filesets that have quotas defined in
the
In this display,
The
For each user or group, the
The following example summarizes quotas for a single fileset mounted
on
The following example displays user and group quota information for
all filesets in the
You can automatically start user and group quota enforcement during
system initialization.
Edit the
Use the
This entry causes the
If you unmount a fileset when quota enforcement is active, you must
explicitly reactivate quota enforcement by using the
Setting the
To run the
To restore the default UFS-only behavior for the quotacheck command,
change to the following:
If your system is running, enter the
Edit the
Run the
Run the
If your system is set up to initialize quotas at system startup (see
Section 2.2.5), you do not need to run the
The following example activates quotas for the filesets for which quota
values were set in the previous sections:
By default, both user and group quotas are affected by the
You can turn off quota enforcement either temporarily or permanently.
You can obtain file and disk space usage information regardless of whether
you are enforcing quotas.
The
The
If you want to permanently turn quotas off for a user or group, use
the
The following sections describe fileset quota files and how quotas and
grace periods are set for filesets from the command line.
For information
on setting fileset quotas from the AdvFS GUI, see
Appendix D.
AdvFS keeps fileset soft and hard limits in the structural information
associated with the fileset.
You do not have direct access to this file.
It
contains the same type of information that the user and group quota files
contain: hard and soft limits for the number of blocks and hard and soft limits
for the number of files.
For a given fileset, the fileset grace period is
the same as the group grace period.
Fileset quotas limit the number of files or the amount of disk space
a fileset can use.
You can set both soft and hard limits.
If fileset quotas
are not imposed, any fileset has access to all of the available disk space
in the domain.
The fileset quotas are set by using the
The fileset grace period is the same as the group grace period (see
Section 2.3.2.2).
If you do not set a grace period, the grace period
remains at the AdvFS default grace period of 7 days.
Use the
The command displays both the old and new limits.
The following procedure sets fileset quotas for the
To display existing fileset quotas, use the
Here
Use the
Here
To verify the new fileset quotas, rerun the
Note that the soft limit for the number of blocks is 500000, twice the
number 250000 that was input by using the
The fileset grace period is the same as the group grace period and cannot
be modified independently (see
Section 2.2.2).
Therefore, if
you use the
You can set only one grace period per fileset, but you can set different
grace period values for block usage and number of files.
The grace period
applies to all users and all groups.
If the grace period is reset, the new
grace period for the fileset takes effect immediately unless the fileset has
already exceeded its soft limits.
In that case, the new grace period becomes
effective once the fileset drops below the soft limit.
The following procedure sets the grace period for the filesets
Run the
To change the fileset grace period for the number of blocks
and for the number of files, edit the file to change the existing grace period:
Exit the editor, saving the changes.
Optionally, run the
In this example, the plus sign (+) in the
You can set quota limits for multiple filesets in a domain by listing
more than one fileset name when you run the
For example, to change the hard limits for the
Setting fileset quotas automatically activates the quotas.
To examine how system resources are being used, look at fileset activity.
The commands described in the following sections are useful for examining
disk space and the file usage of filesets.
The command reference pages contain
additional information.
The
If a fileset quota has been set, the command displays the
amount of space remaining until the quota limit is reached.
When both soft and hard quota limits are set, the command
calculates the disk space available using the lower limit.
If there is less space in the domain than is allowed by the
fileset quota, the command displays the actual space available in the domain.
If fileset quotas have not been established, the command displays
the available domain size; all unused space is available to each fileset.
The following example displays the amount of space available for
Because the usage is over the limit, the capacity is determined by the
actual space used (1750/1500) and appears as more than 100%.
If usage is not
over the limit, capacity is calculated as (used)/(used + available).
AdvFS calculates each fileset capacity independently.
If the domain
has multiple filesets, all unused space is available for each fileset unless
fileset quotas limit the space.
As a result, the total capacity of all filesets
in the domain can appear to be greater than 100%.
In the following example,
the filesets
The
The following example displays fileset information for the domain
In this example, the plus sign (+) in the
The
The
The utility is subject to the following restrictions:
All filesets must be mounted.
The disk space used by AdvFS fileset clones is not calculated.
The command does not produce valid results for filesets that
are NFS mounted.
You can specify either a domain or a fileset name for the
The following example displays the summary information for the domain
The following example examines the domain
The following example displays the domain
Running the
You can turn off quota enforcement either temporarily or permanently
by running the
/usr/users
because these filesets can
grow rapidly.
Conversely, setting quota limits on the
/tmp
fileset is not recommended because this fileset is likely to fluctuate in
size.
2.1.1 Quota Limits
Table 2-1: Quota Size Limits
User
and Group Quotas
Fileset
Quotas
Disk Usage
8 billion terabytes*
4 billion terabytes
Number of Files
4 billion
4 billion
2.1.2 Grace Period
2.2.1 Quota Files
quota.user
and
quota.group
files.
These files are created when the fileset is created.
They are indexed by user ID and group ID.
Each quota file entry contains the
following information:
ls -l
command to see the space spanned by the
quota.user
or the
quota.group
file.
This does
not display the actual disk usage.
For example:
# ls -l quota.user
-rw-r----- 1 root operator 294912 Jul 20 08:50 quota.user
ls -s
command or the
du -k
command to display how many 1 KB blocks the file actually uses:
# ls -s quota.user
16 quota.user
# du -k quota.user
16 quota.user
/etc/fstab
file must contain the
userquota
or the
groupquota
mount-point options respectively for
the fileset:
domain#fileset /mnt advfs rw,userquota,groupquota 0 2
quotaon
command to start enforcing quotas (see
Section 2.2.6).
quota.user
and
quota.group
files to subdirectories of the fileset.
However, you cannot relocate them to other filesets nor delete them.
If you
relocate your files, you must update the
/etc/fstab
file
entry to include the path and name of the relocated file(s) in the
userquota
and
groupquota
parameters.
quota.user
file to the
d4
subdirectory and rename it
nquot, change the
/etc/fstab
entry to:
dom_1#fset /mnt advfs rw,userquota=/mnt/d4/nquot,groupquota 0 2
2.2.2 Setting Quotas and Grace Periods
edquota
command to set the quotas for users and groups and use it
again to change the grace period.
You must mount the fileset before you can
set quotas and grace periods.
Note that for each fileset, only one grace period
can be set for all users and one grace period can be set for all groups.
However,
you do not have to set the same grace period for the number of blocks and
for the number of files.
The group grace period you set is also entered as
the fileset grace period (see
Section 2.3.2.2).
userquota,
groupquota) to the
/etc/fstab
file.
edquota
command with the
-u
option to set user quotas or the
-g
option
to set group quotas.
The editor specified by the EDITOR environment variable
displays an ASCII representation of the quota file.
If the EDITOR environment
variable is not set, the
vi
editor is used.
edquota
command with the
-ut
option for user or the
-gt
option for group.
Note that the fileset grace period is the
same as the group grace period.
edquota(8).
quotaon
command (see
Section 2.2.5
and
Section 2.2.6).
If you are changing quota limits and
quotas have already been activated for a fileset, the new limits become effective
immediately.
edquota -p
command, which allows that user's entry to serve as a
prototype to be applied to other users that you specify (see
Section 2.2.3).
2.2.2.1 Setting User Quotas
user5:
/etc/fstab
file.
Note that there can be no spaces
in the list of options delimited by commas; that is, from
rw
through
groupquota:
domain_1#eb1 /eb1 advfs rw,userquota,groupquota 0 2
domain_2#eb3 /eb3 advfs rw,userquota,groupquota 0 2
domain_4#eb4 /eb4 advfs rw,userquota,groupquota 0 2
edquota -u
command followed by
the user name.
If you specify more than one user name, the edits affect all
users named.
The command creates a temporary file with an ASCII representation
of the current quotas assigned to the named users and invokes an editor to
allow you to modify the file:
# edquota -u user5
Quotas for user user5:
/eb1: blocks in use: 0, limits (soft = 0, hard = 0)
inodes in use: 0, limits (soft = 0, hard = 0)
/eb3: blocks in use: 0, limits (soft = 0, hard = 0)
inodes in use: 0, limits (soft = 0, hard = 0)
/eb4: blocks in use: 0, limits (soft = 0, hard = 0)
inodes in use: 0, limits (soft = 0, hard = 0)
blocks in use
and
inodes in use
are the number of 1 KB blocks and the number of files currently in use for
each fileset.
You cannot change them.
Soft and hard limits of 0 (zero) indicate
that no limits have been set.
user5
for fileset
eb3, edit the
quota.user
file.
Enter the new
limits for disk usage on the
blocks
line and enter the
new limits for the number of files on the
inodes
line:
/eb3: blocks in use: 0, limits(soft=5000, hard=10000)
inodes in use: 0 limits(soft= 100, hard= 200)
eb3,
the new limits become effective immediately.
If quotas are not yet activated
for the fileset, the limits become effective as soon as quotas are activated
(see
Section 2.2.6).
2.2.2.2 Setting the User Grace Period
eb3:
edquota -ut
command.
The command
creates a temporary file with an ASCII representation of the current grace
period and invokes an editor to allow you to modify the file.
# edquota -ut
Time units may be: days, hours, minutes, or seconds
Grace period before enforcing soft limits for users:
/eb1: block grace period: 7 days, file grace period: 7 days
/eb3: block grace period: 7 days, file grace period: 7 days
/eb4: block grace period: 7 days, file grace period: 7 days
eb3, edit the file to change
the existing grace period:
Time units may be: days, hours, minutes, or seconds
Grace period before enforcing soft limits for users:
/eb1: block grace period: 7 days, file grace period:7 days
/eb3: block grace period: 2 days, file grace period:3 days
/eb4: block grace period: 7 days, file grace period:7 days
eb3,
the new grace period becomes effective immediately.
If a user has already
exceeded the soft limit, the grace period becomes effective when the usage
drops below the soft limit.
If quotas are not yet activated for the fileset,
the grace period becomes effective as soon as quotas are activated (see
Section 2.2.6).
2.2.2.3 Setting Group Quotas
eb3
for the
group
rsgusers:
/etc/fstab
file.
Note that there can be no spaces
in the list of options delimited by commas; that is, from
rw
through
groupquota:
domain_1#eb1 /eb1 advfs rw,userquota,groupquota 0 2
domain_2#eb3 /eb3 advfs rw,userquota,groupquota 0 2
domain_4#eb4 /eb4 advfs rw,userquota,groupquota 0 2
edquota -g
command.
If you specify
more than one group name, the edits affect all groups named.
The command creates
a temporary file with an ASCII representation of the current quotas assigned
to the named groups and invokes an editor to allow you to modify the file.
# edquota -g rsgusers
Quotas for group rsgusers:
/eb1: blocks in use: 0, limits (soft=0, hard=0)
inodes in use: 0, limits (soft=0, hard=0)
/eb3: blocks in use: 0, limits (soft=0, hard=0)
inodes in use: 0, limits (soft=0, hard=0)
/eb4: blocks in use: 0, limits (soft=0, hard=0)
inodes in use: 0, limits (soft=0, hard=0)
blocks in use
and
inodes
in use
are the current number of 1 KB blocks in use and the number
of files for each fileset.
You cannot change them.
Soft and hard limits of
0 (zero) indicate that no limits have been set.
eb3, edit
the
group.quota
file.
Enter the new limits for disk usage
on the
blocks
line and enter the new limits for the number
of files on the
inodes
line:
/eb3: blocks in use:0, limits(soft=60000, hard=80000)
inodes in use:0, limits(soft= 6000, hard= 8000)
eb3,
these limits become effective immediately.
If quotas are not yet activated
for
eb3, these limits become effective as soon as quotas
are activated (see
Section 2.2.6).
Quotas set for the group
take precedence over quotas set for the individual.
2.2.2.4 Setting the Group Grace Period
eb3:
edquota -gt
command.
The command
creates a temporary file with an ASCII representation of the current grace
period and invokes an editor to allow you to modify the file.
# edquota -gt
Time units may be: days, hours, minutes, or seconds
Grace period before enforcing soft limits for groups:
/eb1: block grace period: 7 days, file grace period:7 days
/eb3: block grace period: 7 days, file grace period:7 days
/eb4: block grace period: 7 days, file grace period:7 days
eb3, edit the file to change
the existing grace period:
Time units may be: days, hours, minutes, or seconds
Grace period before enforcing soft limits for groups:
/eb1: block grace period: 7 days, file grace period:7 days
/eb3: block grace period:12hours, file grace period:5 days
/eb4: block grace period: 7 days, file grace period:7 days
eb3.
In that case, the new grace period becomes effective for that
group when the group usage drops below the soft limit.
If quotas are not yet
activated, the group grace period becomes effective as soon as they are activated
(see
Section 2.2.6).
2.2.3 Setting Quotas for Multiple Users and Groups
edquota -p
command to take existing quota
information and establish it as a prototype user or group quota.
Then apply
the prototype to one or more users or groups.
edquota
command with the desired
limits to establish a set of quotas for a single student.
edquota -p
command to apply the
quotas set up for the first user to other student accounts.
2.2.3.1 Setting Quotas for Multiple Users
user5
(see
Section 2.2.2.1):
#edquota -u user5
Quotas for user user5:
/eb1:blocks in use:0, limits(soft= 20000,hard= 30000)
inodes in use:0, limits(soft= 350,hard= 500)
/eb3:blocks in use:1 ,limits(soft= 30000,hard= 40000)
inodes in use:4, limits(soft= 400,hard= 550)
/eb4:blocks in use:2, limits(soft= 10000,hard= 20000)
inodes in use:1, limits(soft= 150,hard= 200)
/eb5:blocks in use:2, limits(soft=100000,hard=150000)
inodes in use:1, limits(soft= 5000,hard= 7000)
user7,
user8, and
user9, use the quotas from user
user5
as a prototype:
# edquota -p user5 -u user7 user8 user9
edquota
command for
user7:
# edquota -u user7
Quotas for user user7:
/eb1:blocks in use:0, limits(soft= 20000,hard= 30000)
inodes in use:0, limits(soft= 350,hard= 500)
/eb3:blocks in use:0, limits(soft= 30000,hard= 40000)
inodes in use:0, limits(soft= 400,hard= 550)
/eb4:blocks in use:0, limits(soft= 10000,hard= 20000)
inodes in use:0, limits(soft= 150,hard= 200)
/eb5:blocks in use:0, limits(soft=100000,hard=150000)
inodes in use:0, limits(soft= 5000,hard= 7000)
2.2.3.2 Setting Quotas for Multiple Groups
rsgusers
(see
Section 2.2.2.3):
# edquota -g rsgusers
Quotas for group rsgusers:
/eb1:blocks in use:0, limits(soft=100000,hard=200000)
inodes in use:0, limits(soft= 10000,hard= 20000)
/eb3:blocks in use:0, limits(soft=300000,hard=400000)
inodes in use:0, limits(soft= 30000,hard= 40000)
/eb4:blocks in use:0, limits(soft=500000,hard=600000)
inodes in use:0, limits(soft= 50000,hard= 60000)
/eb5:blocks in use:0, limits(soft=350000,hard=450000)
inodes in use:0, limits(soft= 35000,hard= 45000)
rsgstudents,
use the quotas from group
rsgusers
as a prototype:
# edquota -p rsgusers -g rsgstudents
edquota
command for
rsgstudents:
# edquota -g rsgstudents
Quotas for group rsgstudents:
/eb1:blocks in use:0, limits(soft=100000,hard=200000)
inodes in use:0, limits(soft= 10000,hard= 20000)
/eb3:blocks in use:0, limits(soft=300000,hard=400000)
inodes in use:0, limits(soft= 30000,hard= 40000)
/eb4:blocks in use:0, limits(soft=500000,hard=600000)
inodes in use:0, limits(soft= 50000,hard= 60000)
/eb5:blocks in use:0, limits(soft=350000,hard=450000)
inodes in use:0, limits(soft= 35000,hard= 45000)
2.2.4 Verifying File and Disk Space Usage
df,
showfdmn,
vdf, and
showfsets
commands.
Use the
-k
option to display information in kilobytes.
See the appropriate
reference pages for more information.
Table 2-2: User and Group Usage Commands
Command
Description
ncheck
Prints the tag and full pathname
for each file in the fileset
quotSummarizes fileset ownership
quotaDisplays disk usage and limits
by user or group
quotacheckChecks fileset quota consistency
repquotaSummarizes quotas for a fileset
2.2.4.1 Printing the Tag and Full Pathname for Each File
ncheck
command lists files by
sort
command, you can use the sorted output as input for the
quot
command to list all files and their owners.
Use the following
format to generate the listing:
ncheck
domain#fileset
|sort +0n| quot -n domain#fileset
2.2.4.2 Summarizing Fileset Ownership
quot
command displays block usage and the number
of files in the fileset that each user owns.
If you do not specify a fileset,
the command processes all filesets in the
/etc/fstab
file
that include the
ro,
rw, and
rq
mount options.
quot
command entered with no options displays
only blocks:
# quot domain_1#set_1
domain_1#set_1:
34128 root
816 user5
quot -f
command displays both blocks and files:
# quot -f domain_1#set_1
domain_1#set_1:
34128 125 root
816 9 user5
2.2.4.3 Displaying Disk Usage and Limits
quota
command displays the block usage, the number
of files, and the quotas for a user or group.
Users can run this command to
look at their own disk space usage.
The root user can look at usage for the
whole system.
quota), hard limit (limit), grace period,
and the number of files used for each user.
An asterisk (*) in a column means
that a soft quota limit has been exceeded.
Note that the grace period is not
displayed unless the soft limit has been exceeded.
Use the
edquota
command to view complete quota specifications.
user5:
# quota -u user5
Disk quotas for user user5 (uid 446):
Filesystem blocks quota limit grace files quota limit grace
/ 60 100 150 3 10 20
/usr 5071* 5000 10000 24:40 2 20 40
/eb1 816 20000 30000 9 350 500
/eb2 22032 50000 200000 2 2000 4000
/eb3 2344 10000 15000 370 1000 2000
/eb4 18023* 10000 20000 7days 3 100 150
/eb5 32012* 20000 50000 7days 0 2000 3000
rsgusers:
# quota -g rsgusers
Disk quotas for group rsgusers (gid 15):
Filesystem blocks quota limit grace files quota limit grace
/ 118 200 300 2 20 40
/usr 13184* 10000 20000 7days 2 40 80
/eb1 36136 100000 200000 124 10000 20000
/eb2 44064 200000 400000 4 2000 4000
/eb3 3587 30000 60000 628 3000 5000
/eb4 51071 150000 300000 6 1050 1800
/eb5 61044 100000 200000 3 10000 20000
2.2.4.4 Verifying Quota Consistency
quotacheck
command verifies that the actual blocks
used and the number of files are consistent with the established limits.
It
examines user and group files, builds a table of current disk usage, and compares
this table with that stored in the disk quota file.
quotacheck
command requires that filesets be
mounted.
Use the
-v
option (verbose) to display inconsistencies
found and procedures performed during the checking process.
-u
option for user or the
-g
option for group.
set_1
that displays no inconsistencies:
# quotacheck -v domain_1#set_1
*** Checking user and group quotas for domain_1#set_1 (/eb1)
/etc/fstab
file.
In this example the
quotacheck
command fixes inconsistencies in the
/usr
directory:
# quotacheck -va
*** Checking user and group quotas for /dev/rdisk/dsk0g (/usr)
*** Checking user and group quotas for domain_1#set_1 (/eb1)
/usr: root fixed: inodes 3057 -> 3022 blocks 100616 -> 123440
/usr: system fixed: inodes 2483 -> 2488 blocks 91721 -> 114568
/usr: adm fixed: inodes 280 -> 240 blocks 487 -> 464
inodes
is the number of files and
blocks
is the block usage.
2.2.4.5 Summarizing Quotas by Fileset
repquota
command displays the actual disk usage
and quotas for the specified filesets.
The fileset must have a quota entry
in the
/etc/fstab
file to be included in the summary.
By
default user quotas are reported, but you can specify which quotas are reported
by using the
-u
option for user or the
-g
option for group.
If you specify the
-a
option, both the
user and group quotas are displayed.
repquota
command prints
the current number of files, the amount of space used, and the quota limits
established by the
edquota
command.
/eb1:
# repquota -v /eb1
*** Report for user quotas on /eb1 (domain_1#set_1)
Block limits File limits
User used soft hard grace used soft hard grace
root -- 34088 0 0 123 0 0
user5 -- 816 20000 30000 9 350 500
/etc/fstab
file that have quotas defined.
Note that this example contains both UFS and AdvFS files:
# repquota -va
*** Report for group quotas on /usr (/dev/disk/dsk0g)
Block limits File limits
Group used soft hard grace used soft hard grace
system -- 114568 0 0 2488 0 0
daemon -- 144 0 0 1 0 0
uucp -- 801 0 0 8 0 0
mem -- 1096 0 0 10 0 0
bin -- 108989 0 0 3219 0 0
mail -- 209 0 0 2 0 0
terminal -- 56 0 0 2 0 0
adm -- 464 0 0 240 0 0
operator -- 392 0 0 3 0 0
211 -- 6937 0 0 33 0 0
*** Report for user quotas on /usr (/dev/disk/dsk0g)
Block limits File limits
User used soft hard grace used soft hard grace
root -- 123440 0 0 3022 0 0
bi -- 102534 0 0 2940 0 0
uucp -- 729 0 0 7 0 0
adm -- 1 0 0 1 0 0
user5 -- 15 18 24 1 0 0
kraetsch -- 6937 0 0 35 0 0
*** Report for group quotas on /eb1 (domain_1#set_1)
Block limits File limits
Group used soft hard grace used soft hard grace
system -- 22816 0 0 50 0 0
daemon -- 12088 0 0 82 0 0
*** Report for user quotas on /eb1 (domain_1#set_1)
Block limits File limits
User used soft hard grace used soft hard grace
root -- 34088 0 0 123 0 0
user5 -- 816 20000 30000 9 350 500
*** Report for group quotas on /eb3 (domain_2#set_1)
Block limits File limits
Group used soft hard grace used soft hard grace
system -- 1593 0 0 6 0 0
*** Report for user quotas on /eb3 (domain_2#set_1)
Block limits File limits
User used soft hard grace used soft hard grace
root -- 1593 0 0 6 0 0
2.2.5 Activating Quotas at System Start-Up
/etc/fstab
file entry to change
the fourth field to
rw,userquota,groupquota.
rcmgr
command to add the
QUOTA_CONFIG
option to the
/etc/rc.config.common
file:
QUOTA_CONFIG="yes"
/sbin/init.d
quota script to
run the
quotaon
command for file systems where the
userquota
or
groupquota
options are specified
in the
/etc/fstab
file.
Quota enforcement is activated
for the mounted fileset the next time and every time you reboot.
Note
quotaon
command when you remount the fileset.
This must be done even if there is a
QUOTA_CONFIG="yes" entry in the
/etc/rc.config.common.
QUOTA_CONFIG
option to "yes"
also causes the
command,
which checks file system quota consistency, to run for UFS file systems that
have quota options specified in the
quotacheck
file.
By default, the
/etc/fstab
command
is not run for AdvFS file systems because the AdvFS metadata transaction logging
keeps storage allocations and quotas synchronized.
quotacheckquotacheck
command at startup for AdvFS
file systems with quota options in the
/etc/fstab
file,
use the
rcmgr
command to add the following option to the
/etc/rc.config.common
file:
/usr/sbin/rcmgr -c set QUOTACHECK_CONFIG -a
/usr/sbin/rcmgr -c set QUOTACHECK_CONFIG ""
2.2.6 Activating Quotas Manually
quotaon
command
to activate new quotas for a mounted fileset.
To establish new user or group
quotas do the following:
/etc/fstab
file entry for your
fileset to add
userquota
and
groupquota
to the mount point.
edquota
command to enter the hard
and soft limits and to enter the grace period.
quotaon
command to activate the
new quotas.
quotaon
command again unless you have unmounted your fileset.
If your system
is set up without quota enforcement (see
Section 2.2.7),
you must run the
quotaon
command to start enforcement each
time you reboot.
# quotaon -av
/eb1: group quotas turned on
/eb1: user quotas turned on
/eb3: group quotas turned on
/eb3: user quotas turned on
/eb4: group quotas turned on
/eb4: user quotas turned on
quotaon
and
quotaoff
commands.
You can choose
to activate quotas either for users (with the
-u
option)
or for groups (with the
-g
option).
You can also specify
the filesets for which user or group quotas are enforced (see
Section 2.3.5
for information on fileset quotas).
2.2.7 Deactivating Quotas
quotaoff
command turns off quota enforcement
until the
quotaon
command is run again either manually
or through system initialization that turns quotas on.
umount
command turns off quotas before it unmounts
a fileset.
If you remount the fileset, you must run the
quotaon
command to enforce user and group quotas for the fileset.
edquota
command to set quota limits to 0 (zero).
To
prevent quotas from ever being activated for a fileset, run the
quotaoff
command.
Then, remove the
userquota
and
groupquota
entries for the fileset in the
/etc/fstab
file.
2.3 Fileset Quotas
2.3.1 Quota Files
2.3.2 Setting Quotas and Grace Periods
chfsets
command.
If fileset quotas are set, they are activated whenever you mount
the fileset.
chfsets
command to define fileset quota values.
You can use the following options:
-FSets a soft limit for the number of files
-fSets a hard limit for the number of files
-BSets a soft limit for block usage
-bSets a hard limit for block usage
2.3.2.1 Setting Fileset Quotas
set_1
fileset in the
dmn_2
domain.
Note that unlike
the quota commands, the
showfsets
command displays block
usage in 512-byte blocks.
If you want to display kilobyte values, use the
-k
option.
showfsets
command:
# showfsets dmn_2 set_1
set_1
Id : 2feff762.00034e3f.1.8001
Clone is : set_1_clone
Files : 7, SLim= 0, HLim= 0
Blocks (512) : 118, SLim= 0, HLim= 0
Quota Status : user=on group=on
Object Safety: off
Fragging : on
DMAPI : off
SLim
is the soft limit and
HLim
is the hard limit for the number of files and the current block usage.
chfsets
command to set the quotas.
Note that the arguments for block usage for the
chfsets
command are in units of 1 KB, not 512 bytes as displayed by the
showfsets
command display.
# chfsets -F 10000 -f 20000 -B 250000 -b 500000 dmn_2 set_1
-F
sets the soft limit for the number of files,
-f
sets the hard limit for the number of files,
-B
sets the soft limit for block usage, and
-b
sets the hard
limit for block usage.
showfsets
command:
# showfsets dmn_2 set_1
set_1
Id : 2feff762.00034e3f.1.8001
Clone is : set_1_clone
Files : 7, SLim= 10000, HLim= 20000
Blocks (512) : 118, SLim= 500000, HLim= 1000000
Quota Status : user=on group=on
Object Safety: off
Fragging : on
DMAPI : off
chfsets
command;
similarly, the hard limit for the number of blocks appears to double from
500000 to 1000000.
To avoid this confusion, enter the
showfsets
command with the
-k
option to display blocks in 1 KB units.
2.3.2.2 Setting the Grace Period
edquota -gt
command to change the grace period
for which a fileset can exceed its soft limits, you also change the group
grace period and vice versa.
The default AdvFS grace period of 7 days remains
in effect until you change it.
eb1,
eb3, and
eb4:
edquota
command with the group
grace period options.
The command creates a temporary file with an ASCII representation
of the current grace period and invokes an editor to allow you to modify the
file:
# edquota -gt
Time units may be: days, hours, minutes, or seconds
Grace period before enforcing soft limits for groups:
/eb1: block grace period: 7 days, file grace period:7 days
/eb3: block grace period: 7 days, file grace period:7 days
/eb4: block grace period: 7 days, file grace period:7 days
Time units may be: days, hours, minutes, or seconds
Grace period before enforcing soft limits for groups:
/eb1: block grace period: 7 days, file grace period:7 days
/eb3: block grace period:12hours, file grace period:5 days
/eb4: block grace period: 7 days, file grace period:7 days
showfsets -q
command
to display the time (if exceeded) and fileset usage and limits:
# showfsets -q eb_domain
Block (512) Limits File Limits
Fileset BF used soft hard grace used soft hard grace
fileset1 +- 1750 1500 2000 11:32 35 300 400
BF
field
means that the soft limit for block usage is exceeded.
An asterisk (*) indicates
that the hard limit has been reached.
2.3.3 Setting Quotas for Multiple Filesets
chfsets
command
(see
Section 2.3.2).
data
and
data2
filesets in
eb1_domain, enter
the names of both filesets after the
chfsets
command:
# chfsets -b 1000 -f 200 eb1_domain data data2
2.3.4 Verifying File and Disk Space Usage
2.3.4.1 Displaying Fileset Space
df
command displays the available disk space
and the disk space used for a fileset.
The command calculates capacity using
the lower (hard or soft) limit for the amount of space available:
fileset_1:
# df /fileset_1
Filesystem 512-blocks Used Avail Capacity Mounted on
eb_domain#fileset_1 1500 1750 0 117% /fileset_1
domain_1#eb3
and
domain_1#eb4
each can use all of the available disk space from the volumes in
domain_1:
# df
Filesystem 512-blocks Used Avail Capacity Mounted on
domain_1#eb3 2000000 390820 98864 80% /eb3
domain_1#eb4 2000000 271580 98864 73% /eb4
2.3.4.2 Displaying Fileset Limits
showfsets -q
command displays file usage, hard
and soft limits, and grace period information for the filesets in the specified
domain.
It display s the block usage, the block usage limit, the number of
files, and the file limit.
The correct information is displayed only if the
fileset is mounted.
eb_domain:
# showfsets -q eb_domain
Block (512) Limits File Limits
Fileset BF used soft hard grace used soft hard grace
fileset1 +- 1750 1500 2000 11:32 35 300 400
BF
field means
that the soft limit for block usage is exceeded.
An asterisk (*) would indicate
that the hard limit has been reached.
2.3.4.3 Displaying Domain Space
showfdmn
command is useful for obtaining domain
statistics that you can use to make decisions about filesets and their quotas.
The command displays the attributes of a domain and information about each
volume in the domain.
For single-volume or multivolume domains, the command
displays the total volume size, the total number of free blocks, and the total
percentage of volume space currently allocated.
# showfdmn usr_domain
Id Date Created LogPgs Version Domain Name
39cbf2d6.0002691e Sat Jan 20 17:01 2000 512 4 usr_domain
Vol 512-Blks Free % Used Cmode Rblks Wblks Vol Name
1L 10605520 7757728 27% on 256 256 /dev/disk/dsk8d
2.3.4.4 Displaying Domain and Fileset Space
/sbin/advfs/vdf
utility reformats output from
the
showfdmn,
showfsets, and
df
commands to display information about the disk usage of AdvFS
domains and filesets.
It clarifies the relationship between a domain's disk
usage and its fileset's disk usage.
vdf
command.
If you specify only a fileset name, the output is the
same as that of the
df
command.
If you specify a domain,
the utility also displays the number of disk blocks used for metadata.
If
you specify the
-l
option with either a domain or a fileset,
both domain and fileset information is displayed.
The domain metadata displayed
is the total metadata shared by all filesets in the domain.
usr_domain:
# /sbin/advfs/vdf usr_domain
Domain 512-blocks Metadata Used Available Capacity
usr_domain 65536 11219 47549 6768 89%
eba
that
contains two filesets.
Each has a quota limit of 60,000 blocks.
# /sbin/advfs/vdf -l eba
Domain 512-blocks Metadata Used Available Capacity
eba 266240 5824 29128 231288 13%
Fileset QuotaLimit Used Available Capacity
ebfsa 60000 20800 39200 35%
ebfs2a 60000 8328 51672 14%
ebb
that
contains two filesets with no quota limits.
In this case, the total space
available to each fileset is the same as the domain total.
# /sbin/advfs/vdf -l ebb
Domain 512-blocks Metadata Used Available Capacity
ebb 266240 5824 29128 231288 13%
Fileset QuotaLimit Used Available Capacity
ebfsb - 20800 231288 35%
ebfs2b - 8328 231288 14%
command automatically activates fileset
quotas immediately (see
Section 2.3.3).
No further steps
are needed.
Fileset quotas are in effect whenever you mount the fileset.
2.3.6 Deactivating Quotas
chfsets
command with the hard and soft limits
set to 0 (zero) to deactivate quotas on a fileset.
You can obtain file and
disk space usage information regardless of whether you are enforcing quotas.