MOUNT(2,L) AIX Technical Reference MOUNT(2,L)
-------------------------------------------------------------------------------
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 the 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. A possible value is:
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 individual file
accessibility.
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.
If the Transparent Computing Facility is installed, separate copies of a
replicated file system must be mounted on the same directory and with the same
value of mflag. If the primary copy of the file system is not mounted, the
file system is treated as read-only.
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.
ERROR CONDITIONS
The mount system call fails if one or more of the following are true:
Processed November 7, 1990 MOUNT(2,L) 1
MOUNT(2,L) AIX Technical Reference MOUNT(2,L)
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 directory.
ENOTDIR dir is not a directory.
EFAULT The dev or dir parameter points to a location outside of the
process's allocated address space.
EBUSY dir is currently busy. For example, a file system may be mounted
onto it.
EBUSY The device associated with dev is currently mounted.
EBUSY The file system number corresponding to dev is in use by another
mounted device.
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.
ENAMETOOLONG
A component of the path parameter exceeded NAME_MAX characters or the
entire path parameter exceeded PATH_MAX characters.
ENOENT A symbolic link was named, but the file to which it refers does not
exist.
ELOOP A loop of symbolic links was detected.
EACCES Search permission is denied for a component of dev or dir.
EIO An I/O error occurred in performing the mount.
If the Transparent Computing Facility is installed on your system, mount can
also fail if one or more of the following are true:
ENOSTORE dev or dir is a name relative to the working directory, but no site
which stores this directory is currently up.
ENOSTORE A component of dir is replicated but not stored on any site which is
currently up.
EROFS An attempt was made to mount a copy of a replicated file system with
an mflag value which differed from that of the other currently
mounted copies.
Processed November 7, 1990 MOUNT(2,L) 2
MOUNT(2,L) AIX Technical Reference MOUNT(2,L)
ENLDEV dev is a remote device.
EXGFS An attempt was made to mount a file system whose file system number
was already in use in an inconsistent way. The problem is that
neither copy was replicated, the type of replication was not the same
for both file systems, or they were not mounted at the same mount
point.
EPBUSY An attempt was made to mount a copy of a replicated file system which
had a pack number that was already mounted.
RELATED INFORMATION
In this book: "umount, fumount" and "fs."
The mount and umount commands in AIX Operating System Commands Reference.
Processed November 7, 1990 MOUNT(2,L) 3