Jump to content United States-English
HP.com Home Products and Services Support and Drivers Solutions How to Buy
» Contact HP
More options
HP.com home
HP-UX Reference > U

umount(2)

HP-UX 11i Version 3: February 2007
» 

Technical documentation

» Feedback
Content starts here

 » Table of Contents

 » Index

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.

ENOTBLK

name is not a block special device.

ENOTDIR

A component of name is not a directory.

ENXIO

The device associated with name does not exist.

EPERM

The effective user ID of the process is not that of a user with appropriate privileges.

STANDARDS CONFORMANCE

umount(): SVID2, SVID3, XPG2

Printable version
Privacy statement Using this site means you accept its terms Feedback to webmaster
© 1983-2007 Hewlett-Packard Development Company, L.P.