mount
Purpose
Mounts a file system.
Syntax
#include <sys/vmount.h>
int mount (dev, dir, mflag)
char *dev, *dir;
int mflag;
Description
The mount system call mounts a file system contained on
the block device (also called a special file) identified
by the dev parameter. The file system is mounted on the
directory identified by the dir parameter. The mount
system call can be used only by superuser.
The dev parameter and the dir parameter are pointers to
path names.
The mflag parameter defines various characteristics of
the object to be mounted. Possible values are:
MNT_READONLY Indicates that the object to be mounted
is read-only, and write access is not
allowed. If this value is not specified,
writing is permitted according to indi-
vidual file accessibility.
MNT_REMOVABLE Indicates that the object to be mounted
is a removable file system. Whenever
there are no active references to files
or directories on the file system, the
operating system forgets the content and
structure of the file system. The user
can remove the medium and replace it with
a different file system. All future ref-
erences to dir will refer to the file
system on the new medium.
After the file system is mounted, references to the path
name specified by the dir parameter refer to the root
directory on the mounted file system.
Return Value
Upon successful completion a value of 0 is returned. If
the mount system call fails, a value of -1 is returned
and errno is set to indicate the error.
Diagnostics
The mount system call fails if one or more of the fol-
lowing are true:
EPERM The effective user ID of the calling process
is not superuser.
ENOENT dev or dir does not exist.
ENOTBLK dev is not a block device.
ENXIO The device or driver for dev is not currently
configured.
ENOTDIR A component of a path prefix is not a direc-
tory.
ENOTDIR dir is not a directory.
ENOTDIR The path to the device being mounted crosses a
remote mount point.
EFAULT The dev or dir parameter &pointsout..
EBUSY dir is currently busy. For example, it may
some process's current directory, or a file
system may be mounted onto it.
EBUSY The device associated with dev is currently
mounted.
EBUSY There are no more mount table entries.
EINVAL The data on dev is not recognizable as a file
system. This usually means that it does not
contain a properly formatted super-block or,
if Distributed Services is installed on your
system, that dev or dir is on a remote node.
ENOMEM Either this node or the server does not have
enough memory available to service the
request.
E2BIG The length of the path pointed to by either
the dev or dir parameter is greater than the
value of MAXPATH.
Related Information
In this book: "umount," "uvmount," "vmount," and "fs."
The mount and umount commands in AIX Operating System
Commands Reference.