xref: /freebsd/sbin/mount/mount.8 (revision fa9471546de7b6c2f6ed5bcbe306cf52276b8c70)
18fae3551SRodney W. Grimes.\" Copyright (c) 1980, 1989, 1991, 1993
28fae3551SRodney W. Grimes.\"	The Regents of the University of California.  All rights reserved.
38fae3551SRodney W. Grimes.\"
48fae3551SRodney W. Grimes.\" Redistribution and use in source and binary forms, with or without
58fae3551SRodney W. Grimes.\" modification, are permitted provided that the following conditions
68fae3551SRodney W. Grimes.\" are met:
78fae3551SRodney W. Grimes.\" 1. Redistributions of source code must retain the above copyright
88fae3551SRodney W. Grimes.\"    notice, this list of conditions and the following disclaimer.
98fae3551SRodney W. Grimes.\" 2. Redistributions in binary form must reproduce the above copyright
108fae3551SRodney W. Grimes.\"    notice, this list of conditions and the following disclaimer in the
118fae3551SRodney W. Grimes.\"    documentation and/or other materials provided with the distribution.
128fae3551SRodney W. Grimes.\" 3. All advertising materials mentioning features or use of this software
138fae3551SRodney W. Grimes.\"    must display the following acknowledgement:
148fae3551SRodney W. Grimes.\"	This product includes software developed by the University of
158fae3551SRodney W. Grimes.\"	California, Berkeley and its contributors.
168fae3551SRodney W. Grimes.\" 4. Neither the name of the University nor the names of its contributors
178fae3551SRodney W. Grimes.\"    may be used to endorse or promote products derived from this software
188fae3551SRodney W. Grimes.\"    without specific prior written permission.
198fae3551SRodney W. Grimes.\"
208fae3551SRodney W. Grimes.\" THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
218fae3551SRodney W. Grimes.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
228fae3551SRodney W. Grimes.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
238fae3551SRodney W. Grimes.\" ARE DISCLAIMED.  IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
248fae3551SRodney W. Grimes.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
258fae3551SRodney W. Grimes.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
268fae3551SRodney W. Grimes.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
278fae3551SRodney W. Grimes.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
288fae3551SRodney W. Grimes.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
298fae3551SRodney W. Grimes.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
308fae3551SRodney W. Grimes.\" SUCH DAMAGE.
318fae3551SRodney W. Grimes.\"
328fae3551SRodney W. Grimes.\"     @(#)mount.8	8.7 (Berkeley) 3/27/94
33fa947154SDavid Greenman.\"	$Id: mount.8,v 1.10 1996/08/29 18:06:02 wosch Exp $
348fae3551SRodney W. Grimes.\"
358fae3551SRodney W. Grimes.Dd March 27, 1994
368fae3551SRodney W. Grimes.Dt MOUNT 8
378fae3551SRodney W. Grimes.Os BSD 4
388fae3551SRodney W. Grimes.Sh NAME
398fae3551SRodney W. Grimes.Nm mount
408fae3551SRodney W. Grimes.Nd mount file systems
418fae3551SRodney W. Grimes.Sh SYNOPSIS
428fae3551SRodney W. Grimes.Nm mount
43a257a45eSJordan K. Hubbard.Op Fl adfpruvw
448fae3551SRodney W. Grimes.Op Fl t Ar ufs | lfs | external_type
458fae3551SRodney W. Grimes.Nm mount
46a257a45eSJordan K. Hubbard.Op Fl dfpruvw
478fae3551SRodney W. Grimes.Ar special | node
488fae3551SRodney W. Grimes.Nm mount
49a257a45eSJordan K. Hubbard.Op Fl dfpruvw
508fae3551SRodney W. Grimes.Op Fl o Ar options
518fae3551SRodney W. Grimes.Op Fl t Ar ufs | lfs | external_type
528fae3551SRodney W. Grimes.Ar special node
538fae3551SRodney W. Grimes.Sh DESCRIPTION
548fae3551SRodney W. GrimesThe
558fae3551SRodney W. Grimes.Nm mount
568fae3551SRodney W. Grimescommand
578fae3551SRodney W. Grimescalls the
588fae3551SRodney W. Grimes.Xr mount 2
598fae3551SRodney W. Grimessystem call to prepare and graft a
608fae3551SRodney W. Grimes.Ar "special device"
618fae3551SRodney W. Grimesor the remote node (rhost:path) on to the file system tree at the point
628fae3551SRodney W. Grimes.Ar node .
638fae3551SRodney W. GrimesIf either
648fae3551SRodney W. Grimes.Ar special
658fae3551SRodney W. Grimesor
668fae3551SRodney W. Grimes.Ar node
678fae3551SRodney W. Grimesare not provided, the appropriate information is taken from the
688fae3551SRodney W. Grimes.Xr fstab 5
698fae3551SRodney W. Grimesfile.
708fae3551SRodney W. Grimes.Pp
718fae3551SRodney W. GrimesThe system maintains a list of currently mounted file systems.
728fae3551SRodney W. GrimesIf no arguments are given to
738fae3551SRodney W. Grimes.Nm mount,
748fae3551SRodney W. Grimesthis list is printed.
758fae3551SRodney W. Grimes.Pp
768fae3551SRodney W. GrimesThe options are as follows:
778fae3551SRodney W. Grimes.Bl -tag -width indent
78c4e95187SDavid Greenman.It Fl a
79c4e95187SDavid GreenmanCauses all filesystems listed in
80c4e95187SDavid Greenman.Pa /etc/fstab
81c4e95187SDavid Greenman(except those with the ``noauto'' option) to be mounted. This is normally
82c4e95187SDavid Greenmandone during system startup.
838fae3551SRodney W. Grimes.It Fl d
848fae3551SRodney W. GrimesCauses everything to be done except for the actual system call.
858fae3551SRodney W. GrimesThis option is useful in conjunction with the
868fae3551SRodney W. Grimes.Fl v
878fae3551SRodney W. Grimesflag to
888fae3551SRodney W. Grimesdetermine what the
898fae3551SRodney W. Grimes.Nm mount
908fae3551SRodney W. Grimescommand is trying to do.
918fae3551SRodney W. Grimes.It Fl f
928fae3551SRodney W. GrimesForces the revocation of write access when trying to downgrade
931469eec8SDavid Greenmana filesystem mount status from read-write to read-only. Also
941469eec8SDavid Greenmanforces the R/W mount of an unclean filesystem (dangerous; use with
951469eec8SDavid Greenmancaution).
968fae3551SRodney W. Grimes.It Fl o
978fae3551SRodney W. GrimesOptions are specified with a
988fae3551SRodney W. Grimes.Fl o
998fae3551SRodney W. Grimesflag followed by a comma separated string of options.
1008fae3551SRodney W. GrimesThe following options are available:
1018fae3551SRodney W. Grimes.Bl -tag -width indent
1028fae3551SRodney W. Grimes.It async
1038fae3551SRodney W. GrimesAll
1048fae3551SRodney W. Grimes.Tn I/O
1058fae3551SRodney W. Grimesto the file system should be done asynchronously.
1068fae3551SRodney W. GrimesThis is a
1078fae3551SRodney W. Grimes.Em dangerous
1088fae3551SRodney W. Grimesflag to set,
1098fae3551SRodney W. Grimesand should not be used unless you are prepared to recreate the file
1108fae3551SRodney W. Grimessystem should your system crash.
1118fae3551SRodney W. Grimes.It force
1128fae3551SRodney W. GrimesThe same as
1138fae3551SRodney W. Grimes.Fl f ;
1148fae3551SRodney W. Grimesforces the revocation of write access when trying to downgrade
1151469eec8SDavid Greenmana filesystem mount status from read-write to read-only. Also
1161469eec8SDavid Greenmanforces the R/W mount of an unclean filesystem (dangerous; use with caution).
117fa947154SDavid Greenman.It noatime
118fa947154SDavid GreenmanDo not update the file access time when reading from a file. This option
119fa947154SDavid Greenmanis useful on filesystems where there are large numbers of files and
120fa947154SDavid Greenmanperformance is more critical than updating the file access time (which is
121fa947154SDavid Greenmanrarely ever important). This option is currently only supported on local
122fa947154SDavid Greenmanfilesystems.
1238fae3551SRodney W. Grimes.It nodev
1248fae3551SRodney W. GrimesDo not interpret character or block special devices on the file system.
1258fae3551SRodney W. GrimesThis option is useful for a server that has file systems containing
1268fae3551SRodney W. Grimesspecial devices for architectures other than its own.
1278fae3551SRodney W. Grimes.It noexec
1288fae3551SRodney W. GrimesDo not allow execution of any binaries on the mounted file system.
1298fae3551SRodney W. GrimesThis option is useful for a server that has file systems containing
1308fae3551SRodney W. Grimesbinaries for architectures other than its own.
1318fae3551SRodney W. Grimes.It nosuid
1328fae3551SRodney W. GrimesDo not allow set-user-identifier or set-group-identifier bits to take effect.
133b23472acSWolfram SchneiderNote: this option is worthless if a public available suid or sgid
134b23472acSWolfram Schneiderwrapper like
135b23472acSWolfram Schneider.Xr suidperl
136b23472acSWolfram Schneideris installed on your system.
1378fae3551SRodney W. Grimes.It rdonly
1388fae3551SRodney W. GrimesThe same as
1398fae3551SRodney W. Grimes.Fl r ;
1408fae3551SRodney W. Grimesmount the file system read-only (even the super-user may not write it).
1418fae3551SRodney W. Grimes.It sync
1428fae3551SRodney W. GrimesAll
1438fae3551SRodney W. Grimes.Tn I/O
1448fae3551SRodney W. Grimesto the file system should be done synchronously.
1458fae3551SRodney W. Grimes.It update
1468fae3551SRodney W. GrimesThe same as
1478fae3551SRodney W. Grimes.Fl u ;
1488fae3551SRodney W. Grimesindicate that the status of an already mounted file system should be changed.
1498fae3551SRodney W. Grimes.It union
1508fae3551SRodney W. GrimesCauses the namespace at the mount point to appear as the union
1518fae3551SRodney W. Grimesof the mounted filesystem root and the existing directory.
1528fae3551SRodney W. GrimesLookups will be done in the mounted filesystem first.
1538fae3551SRodney W. GrimesIf those operations fail due to a non-existent file the underlying
1548fae3551SRodney W. Grimesdirectory is then accessed.
1558fae3551SRodney W. GrimesAll creates are done in the mounted filesystem.
1568fae3551SRodney W. Grimes.El
1578fae3551SRodney W. Grimes.Pp
1588fae3551SRodney W. GrimesAny additional options specific to a filesystem type that is not
1598fae3551SRodney W. Grimesone of the internally known types (see the
1608fae3551SRodney W. Grimes.Fl t
1618fae3551SRodney W. Grimesoption) may be passed as a comma separated list; these options are
1628fae3551SRodney W. Grimesdistinguished by a leading
1638fae3551SRodney W. Grimes.Dq \&-
1648fae3551SRodney W. Grimes(dash).
1658fae3551SRodney W. GrimesOptions that take a value are specified using the syntax -option=value.
1668fae3551SRodney W. GrimesFor example, the mount command:
1678fae3551SRodney W. Grimes.Bd -literal -offset indent
1688fae3551SRodney W. Grimesmount -t mfs -o nosuid,-N,-s=4000 /dev/dk0b /tmp
1698fae3551SRodney W. Grimes.Ed
1708fae3551SRodney W. Grimes.Pp
1718fae3551SRodney W. Grimescauses
1728fae3551SRodney W. Grimes.Nm mount
1738fae3551SRodney W. Grimesto execute the equivalent of:
1748fae3551SRodney W. Grimes.Bd -literal -offset indent
1758fae3551SRodney W. Grimes/sbin/mount_mfs -o nosuid -N -s 4000 /dev/dk0b /tmp
1768fae3551SRodney W. Grimes.Ed
177a257a45eSJordan K. Hubbard.It Fl p
178a257a45eSJordan K. HubbardPrint mount information in fstab format. Implies also the
179a257a45eSJordan K. Hubbard.Fl v
180a257a45eSJordan K. Hubbardoption.
1818fae3551SRodney W. Grimes.It Fl r
1828fae3551SRodney W. GrimesThe file system is to be mounted read-only.
1838fae3551SRodney W. GrimesMount the file system read-only (even the super-user may not write it).
1848fae3551SRodney W. GrimesThe same as the
1858fae3551SRodney W. Grimes.Dq rdonly
1868fae3551SRodney W. Grimesargument to the
1878fae3551SRodney W. Grimes.Fl o
1888fae3551SRodney W. Grimesoption.
1898fae3551SRodney W. Grimes.It Fl t Ar "ufs \\*(Ba lfs \\*(Ba external type"
1908fae3551SRodney W. GrimesThe argument following the
1918fae3551SRodney W. Grimes.Fl t
1928fae3551SRodney W. Grimesis used to indicate the file system type.
1938fae3551SRodney W. GrimesThe type
1948fae3551SRodney W. Grimes.Ar ufs
1958fae3551SRodney W. Grimesis the default.
19693eb5567SGarrett WollmanThe
19793eb5567SGarrett Wollman.Fl t
19893eb5567SGarrett Wollmanoption can be used
1998fae3551SRodney W. Grimesto indicate that the actions should only be taken on
2008fae3551SRodney W. Grimesfilesystems of the specified type.
2018fae3551SRodney W. GrimesMore than one type may be specified in a comma separated list.
2028fae3551SRodney W. GrimesThe list of filesystem types can be prefixed with
2038fae3551SRodney W. Grimes.Dq no
2048fae3551SRodney W. Grimesto specify the filesystem types for which action should
2058fae3551SRodney W. Grimes.Em not
2068fae3551SRodney W. Grimesbe taken.
2078fae3551SRodney W. GrimesFor example, the
2088fae3551SRodney W. Grimes.Nm mount
2098fae3551SRodney W. Grimescommand:
2108fae3551SRodney W. Grimes.Bd -literal -offset indent
2118fae3551SRodney W. Grimesmount -a -t nonfs,mfs
2128fae3551SRodney W. Grimes.Ed
2138fae3551SRodney W. Grimes.Pp
2148fae3551SRodney W. Grimesmounts all filesystems except those of type
2158fae3551SRodney W. Grimes.Tn NFS
2168fae3551SRodney W. Grimesand
2178fae3551SRodney W. Grimes.Tn MFS .
2188fae3551SRodney W. Grimes.Pp
2198fae3551SRodney W. GrimesIf the type is not one of the internally known types,
2208fae3551SRodney W. Grimesmount will attempt to execute a program in
2218fae3551SRodney W. Grimes.Pa /sbin/mount_ Ns Em XXX
2228fae3551SRodney W. Grimeswhere
2238fae3551SRodney W. Grimes.Em XXX
2248fae3551SRodney W. Grimesis replaced by the type name.
2258fae3551SRodney W. GrimesFor example, nfs filesystems are mounted by the program
2268fae3551SRodney W. Grimes.Pa /sbin/mount_nfs .
22793eb5567SGarrett Wollman.Pp
22893eb5567SGarrett WollmanMost filesystems will be dynamically loaded by their mount programs
22993eb5567SGarrett Wollmanif not already present in the kernel, using the
23093eb5567SGarrett Wollman.Xr vfsload 3
23193eb5567SGarrett Wollmansubroutine.  Because this mechanism requires writable temporary space,
23293eb5567SGarrett Wollmanthe filesystem type containing
23393eb5567SGarrett Wollman.Pa /tmp
23493eb5567SGarrett Wollmanmust be compiled into the kernel, and the filesystems containing
23593eb5567SGarrett Wollman.Pa /tmp
23693eb5567SGarrett Wollmanand
23793eb5567SGarrett Wollman.Pa /usr/bin/ld
23893eb5567SGarrett Wollmanmust be listed in
23993eb5567SGarrett Wollman.Pa /etc/fstab
24093eb5567SGarrett Wollmanbefore any filesystems which might be dynamically loaded.
2418fae3551SRodney W. Grimes.It Fl u
2428fae3551SRodney W. GrimesThe
2438fae3551SRodney W. Grimes.Fl u
2448fae3551SRodney W. Grimesflag indicates that the status of an already mounted file
2458fae3551SRodney W. Grimessystem should be changed.
2468fae3551SRodney W. GrimesAny of the options discussed above (the
2478fae3551SRodney W. Grimes.Fl o
2488fae3551SRodney W. Grimesoption)
2498fae3551SRodney W. Grimesmay be changed;
2508fae3551SRodney W. Grimesalso a file system can be changed from read-only to read-write
2518fae3551SRodney W. Grimesor vice versa.
2528fae3551SRodney W. GrimesAn attempt to change from read-write to read-only will fail if any
2538fae3551SRodney W. Grimesfiles on the filesystem are currently open for writing unless the
2548fae3551SRodney W. Grimes.Fl f
2558fae3551SRodney W. Grimesflag is also specified.
2568fae3551SRodney W. GrimesThe set of options is determined by first extracting the options
2578fae3551SRodney W. Grimesfor the file system from the
2588fae3551SRodney W. Grimes.Xr fstab
2598fae3551SRodney W. Grimestable,
2608fae3551SRodney W. Grimesthen applying any options specified by the
2618fae3551SRodney W. Grimes.Fl o
2628fae3551SRodney W. Grimesargument,
2638fae3551SRodney W. Grimesand finally applying the
2648fae3551SRodney W. Grimes.Fl r
2658fae3551SRodney W. Grimesor
2668fae3551SRodney W. Grimes.Fl w
2678fae3551SRodney W. Grimesoption.
2688fae3551SRodney W. Grimes.It Fl v
2698fae3551SRodney W. GrimesVerbose mode.
2708fae3551SRodney W. Grimes.It Fl w
2718fae3551SRodney W. GrimesThe file system object is to be read and write.
2728fae3551SRodney W. Grimes.Pp
2738fae3551SRodney W. GrimesThe options specific to NFS filesystems are described in the
2748fae3551SRodney W. Grimes.Xr mount_nfs 8
2758fae3551SRodney W. Grimesmanual page.
2768fae3551SRodney W. Grimes.Sh FILES
2778fae3551SRodney W. Grimes.Bl -tag -width /etc/fstab -compact
2788fae3551SRodney W. Grimes.It Pa /etc/fstab
2798fae3551SRodney W. Grimesfile system table
2808fae3551SRodney W. Grimes.El
2818fae3551SRodney W. Grimes.Sh SEE ALSO
2828fae3551SRodney W. Grimes.Xr mount 2 ,
28393eb5567SGarrett Wollman.Xr vfsload 3 ,
2848fae3551SRodney W. Grimes.Xr fstab 5 ,
2858fae3551SRodney W. Grimes.Xr mount_cd9660 8 ,
2868fae3551SRodney W. Grimes.Xr mount_fdesc 8 ,
2878fae3551SRodney W. Grimes.Xr mount_kernfs 8 ,
2888fae3551SRodney W. Grimes.Xr mount_lfs 8 ,
2898fae3551SRodney W. Grimes.Xr mount_mfs 8 ,
2908fae3551SRodney W. Grimes.Xr mount_nfs 8 ,
2918fae3551SRodney W. Grimes.Xr mount_null 8 ,
2928fae3551SRodney W. Grimes.Xr mount_portal 8 ,
2938fae3551SRodney W. Grimes.Xr mount_procfs 8 ,
2948fae3551SRodney W. Grimes.Xr mount_umap 8 ,
2958fae3551SRodney W. Grimes.Xr mount_union 8 ,
2968fae3551SRodney W. Grimes.Xr umount 8
2978fae3551SRodney W. Grimes.Sh BUGS
2988fae3551SRodney W. GrimesIt is possible for a corrupted file system to cause a crash.
2998fae3551SRodney W. Grimes.Sh HISTORY
3008fae3551SRodney W. GrimesA
3018fae3551SRodney W. Grimes.Nm mount
3028fae3551SRodney W. Grimescommand appeared in
303b8923d4cSWolfram Schneider.At v1 .
304