|
|
|
|
The following sections explain disk quotas and describe some methods you can use to conserve and monitor disk space:
Method | Section |
---|---|
Establish disk
quotas
|
Establishing Disk Quotas
|
Purge files
|
Purging Files
|
Set version
limits on files
|
Setting Version Limits on Files
|
Set file expiration
dates
|
Setting File Expiration Dates
|
Analyze and repair error
conditions
|
Using the Analyze/Disk_Structure Utility to Check and Repair Disks
|
Understanding Disk Quotas
A disk quota is a method for maintaining
and enforcing limits on the amount of disk space available to users on
a public volume. You limit the amount of space available to individual
users on public volumes (or volume sets) by creating and maintaining
a quota file on each volume. Individual users
can similarly restrict usage on private volumes.
Quotas are maintained and enforced on a per-volume basis. Each volume or volume set has its own quota file. A volume on which quotas are not maintained has no quota file. On a volume set, volume 1 contains the quota file.
With OPER privilege, you (or the user maintaining the volume) supply identifiers and assign quotas and overdrafts with the System Management utility (SYSMAN). (During normal file activities, the system automatically maintains usage counts.)
If users run out of disk space during the creation of a file, they receive a system message. If they cannot obtain sufficient space by purging or deleting unnecessary files, they might contact you to increase their disk quota. If they attempt to write a file to a spooled printer, they must have write access and have sufficient quota on the disk associated with that printer.
A quota file records all users who are allowed to use the disk, and shows their current disk usage and their maximum disk allocation. A quota file, QUOTA.SYS, which is stored in directory [000000] with other system files, requires one block of disk storage for every 16 entries.
A quota file has the following format:
UIC [1] Usage [2] Permanent Quota [3] Overdraft Limit [4] [0,0] 0 333333 3333 [TTD,DAVIS] 15590 333333 3333 [TTD,MORGAN] 1929 333333 3333 [MKT,MORSE] 7650 333333 3333 . . .
Each entry in a quota file includes the information shown in Contents of a Quota File.
The maximum number of blocks permitted to a user on a volume is the sum of the quota and the overdraft.
A quota file is initialized with an entry for UIC [0,0]. The usage count for this UIC should not change from 0; in other words, UIC [0,0] should own no files. Its quota and overdraft, however, serve as defaults in certain situations; set them to values most likely to be assigned to other UICs as quotas and overdrafts.
During normal use of a volume with a quota file, the system automatically updates the usage counts as users create, delete, extend, and truncate files. Users without entries in the quota file are not allowed to create files or allocate space on the volume unless they have the EXQUOTA privilege.
To create new files, a user must have disk space usage below quota (not overdraft). If adding a new file or expanding a current file exceeds a user's quota, the system prohibits the operation and issues an error message.
A user with an overdraft might be able to extend an open file after exceeding the disk quota (for example, during an editing session). A user can extend an open file until usage exceeds the sum of the quota and the overdraft. At this point, the system prohibits further extensions to the file.
Quota restrictions are not enforced for users with the EXQUOTA privilege; however, their usage counts are maintained.
How the Rebuild Operation Ensures Quota File Accuracy
When you mount a volume that was not properly dismounted the last time it was used, the system performs an automatic REBUILD operation. If quotas are enforced on the volume, this action ensures that the quota file accurately reflects usage of the disk, under any of the following conditions:
Establishing Disk Quotas
Disk quota operations are enabled by default. However, you
can use SYSMAN DISKQUOTA commands to control disk usage. You can assign
disk quotas to users and maintain an accurate record of disk use
for ODS Level 2 or 5 disks. You create
a quota file for each disk except the system disk.
The quota file records the current usage and the maximum disk usage
for all users.
SYSMAN allows you to access disks that are normally unavailable from your local node. With SYSMAN, you can obtain a display of all disks on the other nodes, including those that are mounted privately or used as system disks. You can run DISKQUOTA on any available disk without logging in to each node.
Creating a Quota File
The first step in allocating disk space is to create a quota
file for each volume or each volume set. The absolute maximum number
of blocks permitted a user on a volume is the sum of the quota and
the overdraft. Only users with the EXQUOTA privilege can bypass
disk quota restrictions.
Creating a quota file requires SYSPRV, BYPASS, or GRPPRV privilege. To create a quota file on a disk using SYSMAN commands:
To use the DISKQUOTA ENABLE command on a disk that has been mounted on multiple nodes in a cluster, you must first specify the nodes in the SET ENVIRONMENT command. |
If you create a quota file or enable disk quotas on a disk that has files on it, use the DISKQUOTA REBUILD command to update the disk quota entries with the current usage information. |
The first SYSMAN command in this example sets the environment for all nodes in the cluster. The second SYSMAN command sets up the quota file, QUOTA.SYS, in directory [000000] on the DUA12: device.$
MCR SYSMAN
SYSMAN>
SET ENVIRONMENT/CLUSTER
SYSMAN>
DISKQUOTA CREATE/DEVICE=DUA12:
The command in this example edits the entry for UIC [0,0] in the quota file on the DUA12: device, setting the default permanent quota to 3000 blocks.SYSMAN>
DISKQUOTA MODIFY/DEVICE=DUA12: [0,0]/PERMQUOTA=3000
The command in this example shows quotas, overdrafts, and usage counts for UIC [0,0] on the DUA12: device.SYSMAN>
DISKQUOTA SHOW [0,0]/DEVICE=DUA12:
Monitoring
Disk Quotas
Use the
commands shown in the following table to monitor the amount of disk
space users consume:
Command | Description |
---|---|
MOUNT/QUOTA
|
Use to enforce quotas on
a specified disk volume. You must have the VOLPRO user privilege,
or your UIC must match the UIC written on the volume.
|
SHOW QUOTA
|
Use to determine whether a quota exists
for any specific user on a specific disk. The display that results
from the SHOW QUOTA command gives the quotas used, authorized, and
available.
Enter the DCL command SHOW QUOTA using the following format: SHOW QUOTA/USER=uic (or identifier) The results of the SHOW QUOTA command depend on whether you have read access to the quota file:
|
The SHOW QUOTA command displays the amount of disk space authorized, used, and still available on the current default disk for the present user. The permitted overdraft in this example is 500 blocks.$
SHOW QUOTA
User [DOCUMENTATION,MALCOLM] has 2780 blocks used, 7220 available,
of 10000 authorized and permitted overdraft of 500 blocks on DISK$
This SHOW QUOTA command shows that the user with UIC [DOCUMENTATION,JONES] has no disk quota allocation on the XXX1: device.$
SHOW QUOTA/USER=[DOCUMENTATION,JONES]/DISK=XXX1:
%SYSTEM-F-NODISKQUOTA, no disk quota entry for this UIC
This SHOW QUOTA command indicates that a user has an overdrawn quota.$
SHOW QUOTA/USER=[DOCUMENTATION,ELAINE]
User [DOCUMENTATION,ELAINE] has 27305 blocks used, 2305 OVERDRAWN,
of 25000 authorized and permitted overdraft of 4000 blocks on DISK$
Suspending Quota Operations
The
SYSMAN command DISKQUOTA DISABLE (which requires SYSPRV privilege,
a system UIC, or ownership of the volume), suspends quota operations
on a volume in the current management environment; the DISKQUOTA
ENABLE command lifts the suspension. You can also suspend quota
operations on a volume at mount time by specifying the /NOQUOTA
qualifier with the DCL command MOUNT. Disabling quotas requires
privileges.
Whenever quotas are enabled on a volume--either implicitly with the MOUNT command or explicitly with the DISKQUOTA ENABLE command--you must update disk quota information using the command DISKQUOTA REBUILD. In updating the quota file, the system adds new UICs and corrects usage counts for each user. (Refer to the HP OpenVMS System Management Utilities Reference Manual for more information.)
To discontinue quota operations on a volume:
Note that the system does not suspend quotas across disk mounts if the QUOTA.SYS file is still present.
Purging Files
One of the best
ways to conserve disk space is to purge the following items:
Encourage individual users to purge files in their own areas and directories. If necessary, you can purge files from some or all directories. The following examples show purge commands.
The command in this example purges all files in the directory [JONES] and all the subdirectories below [JONES] on the $DISK1: device. It logs the files that are deleted (displaying their names on the terminal as they are deleted).$
PURGE/LOG $DISK1:[JONES...]
This example uses wildcard characters to perform global purges and uses the /KEEP qualifier to retain only three versions of each file.$
PURGE/KEEP=3 $DISK1:[*...]
Setting Version Limits on Files
Another way to conserve disk space is to limit the number of
file versions that users can create in a directory by using the
/VERSION_LIMIT qualifier with the SET DIRECTORY or CREATE DIRECTORY
command using the following format:SET DIRECTORY/VERSION_LIMIT=n
In the example, files in account [JONES] cannot exceed three versions. If a user in this directory attempts to exceed the three-version limit, the system purges the file, leaving only the three most recent versions.$
CREATE/DIRECTORY $DISK1:[JONES]/OWNER_UIC=[200,1]/VERSION_LIMIT=3
Be careful about setting a version limit on the master file directory (MFD). Because the system uses the version limit that you set on the MFD on any directory you create beneath the MFD, users might inadvertently lose important data. |
Setting File Expiration Dates
Files-11 uses the expiration date of each file to track the
use of the file. The expiration dates aid the disposal of seldom-used
files when you use the DCL command BACKUP/DELETE.
File expiration is a file system feature that is available only on Files-11 Structure Level 2 disks.
After you set an expiration date on a volume, the retention periods operate as follows:
The expiration date of a frequently accessed file fluctuates between the minimum and maximum period plus the current date. When you set a suitable interval between minimum and maximum retention periods, you can balance between accuracy and efficiency in maintaining expiration dates. Be careful about setting expiration dates; either be very specific, or set the expiration date in the simplest way.
Certain commands and utilities, such as the DIRECTORY command and the Backup utility, can selectively operate on files that are expired. For example, you can enter a command like the following:
In this example, the BACKUP command copies to tape and then deletes all expired files. Users might not be aware of file expiration dates, so retain the tape for a substantial period of time.$
BACKUP/DELETE PUBLIC:[*...]/BEFORE=TODAY/EXPIRED MUA0:ARCH20JUN
For more information about the Backup utility, see Backing Up Files and Directories to a Save Set.
To enable the setting of expiration dates, enter the DCL command SET VOLUME in the following format:SET VOLUME device-name[:][,...]/RETENTION=(min,max)
where min and max specify the minimum and maximum retention periods for files on the volume, expressed as delta time values.
If you specify only a single value in the SET VOLUME/RETENTION command, the system uses the value of the minimum retention period; then the maximum retention period is set to twice the minimum or the minimum plus 7 days, whichever is less. For example, you might set the retention period as follows:
The system uses 3 as the minimum retention period. Twice the minimum is 6 days; the minimum plus 7 is 10. Because the system uses the smaller of the two numbers, the retention period is set to 6.$
SET VOLUME PAYVOL1:/RETENTION=(3)
You can simulate the maintenance of "access dates," which are available in some other operating systems, by setting the retention periods to very small values (for example, 1 hour). Note, however, that doing so substantially increases overhead in the file system.
This feature does not automatically remove unused files; instead, it maintains expiration dates to permit you to develop your own policy for handling files with little or no activity.
If you start maintaining expiration dates on a previously existing volume, be aware that the expiration dates on existing files are 0 until the files are accessed. Files with expiration dates of 0 are considered expired. |
In this example, the command sets the minimum retention period to 15 days and the maximum to 20 days.$
SET VOLUME DUA0:/RETENTION=(15-0:0,20-0:0)
|
|