[ Previous | Next | Contents | Glossary | Home | Search ]
AIX Version 4.3 Base Operating System and Extensions Technical Reference, Volume 2

umount or uvmount Subroutine

Purpose

Removes a virtual file system from the file tree.

Library

Standard C Library (libc.a)

Syntax

int umount (Device)
char *Device;
#include <sys/vmount.h>
int uvmount (VirtualFileSystemID, Flag)
int VirtualFileSystemID;
int Flag;

Description

The umount and uvmount subroutines remove a virtual file system (VFS) from the file tree.

The umount subroutine unmounts only file systems mounted from a block device (a special file identified by its path to the block device).

In addition to local devices, the uvmount subroutine unmounts local or remote directories, identified by the VirtualFileSystemID parameter.

Only a calling process with root user authority or in the system group and having write access to the mount point can unmount a device, file and directory mount.

Parameters

Device The path name of the block device to be unmounted for the umount subroutine.
VirtualFileSystemID The unique identifier of the VFS to be unmounted for the uvmount subroutine. This value is returned when a VFS is created by the vmount subroutine and may subsequently be obtained by the mntctl subroutine. The VirtualFileSystemID is also reported in the stat subroutine st_vfs field.
Flag Specifies special action for the uvmount subroutine. Currently only one value is defined:
UVMNT_FORCE Force the unmount. This flag is ignored for device mounts.

Return Values

Upon successful completion a value of 0 is returned. Otherwise, a value of -1 is returned, and the errno global variable is set to indicate the error.

Error Codes

The uvmount subroutine fails if one of the following is true:

EPERM The calling process does not have write permission to the root of the VFS, the mounted object is a device or remote, and the calling process does not have root user authority.
EINVAL No VFS with the specified VirtualFileSystemID parameter exists.
EBUSY A device that is still in use is being unmounted.

The umount subroutine fails if one of the following is true:

EPERM The calling process does not have root user authority.
ENOENT The Device parameter does not exist.
ENOBLK The Device parameter is not a block device.
EINVAL The Device parameter is not mounted.
EINVAL The Device parameter is not local.
EBUSY A process is holding a reference to a file located on the file system.

The umount subroutine can be unsuccessful for other reasons. For a list of additional errors, see Appendix A, "Base Operating System Error Codes for Services That Require Path-Name Resolution."

Implementation Specifics

These subroutines are part of Base Operating System (BOS) Runtime.

Related Information

The mount subroutine.

The mount command, umount command.

Mounting Overview in AIX Version 4.3 System Management Guide: Operating System and Devices.

Files, Directories, and File Systems for Programmers in AIX Version 4.3 General Programming Concepts: Writing and Debugging Programs.

Understanding Mount Helpers in AIX Version 4.3 General Programming Concepts: Writing and Debugging Programs explains and examines the execution syntax of mount helpers.


[ Previous | Next | Contents | Glossary | Home | Search ]