umount.2 (2010 09)
u
umount(2) umount(2)
NAME
umount(), umount2() - unmount a file system
SYNOPSIS
#include <sys/mount.h>
int umount(const char *name);
int umount2(const char *name, int flags);
DESCRIPTION
umount() requests that a previously mounted file system contained on the block special device
identified by name be unmounted.
umount2() requests that a previously mounted file system contained on the block special device
identified by name be unmounted in the manner described in flags .
name is a pointer to a path name.
flags is a bitmask of flags, specified in
<sys/mount.h>
, that are combined to describe the type of
unmount to be performed. Valid flags are:
MS_NORMAL perform a normal unmount
MS_FORCE perform a forced unmount
MS_NORMAL and MS_FORCE are mutually exclusive.
A forced unmount is one which will occur regardless of activity on the file system.
After unmounting the file system, the directory upon which the file system was mounted reverts to its
ordinary interpretation.
umount() and umount2() can also request that a file system mounted previously on the directory
identified by name be unmounted. After unmounting the file system, name reverts to its ordinary
interpretation.
umount() and umount2() can be invoked only by the user with the appropriate privilege.
NETWORKING FEATURES
NFS
path must indicate a directory name when unmounting an NFS file system.
RETURN VALUE
If successful,
umount() and umount2() return a value of 0. Otherwise, they return a value of −1
and set
errno to indicate the error.
ERRORS
umount() and umount2() fail if one or more of the following are true:
[EACCES] A component of the path prefix of name denies search permission.
[EBUSY] A file on name is busy.
[EFAULT] name points outside the allocated address space of the process. Reliable detection of this
error is implementation dependent.
[EINVAL] name is not mounted.
[EINVAL] flags is not a valid combination of flags.
[ELOOP] Too many symbolic links were encountered in translating the path name.
[ENAMETOOLONG]
name exceeds
PATH_MAX bytes, or a component of name exceeds NAME_MAX bytes
while _POSIX_NO_TRUNC is in effect.
[ENOENT] name does not exist.
[ENOENT] name is null.
[ENOSYS] A forced unmount was requested on a file system that does not support it.
HP-UX 11i Version 3: September 2010 − 1 − Hewlett-Packard Company 1