CLOSE (Close Pack)

The CLOSE (Close Pack) command releases the label information for a disk or disk pack unit and logically detaches the unit from the system.

You can use the CLOSE command to bring a pack from an online state to an offline state. A disk is online to the system if all the following conditions are true:

  • The disk pack is mounted on a unit that has been logically connected to the system with the ACQUIRE (Acquire Resource) command.

  • The disk pack is mounted on a unit that has not been reserved with the UR (Unit Reserved) system command.

  • The disk pack has not been logically detached from the system with the CLOSE (Close Pack) or FREE (Free Resource) command.

  • The label and flat directory of the disk pack have been read successfully.

A disk pack is offline to a particular system if any of the previous criteria have not been met.

You can use the CLOSE command to prevent the system from using a particular disk pack. You can reserve the closed pack by using the UR (Unit Reserved) command, save the closed pack by using the SV (Save) command, or free the closed pack by using the FREE (Free Resource) command.

You cannot close a disk pack for any of the following reasons:

  • Files on that pack are open at the time you enter the command, unless you use the DS (Discontinue) option.

  • The pack family is the halt/load family.

  • The pack family is one of the overlay families.

  • The pack family is the log family.

  • The entire pack or the family base pack is in use by the MCP.

MCP tasks that use an entire pack include the following:

  • RY (Ready)

  • MIRROR CREATE

  • SQUASH (Consolidate Disk Allocation)

  • RES (Reserve)

  • DD (Duplicate Directory)

  • RC (Reconfigure Disk)

  • LB (Relabel Pack)

  • PG (Purge)

Use either the SHOWOPEN (Show Open Disk Files), PER (Peripheral Status), or OL (Display Label and Paths) command to check for open files and to identify the tasks that are using them. The SHOWOPEN command also indicates whether the family is the halt/load family, one of the overlay families, or the log family, and whether the entire base pack or family base pack is in use by the MCP, and it lists the files that are open on the disk and the tasks that are using those files. You can force a pack to close by using the :DS option if none of the open files is critical to the system.

A locking mechanism prevents multiple copies of programs from attempting to use the ACQUIRE (Acquire Resource), CLOSE (Close Pack), FREE (Free Resource), INITIALIZE (Initialize Disk), LB (Relabel Pack), PG (Purge), PG (Purge), and UR (Unit Reserved) commands to access the same device simultaneously. If one of these operations is already in progress when another command is issued to the same device, the command is rejected and the following message is displayed:

PK <unit> <command entered> COMMAND REJECTED BECAUSE ANOTHER
  COMMAND IS USING THIS UNIT.
Note: If the command is rejected, wait for the current command to complete and enter the command again.

The CLOSE command also performs the same functions for compact disk units.

Syntax

Explanation

CLOSE PK <unit number list>

CLOSE CD <unit number list>

Close the pack or compact disk unit specified by the unit number list.

If you want to verify that the disk pack or compact disk unit is closed, you can use the PER (Peripheral Status) command. If the PER command shows that the disk pack or compact disk unit is closed, you can use the RY (Ready) command to make the disk pack or compact disk unit available to the system again.

If the disk pack is mirrored, all members of the set are closed. In addition, the members are marked as matching which indicates that the entire set has been taken offline in an orderly fashion and are removed from the system mirror structures.

If a code file has been the subject of an SL (Support Library) or an RP (Resident Program) system command, the code file might appear as being in-use and be listed in response to a SHOWOPEN (Show Open Disk Files) system command. If no other files than these cause the pack to appear in-use, the pack is closed.

CLOSE PK <unit number> :DS

CLOSE CD <unit number> :DS

For use in emergency situations, clear all users from a pack and close the pack. The command attempts to discontinue (DS) all tasks that have files open to the pack or CD-ROM and then close the pack. Refer to  the SHOWOPEN (Show Open Disk Files) command for information about finding users of a pack. Note that it might still be impossible to close the pack if the MCP considers it to be in use.

If program termination was started but was not completed, the system displays the following message:

DS INITIATED BUT NOT COMPLETE

After the system displays this message, you can check the status of the pack by using the PER <unit number> command. The status of the pack should be BLASTED. You can then use the CLOSE <unit number> command to close the pack.

Examples

Example 1

This example closes a disk pack, checks the status of the pack, and readies the device for use:  

CLOSE PKO65
     PKO65 WILL BE CLOSED
     PKO65 UNIT CLOSED
PER PK
     -----PK STATUS------
        65*U  C L O S E D
RY PKO65
     PK065 WILL BE READY

Example 2

This example closes PK066 and cancels all queued I/O operations on that pack:

CLOSE PKO66:DS
     PKO66 WILL BE FORCIBLY CLOSED
     PKO66 UNIT CLOSED

Example 3

This example closes a CD unit, checks the status of the unit, and readies the device for use:

CLOSE CD 1302
     CD 1302 CLOSED
PER CD
       -----CD Status------
       1302       C L O S E D
RY CD 1302
   CD 1302 WILL BE READY

Considerations for Use

If any files are open on the specified disk pack, the CLOSE command without the DS option terminates with a UNIT IN USE message. The CLOSE command has no time limit for computing the number of open files; therefore, the system might seem unresponsive until the CLOSE command finishes or is terminated.

You can sometimes use the CLOSE command, followed by the RY (Ready) command, to clear a pack with a LABEL ERROR, because the MCP must attempt to reread the label (by itself, the RY command cannot resolve a label error). This technique works well if the label error was caused by a transient read error.

On cataloging systems, if you close a member of a nonvolumed family that is either a base pack or contains a duplicate directory, the time that the system takes to delete all the cataloging information for that family can be lengthy. In addition, the following message appears at intervals during the process:

DELETING CATALOG INFORMATION nn% <family name> [<serial number>]

Closing a mirrored set removes all information pertaining to that set from the mirroring structures of the MCP. This   includes information used by MDPF to replace or recreate members of the set. Any deferred creations pending in Assistant for a set that is closed are not initiated.