.\" Copyright (c) 1980, 1989 The Regents of the University of California.
.\" Redistribution and use in source and binary forms are permitted
.\" provided that the above copyright notice and this paragraph are
.\" duplicated in all such forms and that any documentation,
.\" advertising materials, and other materials related to such
.\" distribution and use acknowledge that the software was developed
.\" by the University of California, Berkeley. The name of the
.\" University may not be used to endorse or promote products derived
.\" from this software without specific prior written permission.
.\" THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR
.\" IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED
.\" WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
.\" @(#)mount.2 6.8 (Berkeley) %G%
mount, unmount \- mount or remove file system
mount(type, dir, flags, data)
announces to the system that a file system has
been mounted on the directory
following the mount, references to directory
the root directory on the newly mounted file system.
is a pointer to a null-terminated string
containing the appropriate path name
which must be a directory that already exists.
Its old contents are inaccessible while the
argument determines whether certain semantics should be
suppressed when accessing the file system:
The file system should be treated as read-only;
no writing is allowed (even by the super-user).
Physically write-protected and magnetic
tape file systems must be mounted read-only or
errors will occur when access times are updated,
explicit write is attempted.
Do not allow files to be executed from the file system.
Do not honor setuid or setgid bits on files when executing them.
Do not interpret special files on the file system.
All I/O to the file system should be done synchronously.
The flag M_UPDATE indicates that the mount command is being applied
to an already mounted file system.
This allows the mount flags to be changed without requiring
that the file system be unmounted and remounted.
Some file systems may not allow all flags to be changed.
most file systems will not allow a change from read-write to read-only.
argument defines the type of the file system.
The types of file systems known to the system are defined in
is a pointer to a structure that contains the type
specific arguments to mount.
The currently supported types of file systems and
their type specific data are:
.ta \w'struct 'u +\w'nfsv2fh_t 'u +\w'sockaddr_in *addr 'u
char *fspec; /* Block special file to mount */
struct sockaddr_in *addr; /* file server address */
nfsv2fh_t *fh; /* File handle to be mounted */
int wsize; /* write size in bytes */
int rsize; /* read size in bytes */
int timeo; /* initial timeout in 0.1 secs */
int retrans; /* times to retry send */
char *hostname; /* server's name */
char *name; /* name of backing process */
caddr_t base; /* base address of the file system */
u_long size; /* size of the file system */
announces to the system that the file system mounted at
is no longer to contain that file system.
The associated directory reverts to its ordinary interpretation.
argument may have the following values:
The unmount should fail if any files are active on the file system.
The file system should be forcibly unmounted even if files are
Active special devices continue to work,
but any further accesses to any other active files result in errors
even if the file system is later remounted.
returns 0 if the action occurred, \-1 if an error occurred.
does not exist or is not a directory.
file system, the mount can fail if the special device
specified in the ufs_args structure is
inaccessible, is not an appropriate file, or is already mounted.
mount can also fail if there are already too many
returns 0 if the action occurred; \-1 if an error occurred.
if there are active files in the mounted file system.
will fail when one of the following occurs:
The caller is not the super-user.
A component of a pathname exceeded 255 characters,
or the entire length of a path name exceeded 1023 characters.
Too many symbolic links were encountered in translating a pathname.
A component of \fIdir\fP does not exist.
A component of \fIname\fP is not a directory,
or a path prefix of \fIspecial\fP is not a directory.
A pathname contains a character with the high-order bit set.
Another process currently holds a reference to
\fIDir\fP points outside the process's allocated address space.
The following errors can occur for a
A component of ufs_args \fIfspec\fP does not exist.
The major device number of
is out of range (this indicates no device driver exists
for the associated hardware).
\fIFspec\fP is already mounted.
No space remains in the mount table.
The super block for the file system had a bad magic
number or an out of range block size.
Not enough memory was available to read the cylinder
group information for the file system.
An I/O error occurred while reading the super block or
cylinder group information.
\fIFspec\fP points outside the process's allocated address space.
The following errors can occur for a
timed out trying to contact the server.
Some part of the information described by nfs_args
points outside the process's allocated address space.
The following errors can occur for a
No space remains in the mount table.
The super block for the file system had a bad magic
number or an out of range block size.
Not enough memory was available to read the cylinder
group information for the file system.
An paging error occurred while reading the super block or
cylinder group information.
\fIName\fP points outside the process's allocated address space.
may fail with one of the following errors:
The caller is not the super-user.
A component of the path is not a directory.
The pathname contains a character with the high-order bit set.
A component of a pathname exceeded 255 characters,
or an entire path name exceeded 1023 characters.
Too many symbolic links were encountered in translating the pathname.
The requested directory is not in the mount table.
A process is holding a reference to a file located
An I/O error occurred while writing cached file system information.
\fIDir\fP points outside the process's allocated address space.
mount(8), umount(8), mfs(8)
Some of the error codes need translation to more obvious messages.