Document revision date: 19 July 1999 | |
Previous | Contents | Index |
If the device you are dismounting was allocated with an ALLOCATE
command, it remains allocated after you dismount it with the DISMOUNT
command. If the device was implicitly allocated with the MOUNT command,
the DISMOUNT command deallocates it.
8.9.1.3 Using DISMOUNT Command Qualifiers
The following table explains the /UNIT and /NOUNLOAD qualifiers.
The following example shows how to use the DISMOUNT command. The example uses the /NOUNLOAD qualifier.
$ DISMOUNT/NOUNLOAD MUA1: |
In this example, the tape volume is logically dismounted and remains
loaded on the MUA1: device. Also, the tape reel is rewound to the
beginning-of-tape mark. The operating system returns you to DCL level.
8.9.2 Dismounting a Volume Set
Use the DISMOUNT command to dismount an entire volume set. If you explicitly dismount any volume in a disk or tape volume set, the entire volume set is dismounted. For example, if you have a volume set that consists of DUA3: and DUA4: and you enter the following command, the entire volume set is dismounted:
$ DISMOUNT DUA3: |
You also use the DISMOUNT command to dismount foreign volumes. The following command dismounts a volume that has been mounted with the /FOREIGN qualifier on the DUA0: device:
$ DISMOUNT DUA0: |
In this example, the volume that had been mounted with the /FOREIGN
qualifier on DUA0: is dismounted and automatically unloaded. The system
returns you to DCL level.
8.9.4 Dismounting a Volume in an OpenVMS Cluster System
You can use the DISMOUNT command to dismount a volume throughout an OpenVMS Cluster system by using the /CLUSTER qualifier. The following command, which requires SYSNAM privilege, dismounts a volume in an OpenVMS Cluster system:
$ DISMOUNT/CLUSTER $10$DJA100: |
The DISMOUNT/CLUSTER command first checks for conditions that prevent the volume from dismounting on the local node. If none is found, the command then checks for such conditions on all the other nodes. If a condition is found on any node, the command sends error messages identifying the device, the node on which the error occurred, and the error.
For more information about the DISMOUNT command, refer to the
OpenVMS DCL Dictionary.
8.10 Using Command Procedures for Media Setup
Many of the operations that you perform on disk and tape media are routine. It is worthwhile to identify those routine tasks and design command procedures to assist you in performing them. To become familiar with the syntax used to design and execute command procedures, refer to the OpenVMS User's Manual.
You might, for example, want to design command procedures to set up
private disk and tape volumes. The command procedure examples in this
section, although general in nature, can serve as guiding strategies
for you. You can tailor these command procedures to meet the needs of
your own setup tasks.
8.10.1 Sample Command Procedure for Setting Up Disk Volumes
The command procedure in this section allocates, initializes, and mounts a disk volume. Follow these steps:
$ ! Place a disk in the drive $ IF P1 .EQS. "" THEN INQUIRE P1 "enter device name" $ IF P2 .EQS. "" THEN INQUIRE P2 "enter volume label" $ IF P3 .EQS. "" THEN INQUIRE P3 "enter logical name" $ ALLOCATE 'P1' $ MOUNT 'P1' 'P2' 'P3' |
$ @SETUP |
The command procedure shown in Example 8-1, which is more complex and detailed than the previous example, is designed to set up a magnetic tape for processing. The ALLOCATE and MOUNT/FOREIGN commands are included in this command procedure. Using a text editor, construct the command procedure as shown in the example.
Example 8-1 Command Procedure to Set Up Tape Volumes |
---|
$ ! First mount the tape on the drive $ ON CONTROL_Y THEN GOTO EXIT $ ON ERROR THEN GOTO EXIT $ WRITE SYS$OUTPUT "Welcome to FETCH." $ WRITE SYS$OUTPUT " " $ L1: INQUIRE/NOPUNC PHYS "Have you placed the volume in the drive? " $ IF .NOT. PHYS THEN GOTO L1 $ INQUIRE/NOPUNC DRIVE "Which drive is the volume mounted on? " $ DRIVE = DRIVE - ":" $ ALLOCATE 'DRIVE' $ MOUNT/FOREIGN 'DRIVE' $ ON ERROR THEN GOTO COMMAND_LOOP $ ! $ COMMAND_LOOP: INQUIRE/NOPUNC OPTION "FETCH> " $ IF OPTION .EQS. "DIR" THEN GOTO DIR $ IF OPTION .EQS. "EXIT" THEN GOTO EXIT $ IF OPTION .EQS. "FETCH" THEN GOTO FETCH $ IF OPTION .EQS. "HELP" THEN GOTO HELP $ IF OPTION .EQS. "LIST" THEN GOTO LIST $ GOTO COMMAND_LOOP $ ! $ DIR: INQUIRE SPEC "Filespec" $ DIR 'SPEC' $ GOTO COMMAND_LOOP $ HELP: $ WRITE SYS$OUTPUT "Enter any of the following commands at the prompt:" $ WRITE SYS$OUTPUT " " $ WRITE SYS$OUTPUT " " $ WRITE SYS$OUTPUT "DIR (To search for a file)" $ WRITE SYS$OUTPUT " " $ WRITE SYS$OUTPUT "EXIT (To exit this program)" $ WRITE SYS$OUTPUT " " $ WRITE SYS$OUTPUT "FETCH (To perform a BACKUP RESTORE operation)" $ WRITE SYS$OUTPUT " " $ WRITE SYS$OUTPUT "HELP (To read this text)" $ WRITE SYS$OUTPUT " " $ WRITE SYS$OUTPUT "LIST (To perform a BACKUP LIST operation)" $ GOTO COMMAND_LOOP $ ! $ FETCH: INQUIRE FILE "Filespec" $ INQUIRE SAVESET "Save set name" $ LINE := BACKUP/LOG 'DRIVE':'SAVESET'/SELECT='FILE' $ INQUIRE EXCLUDE "Enter any filespecs you want excluded" $ IF EXCLUDE .EQS. "" THEN GOTO L2 $ LINE := 'LINE'/EXCLUDE=('EXCLUDE') $ ! $ L2: INQUIRE/NOPUNC TO "Where do you want the file(s)? ([RET] for current directory)" $ IF TO .EQS. "" THEN GOTO REPLACE $ LINE := 'LINE' 'TO' $ GOTO L3 $ REPLACE: LINE := 'LINE' [] $ ! $ L3: INQUIRE/NOPUNC NEW "Create a new version if file already exists? " $ IF .NOT. NEW THEN GOTO NOT $ LINE := 'LINE'/NEW_VERSION $ ! $ NOT: LINE := 'LINE'/OWNER_UIC=ORIGINAL $ LINE $ GOTO COMMAND_LOOP $ ! $ LIST: INQUIRE SPEC "Filespec" $ INQUIRE SAVESET "Save set name" $ INQUIRE/NOPUNC OUTPUT "What do you want to call the list file? ([RET] for SYS$OUTPUT )" $ IF OUTPUT .EQS. "" THEN GOTO NOOUT $ LINE := BACKUP/LIST='OUTPUT' 'DRIVE':'SAVESET'/SELECT=('SPEC') $ GOTO L4 $ NOOUT: LINE := BACKUP/LIST 'DRIVE':'SAVESET'/SELECT=('SPEC') $ ! $ L4: INQUIRE EXCLUDE "Enter any filespecs you want excluded" $ IF EXCLUDE .EQS. "" THEN GOT L5 $ LINE := 'LINE'/EXCLUDE=('EXCLUDE') $ ! $ L5: LINE $ GOTO COMMAND_LOOP $ ! $ EXIT: $ DISMOUNT 'DRIVE' $ DEALLOCATE 'DRIVE' |
Assuming this command procedure is in a file named FETCH.COM, execute the command procedure by entering the following command:
$ @FETCH |
In addition to allocating and mounting functions, as in the previous
example, FETCH.COM prompts you for input. For example, it specifically
asks you if the tape is on the drive. Also note that FETCH.COM does a
BACKUP restore operation. It prompts you for specific options on the
restore operation. Finally, FETCH.COM explicitly dismounts your
magnetic tape volume and deallocates the drive after your task
completes.
8.11 Managing Disk Space
Disk space available for files is finite. You share responsibility with your users for making the best use of disk space.
The following sections explain disk quotas and describe some methods you can use to conserve and monitor disk space:
Method | Section |
---|---|
Establish disk quotas | Section 8.11.2 |
Purge files | Section 8.11.3 |
Set version limits on files | Section 8.11.4 |
Set file expiration dates | Section 8.11.5 |
Analyze and repair error conditions | Section 8.12 |
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 Table 8-17.
Item | Description |
---|---|
General Identifier or UIC | Identification code of a user entitled to maintain files on the volume |
Usage | Number of blocks on the volume taken up by the user's files |
Quota | Maximum number of blocks on the volume that the user's files can take up before an error message is issued |
Overdraft | Number of blocks over the quota that the user's files can take up |
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:
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.
8.11.2.1 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:
DISKQUOTA CREATE/DEVICE=device-spec |
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. |
DISKQUOTA MODIFY/DEVICE=device-spec/PERMQUOTA=value |
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. |
DISKQUOTA SHOW owner/DEVICE=device-spec |
$ MCR SYSMAN SYSMAN> SET ENVIRONMENT/CLUSTER SYSMAN> DISKQUOTA CREATE/DEVICE=DUA12: |
SYSMAN> DISKQUOTA MODIFY/DEVICE=DUA12: [0,0]/PERMQUOTA=3000 |
SYSMAN> DISKQUOTA SHOW [0,0]/DEVICE=DUA12: |
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:
The results of the SHOW QUOTA command depend on whether you have read access to the quota file:
|
$ SHOW QUOTA User [DOCUMENTATION,MALCOLM] has 2780 blocks used, 7220 available, of 10000 authorized and permitted overdraft of 500 blocks on DISK$ |
$ SHOW QUOTA/USER=[DOCUMENTATION,JONES]/DISK=XXX1: %SYSTEM-F-NODISKQUOTA, no disk quota entry for this UIC |
$ 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$ |
Previous | Next | Contents | Index |
privacy and legal statement | ||
6017PRO_036.HTML |