[OpenVMS] How To Dismount A Disk In A 'Mounted dismount' Status Any party granted access to the following copyrighted information (protected under Federal Copyright Laws), pursuant to a duly executed Compaq Service Agreement may, under the terms of such agreement copy all or selected portions of this information for internal use and distribution only. No other copying or distribution for any other purpose is authorized. Last Technical Review Date: Tue Feb 1 00:00:00 1994 Size: 325 lines. Copyright (c) Digital Equipment Corporation 1982, 1994. All rights reserved OP/SYS: OpenVMS VAX Versions 5.0 and above OpenVMS AXP Versions 1.0 and above COMPONENT: DCL "DISMOUNT" Command SOURCE: Digital Equipment Corporation OVERVIEW: When dismounting a disk volume, the dismount operation won't complete while there are open files or devices spooled to the volume. Prior to version 5.2 of OpenVMS, it is not possible to dismount volumes with swap or page files installed on them. If a DISMOUNT command is inadvertently issued against such a volume, the device will not be fully accessible again until the system has been rebooted. (This behavior is documented in the "VMS Version 5.2 Release Notes", Section 3.13.1.3.) This article describes the steps to take to remove references to a disk volume for versions of OpenVMS prior to V5.2 as well as for OpenVMS V5.2 and later. SYMPTOM: When dismounting a disk on a pre-V5.2 system, the DISMOUNT command gave no feedback if the device couldn't be dismounted right away. While the command appears to execute successfully, a 'SHOW DEVICE' of the disk shows the device status to be 'Mounted dismount', instead of 'Online' as expected. This indicates that the dismount operation has not completed. For example: $ SHOW DEVICE DUA0: Device Device Error Volume Free Trans Mnt Name Status Count Label Blocks Count Cnt CPU_A$DUA0: Mounted 0 TEST_DISK 176085 2 1 $ DISMOUNT DUA0: $ SHOW DEVICE DUA0: Device Device Error Volume Free Trans Mnt Name Status Count Label Blocks Count Cnt CPU_A$DUA0: Mounted dismount 0 TEST_DISK 176085 2 1 As of OpenVMS V5.2, the DISMOUNT command checks for open files before dismounting the volume. If open files are found, the DISMOUNT command issues a 'CANNOTDMT' warning message and (by default) does not dismount the volume. For example: $ DISMOUNT $10$DJA100: %DISM-W-CANNOTDMT, $10$DJA100: cannot be dismounted %DISM-W-INSSWPFIL, 4 swap or page files installed on volume %DISM-W-SPOOLEDEV, 3 devices spooled to volume %DISM-W-INSTIMAGE, 7 images installed on volume %DISM-W-USERFILES, 6 user files open on volume This behavior can be overridden with the qualifier /OVERRIDE=CHECKS. When this qualifier is used, the DISMOUNT command displays the above warning messages and issues the dismount against the volume. The device status becomes 'Mounted dismount' until all references to the volume are removed. SOLUTION: In order to dismount a disk volume (or allow a pending dismount operation to complete), all open files on the volume must be closed and all devices spooled to that volume must be despooled or spooled to another volume. Generally, there are four types of references to look for: o Swap or page files o Installed images o User files o Spooled devices Additionally, if you have PATHWORKS for VMS installed on your system, the "PCFS_SERVER" process can also have I/O channels assigned to the disk. The first three types of references involve open files on the volume. To see which files are open on a volume, the 'SHOW DEVICE/FILES' command may be used. For example: $ SHOW DEVICE/FILES $255$DUA103: Files accessed on device $255$DUA103: on 27-NOV-1989 17:18:26.14 Process name PID File name 00000000 [000000]INDEXF.SYS;1 00000000 [000000]QUOTA.SYS;1 00000000 [SYSFILES]PAGEFILE_SECONDARY.SYS;1 00000000 [UTLIB]XXX_UTILITY.EXE;7 USER1 2FE004F0 [USER1]PROGRAM_1.EXE;1 USER2 2FE0053B [USER2]MAIL.MAI;1 PAGE AND SWAP FILES: System-Owned Files (Process ID=0) with the Extension '.SYS'. The files INDEXF.SYS and QUOTA.SYS can remain open. Neither of these open files prevents a volume from being dismounted. Any remaining files with the extension .SYS are most likely installed secondary swap and page files. This can be verified with the DCL command 'SHOW MEMORY/FILES/FULL'. For example: $ SHOW MEMORY/FILES/FULL System Memory Resources on 27-NOV-1989 15:50:00.92 DISK$USER_DISK:[SYSFILES]PAGEFILE_SECONDARY.SYS Free Blocks 41000 Reservable Blocks 41000 Total Size (blocks) 41000 Paging file Number 3 Swap Usage (processes) 0 Paging Usage 0 This file is used exclusively for paging. . . . Before OpenVMS V5.2, swap and page files could not be closed. As of V5.2, page and swap files may be closed with the SYSGEN "DEINSTALL" command. For example: SYSGEN> DEINSTALL DISK$USER_DISK:PAGEFILE_SECONDARY.SYS/PAGEFILE For more information on this command, see "VMS Version 5.2 New Features Manual", Section 2.2.1. CAUTION: Deinstalling a Pagefile reportedly can cause the system to crash with a BADPAGFILD Bugcheck. Because of this, it is currently recommended that Pagefiles not be deinstalled. As an alternative, the system(s) with paging files in this disk can be rebooted, after ensuring that the paging files will not be reinstalled during system startup. Another article in the VMS database describes how deinstalling a pagefile causes a BADPAGFILD bugcheck. This article can be found using a search string of: Deinstallation Pagefile BADPAGFILD NOTE: This problem is expected to be corrected in a future release of OpenVMS. INSTALLED IMAGES: System-Owned Files (Process ID=0) with the Extension '.EXE'. This type of file is most likely an installed image. This can be checked by examining the installed-image list with the INSTALL Utility. For example: $ INSTALL LIST DISK$SYSTEM_DISK:.EXE ACMSBOOT;2 Open Hdr Prv ACMSBOOTC;2 Open Hdr . . . DISK$USER_DISK:.EXE XXX_UTILITY;7 Open Hdr Shar Prv Installed images may be removed with the INSTALL Utility. For example: $ INSTALL REMOVE $255$DUA103:[UTLIB]XXX_UTILITY CAUTION: When using the INSTALL commands REMOVE, DELETE, or REPLACE, do not specify a version number on the file name. Doing so incorrectly causes an I/O channel to be left open to the file. This, in turn, prevents the disk from being dismounted. Another article in the VMS database has more information on this topic. This article can be found using a search string of: INSTALL Replace Delete Remove File Open USER FILES: Process-owned files are normally closed when the processes accessing the files finish with them. To close these files, contact the users who own the processes and ask them to complete their work and close the files or logout. If this cannot be done, the process can be forced to exit with the command 'STOP/ID=process-id'. CAUTION: Issuing a STOP/ID command against a process does not permit a program to close files normally. As a result, I/O buffers may not be flushed or transactions written to a file. SPOOLED DEVICES: The fourth type of reference involves device spooling. When a device is spooled, an I/O channel is opened to the specified disk. In order to dismount the disk volume, the I/O channel must be closed. This is done by despooling the device or by spooling it to another volume. Note that on OpenVMS systems prior to V5.2, the DISMOUNT command does not identify the number of devices spooled to the disk volume. Before performing a time-consuming check for spooled devices, the Transaction and Mount Count for the device can be checked. If the device is ready to dismount, the Transaction Count and Mount Count will each be '1'. For example: $ SHOW DEVICE $255$DUA103: Device Device Error Volume Free Trans Mnt Name Status Count Label Blocks Count Cnt $255$DUA103: Mounted 0 TEST_DISK 186303 1 1 To despool or respool a device, the print queue associated with the spooled device must be stopped. The system startup command procedures may be examined to determine if a device is spooled to the volume that is being dismounted and to get the name of the queue used by the spooled device. Once the print queues that have been spooled to the disk volume are identified, the following should be done: 1. Prevent queued files from being lost by setting the queue to retain jobs on error, as follows: $ SET QUEUE/RETAIN=ERROR queue-name 2. Next, stop the queue while requeuing and placing the current job on hold: $ STOP/QUEUE/REQUEUE/HOLD queue-name 3. Finally, set the device no-spooled: $ SET DEVICE/NOSPOOLED device: The queue can now be restarted without losing any jobs in the queue or any files that have been spooled to the volume. If you do not want to wait until the volume is remounted to restart the queue, you can set the device to be spooled to a different volume and restart the queue immediately. NOTE: Some of the above commands or qualifiers may not be available on earlier versions of OpenVMS. PATHWORKS: The PATHWORKS "PCFS_SERVER" process can have channels open to a device. Under some circumstances, this may not be apparent from the output of the SHOW commands. One way to confirm whether or not the PCFS_SERVER process has an I/O channel open to a particular disk is to use SDA to check the open channels for that process. For example: $ SET PROCESS /PRIVILEGE=CMKRNL $ ANALYZE/SYSTEM SDA> SHOW SUMMARY . . . 202000A1 0021 PCFS_SERVER SYSTEM HIB 10 804D5C20 8291D600 . . SDA> SHOW PROCESS /CHANNEL /INDEX=21 Process index: 0021 Name: PCFS_SERVER Extended PID: 202000A1 ---------------------------------------------------------------- Channel Window Status Device/file accessed ------- ------ ------ -------------------- 00B0 809291F0 DUB2:[SYS0.PCSA]PCFS_ERROR.LOG;98 00C0 80946B50 DUB2:(21244,3,0) 00D0 00000000 NLA0: 00E0 8091F940 DUB2:[SYSCOMMON.SYSEXE]RIGHTSLIST.D 00F0 80924020 DUB2:(701,25,0) 0100 80925A60 DUB2:[SYSCOMMON.PCSA]PCFS$SERVICE_D . . . The following command is another way to determine what files PATHWORKS has open: $ PCSA PCSA_MANAGER> show file_server open_files If the disk you're dismounting shows up in this list, then the PCFS_SERVER process has an I/O channel open on that device. In that case, use the appropriate ADMIN/PC commands to stop the services on that volume or stop the server process. To perform a orderly shutdown of PATHWORKS, do this: $ PCSA STOP FILE_SERVER CONNECTIONS/ALL ! Stops the file server. $ PCSA STOP DISK_SERVER CONNECTIONS ! Stops the disk server. If the specific service name is know, use the command: $ PCSA STOP FILE_SERVER CONNECTIONS/SERVICE=xxxxxx where xxxxxx is the actual service name REFERENCES: "VMS Version 5.2 Release Notes", June 1989, AA-LB22B-TE. "VMS Version 5.2 New Features Manual", June 1989, AA-LA97B-TE.