UNMOUNT — Remove a file system from the file hierarchy

Format

UNMOUNT FILESYSTEM(file_system_name)
        DRAIN | FORCE | IMMEDIATE | NORMAL | REMOUNT(RDWR|READ|SAMEMODE) | RESET

Description

The UNMOUNT command removes a file system from the file system hierarchy. The alias for this command is UMOUNT.

Be aware of these restrictions when using the UNMOUNT command.
  • A file system that has file systems mounted on it cannot be unmounted. Any child file systems must be unmounted first.
  • A file system cannot be explicitly remounted in the mode that the file system is already mounted in.

You must have mount authority before you can issue the UNMOUNT command. See the section on mount authority in z/OS UNIX System Services Planningz/OS UNIX System Services Planning.

Parameters

FILESYSTEM(file_system_name)
Specifies the name of the file system to be removed from the file system. The name supplied is changed to all uppercase characters. This operand is required.
file_system_name
The fully qualified name of the data set that contains the file system. The file system name supplied is changed to all uppercase characters.

Specify the name of file system exactly as it was specified when the file system was originally mounted. You can enclose it in single quotes, but they are not required.

If FILESYSTEM('''file_system_name''') is specified, the file system name will not be translated to uppercase.

DRAIN
Specifies that an unmount drain request is to be made. The system will wait for all use of the file system to be ended normally before the unmount request is processed or until another UNMOUNT command is issued.

UNMOUNT can be specified with IMMEDIATE to override a previous UNMOUNT DRAIN request for a file system. If this is used in the foreground, your TSO/E session waits until the UNMOUNT request has completed. <ATTN> (or <PA1>) does not terminate the command.

UNMOUNT DRAIN is not supported in a sysplex environment. If an UNMOUNT DRAIN is issued in a sysplex, the following behavior is exhibited:
  • If there is no activity in the file system, UNMOUNT DRAIN will perform the unmount, but it will behave like an UNMOUNT NORMAL.
  • If there is activity in the file system, UNMOUNT DRAIN will return a Return_value of -1 with Return_code EINVAL and Reason_code JrNotSupInSysplex.
FORCE
Specifies that the system is to unmount the file system immediately. Any users accessing files in the specified file system receive failing return codes. All data changes to files in the specified file system are saved, if possible. If the data changes to the files cannot be saved, the unmount request continues and data is lost.

An UNMOUNT IMMEDIATE request must be issued before you can request a UNMOUNT FORCE of a file system. Otherwise, UNMOUNT FORCE fails.

IMMEDIATE
Specifies that the system is to unmount the file system immediately. Any users accessing files in the specified file system receive failing return codes. All data changes to files in the specified file system are saved. If the data changes to files cannot be saved, the unmount request fails.
NORMAL
Specifies that if no user is accessing any of the files in the specified file system, the system processes the unmount request. Otherwise, the system rejects the unmount request. NORMAL is the default.
REMOUNT(RDWR|READ|SAMEMODE)
Specifies that the specified file system be remounted and its mount mode changed, if necessary. REMOUNT takes an optional argument of RDRW, READ, UNMOUNT, or SAMEMODE.
  • If REMOUNT is specified without any arguments, the mount mode is changed from RDWR to READ, or READ to RDWR.
  • If RDWR is specified and the current mode is READ, the file system is remounted in RDWR mode.
  • If READ is specified and the current mode is RDWR, the file system is remounted in READ mode.
  • If SAMEMODE is specified, the file system is remounted (internally unmounted and remounted) without changing the mount mode. You can use this option to attempt to regain use of a file system that had I/O errors.

REMOUNT is supported in a sysplex.

If a problem occurs with the remount, determine the failure, correct the problem, and try the remount again. The file system might not be available until the problems are corrected.

RESET
A reset request stops a previous UNMOUNT DRAIN request.

UNMOUNT RESET is not supported in a sysplex because UNMOUNT DRAIN is not supported in a sysplex environment (see the description for DRAIN).

Usage notes for UNMOUNT

  1. Start of changeWhen the UNMOUNT command completes, the unmount is complete on the owner system, and on the system where the unmount command was issued from, but not necessarily on the other systems in the sysplex. On those systems, the unmount completes asynchronously.End of change
  2. The /samples directory contain sample UNMOUNT commands (called unmountx).
  3. If you unmount a TFS file system, all data stored in that file system is discarded. For more information about TFS, see z/OS UNIX System Services Planning.
  4. The root file system can be unmounted, but the IMMED operand must be specified. Because unmounting the root stops all file system activity, a subsequent mount of a root file system should be done as soon as possible.
  5. While the root file system is unmounted, a dummy file system root named SYSROOT is displayed as the current root file system. During this time, any operation that requires a valid file system will fail. When the new root file system is subsequently mounted, you should terminate any currently dubbed users or issue a chdir using a full path name to the appropriate directory so that the users can access the new root file system.
  6. If the file system that you are unmounting is an NFS-supported file system, the UNMOUNT command may receive an EAGAIN return code if the request was made before an internal caching clock has expired. That is, there is a 60-second delay from last use before termination is possible. Try the request again.
  7. Currently a move of a file system that has open FIFOs causes all FIFOs to be marked stale. They must be closed and reopened. Rather than do this on a remount, a remount attempt of a file system with open FIFOs will be rejected with EINVAL, JrFIFOInFileSys. FIFOs break on move or remount because FIFOs are always function-shipped to the file system owner, regardless of the mount mode. For remount, although the owner does not change, the vfs_umounts on all systems in the sysplex result in the XPFS control blocks (XFS, Xnodes) being released. These blocks contain owner information. Rejecting remount if open FIFOs is not expected to impact customers, since remount is typically done on a read-only file system to switch it to RDWR, and then back to READ, and FIFOs are not useful in a read-only file system.

Return codes

0
Processing successful.
12
Processing unsuccessful. An error message has been issued.

Examples

  1. The following command specifies a normal unmount by default:
    UNMOUNT FILESYSTEM('HFS.WORKDS')
  2. Before you request a forced unmount of a file system, you must issue an immediate unmount request:
    UNMOUNT FILESYSTEM('HFS.WORKDS') IMMEDIATE
    UNMOUNT FILESYSTEM('HFS.WORKDS') FORCE
  3. To unconditionally change the mount mode of a file system:
    UNMOUNT FILESYSTEM(HFS.OMVS.BIN) REMOUNT
  4. To change the mount mode of a file system to read/write, provided it is currently read-only:
    UNMOUNT FILESYSTEM(HFS.OMVS.BIN) REMOUNT(RDWR)