umount (BPX1UMT, BPX4UMT) — Remove a virtual file system

Function

The umount callable service unmounts or remounts a virtual file system. That is, it removes a virtual file system from the file tree, or it remounts a virtual file system to the file tree.

Requirements

Operation Environment
Authorization: Supervisor or problem state, any PSW key
Dispatchable unit mode: Task
Cross memory mode: PASN = HASN
AMODE (BPX1UMT): 31-bit
AMODE (BPX4UMT): 64-bit
ASC mode: Primary mode
Interrupt status: Enabled for interrupts
Locks: Unlocked
Control parameters: All parameters must be addressable by the caller and in the primary address space.

Format

CALL BPX1UMT,(File_system_name,
              Flags,
              Return_value,
              Return_code,
              Reason_code)

AMODE 64 callers use BPX4UMT with the same parameters.

Parameters

File_system_name
Supplied parameter
Type:
Character string
Character set:
Printable characters
Length:
44 bytes

The name of a 44-character field that contains the file system that is to be unmounted. The file system name must be left-justified and padded with blanks.

Flags
Supplied parameter
Type:
Structure
Length:
Fullword

The name of a fullword binary field that contains the unmount options.

This field is mapped by the BPXYMTM macro. See BPXYMTM — Map the modes for mount and unmount for the contents of the macro.

Return_value
Returned parameter
Type:
Integer
Length:
Fullword

The name of a fullword in which the umount service returns 0 if the request is successful, or -1 if it is not successful.

Return_code
Returned parameter
Type:
Integer
Length:
Fullword
The name of a fullword in which the umount service stores the return code. The umount service returns Return_code only if Return_value is -1. See z/OS UNIX System Services Messages and Codes for a complete list of possible return code values. The umount service can return one of the following values in the Return_code parameter:
Return_code Explanation
EBUSY Honoring the request would require unmounting a file system that is still in use. The following reason codes can accompany the return code: JRFileSysWasReset, JRFsForceUmount, JRFsMustReset, JRFsParentFs, JRFsUnmountInProgress, JRIsFsRoot, and JRQuiesced.
EINTR The call was interrupted by a signal. The following reason code can accompany the return code: JRSigDuringWait.
EINVAL An incorrect parameter was specified. The file system name is not the name of a file system; an incorrect combination of flags was specified; a umount drain or remount request was specified in a sysplex; or an umount force was specified before an immediate umount was attempted. The following reason codes can accompany the return code: JRFileSysNotThere, JRInvalidParms, JRMustUmountImmed, JRQuiescing, JRNotSupInSysplex, JrRemntMode.
EPERM The calling process is not a superuser. The following reason code can accompany the return code: JRUserNotPrivileged.
Reason_code
Returned parameter
Type:
Integer
Length:
Fullword

The name of a fullword in which the umount service stores the reason code. The umount service returns Reason_code only if Return_value is -1. Reason_code further qualifies the Return_code value. For the reason codes, see z/OS UNIX System Services Messages and Codes.

Usage notes

  1. A file system that has file systems mounted on it can be remounted but cannot be unmounted. Before the file system can be can be unmounted, all children file systems must be unmounted first.
  2. A reset request can stop only an umount service drain request. It has no effect if it is issued when there is no umount request outstanding. Currently, umount service drain requests are not supported in a sysplex environment. If such a request is issued in a sysplex, the following behavior is exhibited:
    • If there is no activity in the file system, the drain request performs the unmount, but it behaves like a umount normal. (Where a normal request specifies that if no user is accessing any of the files in the specified file system, the system processes the umount request. Otherwise, the system rejects the umount request. This is the default.)
    • If there is activity in the file system, the drain request returns a Return_value of -1, with Return_code EINVAL and Reason_code JRNotSupInSysplex.
  3. A umount service request with no other options specified succeeds only if the unmount can be processed immediately. Otherwise, an EBUSY is returned.
  4. MTMREMOUNT is specified to change the mount mode between read-only and read/write. If neither MTMRO nor MTMRDWR is specified, the mode is set to the opposite of its current state. If a mode is specified, it must be the opposite of the current state.
  5. MTMSAMEMODE is specified to remount the file system without changing the mount mode. This function can be used to attempt to regain use of a file system that has had I/O errors. If MTMREAD or MTMRDWR is also specified, the mode specified must be the current mode.
  6. Before a file system is remounted (using any method other than MTMSAMEMODE), any open FIFO files must be closed, or the remount attempt will be rejected with EINVAL, JrFIFIinFileSys.
  7. If the file system that is to be unmounted is the root file system, the IMMED option must be specified.

Related services

mount (BPX1MNT) — Make a file system available

Characteristics and restrictions

In order to unmount a file system, the requester must be an authorized program, or must be running for a user with appropriate privileges (see Authorization).

Examples

See BPX1UMT (umount) example for an example using this callable service.