216 lines
5.7 KiB
Groff
216 lines
5.7 KiB
Groff
'\"macro stdmacro
|
|
.if n .pH g2.mount @(#)mount 41.7 of 5/26/91
|
|
.\" Copyright 1991 UNIX System Laboratories, Inc.
|
|
.\" Copyright 1989, 1990 AT&T
|
|
.nr X
|
|
.if \nX=0 .ds x} mount 2 "" "\&"
|
|
.if \nX=1 .ds x} mount 2 ""
|
|
.if \nX=2 .ds x} mount 2 "" "\&"
|
|
.if \nX=3 .ds x} mount "" "" "\&"
|
|
.TH \*(x}
|
|
.SH NAME
|
|
\f4mount\f1 \- mount a file system
|
|
.Op c p a
|
|
.SH C SYNOPSIS
|
|
\f4#include <sys/types.h>\f1
|
|
.br
|
|
\f4#include <sys/mount.h>\f1
|
|
.br
|
|
.PP
|
|
.nf
|
|
\f4int mount (const char \(**spec, const char \(**dir, int mflag,
|
|
.../\(** char \(**fstyp, const char \(**dataptr, int datalen\(**/);\f1
|
|
.fi
|
|
.Op
|
|
.Op f
|
|
.SH FORTRAN SYNOPSIS
|
|
\f4integer \(**4 function mount (spec, dir, [ mflag, fstyp, [ data, datalen ] ])\f1
|
|
.br
|
|
\f4character \(** (\(**) spec, dir\f1
|
|
.br
|
|
\f4integer \(**4 mflag, fstyp\f1
|
|
.br
|
|
\f4integer \(**4 data, datalen\f1
|
|
.Op
|
|
.SH DESCRIPTION
|
|
\f4mount\fP
|
|
requests that a removable file system contained on the
|
|
block special file identified by
|
|
.I spec\^
|
|
be mounted on the directory identified by
|
|
.IR dir .
|
|
.I spec\^
|
|
and
|
|
.I dir\^
|
|
are pointers to
|
|
path names.
|
|
\f2fstyp\fP
|
|
is the file system type number.
|
|
The
|
|
\f4sysfs\fP(2)
|
|
system call can be used
|
|
to determine the file system type number.
|
|
If both the \f4MS_DATA\fP and \f4MS_FSS\fP flag bits of \f2mflag\f1
|
|
are off, the file system type defaults to the
|
|
root file system type. Only if either flag is on
|
|
is \f2fstyp\fP used to indicate the file system type.
|
|
.PP
|
|
If the \f4MS_DATA\fP flag is set in \f2mflag\f1
|
|
the system expects the \f2dataptr\f1 and \f2datalen\f1 arguments
|
|
to be present.
|
|
Together they describe a block of file-system specific data
|
|
at address \f2dataptr\f1 of length \f2datalen\f1.
|
|
This is interpreted by file-system specific code within the
|
|
operating system and its format depends on the file system type.
|
|
If a particular file system type does not require this data,
|
|
\f2dataptr\f1 and \f2datalen\f1 should both be zero.
|
|
Note that \f4MS_FSS\fP is obsolete and is ignored if \f4MS_DATA\fP is
|
|
also set, but if \f4MS_FSS\fP is set and \f4MS_DATA\fP is not, \f2dataptr\f1
|
|
and \f2datalen\f1 are both assumed to be zero.
|
|
.PP
|
|
After a successful call to \f4mount\fP, all references to the file
|
|
.I dir\^
|
|
refer to the root directory on the mounted file system.
|
|
.PP
|
|
The low-order bit of
|
|
.I mflag\^
|
|
is used to control write permission on the mounted file system:
|
|
if
|
|
\f4\&1\f1,
|
|
writing is forbidden;
|
|
otherwise writing is permitted according to individual file accessibility.
|
|
.PP
|
|
\f4mount\fP
|
|
may be invoked only by
|
|
a process with the super-user privilege.
|
|
It is intended for use only by the \f4mount\fP utility.
|
|
.PP
|
|
\f4mount\fP
|
|
fails if one or more of the following are true:
|
|
.TP 20
|
|
\f4EACCES\fP
|
|
Search permission is denied on a component of \f2dir\fP or \f2spec\fP.
|
|
.\".TP
|
|
.\"\f4ENOTDIR\fP
|
|
.\"\f2dir\fP is a multilevel directory; multilevel directories are
|
|
.\"supported only if the Enhanced Security Utilities are installed.
|
|
.TP
|
|
\f4EPERM\fP
|
|
The calling process does not have the super-user privilege.
|
|
.TP 20
|
|
\f4EBUSY\fP
|
|
.I dir\^
|
|
is currently mounted on, is someone's current working directory,
|
|
or is otherwise busy.
|
|
.TP
|
|
\f4EBUSY\fP
|
|
The device associated with
|
|
.I spec\^
|
|
is currently mounted.
|
|
.TP
|
|
\f4EBUSY\fP
|
|
There are no more
|
|
mount table entries.
|
|
.TP
|
|
\f4EFAULT\fP
|
|
.I spec\^,
|
|
.I dir\^,
|
|
or
|
|
.I datalen
|
|
points outside the allocated address space of the process.
|
|
.TP
|
|
\f4EINVAL\fP
|
|
The super block has an invalid magic number
|
|
or the \f2fstyp\fP is invalid.
|
|
.\" or \f2mflag\f1 is not valid.
|
|
.TP
|
|
\f4ELOOP\fP
|
|
Too many symbolic links were encountered in translating \f2spec\f1
|
|
or \f2dir\f1.
|
|
.TP
|
|
\f4ENAMETOOLONG\fP
|
|
The length of the \f2path\f1 argument exceeds {\f4PATH_MAX\f1}, or the
|
|
length of a \f2path\f1 component exceeds {\f4NAME_MAX\f1} while
|
|
\f4_POSIX_NO_TRUNC\f1 is in effect.
|
|
.TP
|
|
\f4ENOENT\fP
|
|
None of the named files exists or is a null pathname.
|
|
.TP
|
|
\f4ENOTDIR\fP
|
|
A component of a
|
|
path prefix
|
|
is not a directory.
|
|
.TP
|
|
\f4EREMOTE\fP
|
|
\f2spec\f1 is remote and cannot be mounted.
|
|
.TP
|
|
\f4ENOLINK\fP
|
|
\f2path\f1 points to a remote machine and
|
|
the link to that machine is no longer active.
|
|
.TP
|
|
\f4EMULTIHOP\fP
|
|
Components of \f2path\f1 require hopping to
|
|
multiple remote machines
|
|
and the file system type does not allow it.
|
|
.TP
|
|
\f4ETIMEDOUT\fP
|
|
A component of \f2path\f1
|
|
is located on a remote file system which is not available [see \f4intro\fP(2)].
|
|
.TP
|
|
\f4ENOTBLK\fP
|
|
.I spec\^
|
|
is not a block special device.
|
|
.TP
|
|
\f4ENXIO\fP
|
|
The device associated with
|
|
.I spec\^
|
|
does not exist.
|
|
.TP
|
|
\f4ENOTDIR\fP
|
|
.I dir\^
|
|
is not a directory.
|
|
.TP
|
|
\f4EROFS\fP
|
|
.I spec\^
|
|
is write protected and
|
|
.I mflag\^
|
|
requests write permission.
|
|
.TP
|
|
\f4ENOSPC\fP
|
|
The file system state in the super-block
|
|
is not \f4FsOKAY\fP and
|
|
.I mflag\^
|
|
requests write permission.
|
|
.TP
|
|
\f4E2BIG\fP
|
|
The file system's size parameters are larger than the size of
|
|
special device
|
|
.I spec.
|
|
Either \f4mkfs\fP(1M) was run on a different overlapping device or the
|
|
device has been changed with \f4fx\fP(1M) since \f4mkfs\fP was run.
|
|
.TP
|
|
\f4EFSCORRUPTED\fP
|
|
The filesystem has a corruption forcing failure of the mount.
|
|
.TP
|
|
\f4EWRONGFS\fP
|
|
The wrong filesystem type was supplied in \f2fstyp\f1, or there
|
|
is no filesystem on \f2spec\f1.
|
|
.SH "NOTES"
|
|
It is the responsibility of the caller to assure that the block size
|
|
of the device corresponds to the blocksize of the filesystem being
|
|
mounted. This is particularly important with CDROM devices, as
|
|
the default block size of the device can vary between 512 bytes and
|
|
2048 bytes. The \f4\mount\fP(1M) command manages this for
|
|
filesystems via \f4dks\fP(7M) \f4DIOCSELFLAGS\fP and \f4DIOCSELECT\fP ioctls.
|
|
.SH "SEE ALSO"
|
|
\f4fx\fP(1M), \f4mkfs\fP(1M), \f4mount\fP(1M),
|
|
\f4sysfs\fP(2), \f4umount\fP(2),
|
|
\f4dks\fP(7M),\f4fs\fP(4), \f4xfs\fP(4)
|
|
.SH "DIAGNOSTICS"
|
|
Upon successful completion a value of 0 is returned.
|
|
Otherwise, a value of \-1 is returned and
|
|
\f4errno\fP
|
|
is set to indicate the error.
|
|
.\" @(#)mount.2 2.0 of 8/15/84
|
|
.Ee
|