xref: /freebsd/sbin/mount/mount.8 (revision 951122de0a1062504da6048883562530ec3c3c55)
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.\"
32c06fe0a0SPeter Wemm.\"     @(#)mount.8	8.8 (Berkeley) 6/16/94
33951122deSSteve Price.\"	$Id: mount.8,v 1.15 1997/03/11 12:27:58 peter Exp $
348fae3551SRodney W. Grimes.\"
35c06fe0a0SPeter Wemm.Dd June 16, 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
55951122deSSteve Price.Nm
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
79c06fe0a0SPeter WemmAll the filesystems described in
80c06fe0a0SPeter Wemm.Xr fstab 5
81c06fe0a0SPeter Wemmare mounted.
82c06fe0a0SPeter WemmExceptions are those marked as ``noauto'' or are excluded by the
83c06fe0a0SPeter Wemm.Fl t
84c06fe0a0SPeter Wemmflag (see below).
858fae3551SRodney W. Grimes.It Fl d
868fae3551SRodney W. GrimesCauses everything to be done except for the actual system call.
878fae3551SRodney W. GrimesThis option is useful in conjunction with the
888fae3551SRodney W. Grimes.Fl v
898fae3551SRodney W. Grimesflag to
908fae3551SRodney W. Grimesdetermine what the
91951122deSSteve Price.Nm
928fae3551SRodney W. Grimescommand is trying to do.
938fae3551SRodney W. Grimes.It Fl f
948fae3551SRodney W. GrimesForces the revocation of write access when trying to downgrade
951469eec8SDavid Greenmana filesystem mount status from read-write to read-only. Also
961469eec8SDavid Greenmanforces the R/W mount of an unclean filesystem (dangerous; use with
971469eec8SDavid Greenmancaution).
988fae3551SRodney W. Grimes.It Fl o
998fae3551SRodney W. GrimesOptions are specified with a
1008fae3551SRodney W. Grimes.Fl o
1018fae3551SRodney W. Grimesflag followed by a comma separated string of options.
1028fae3551SRodney W. GrimesThe following options are available:
1038fae3551SRodney W. Grimes.Bl -tag -width indent
1048fae3551SRodney W. Grimes.It async
1058fae3551SRodney W. GrimesAll
1068fae3551SRodney W. Grimes.Tn I/O
1078fae3551SRodney W. Grimesto the file system should be done asynchronously.
1088fae3551SRodney W. GrimesThis is a
1098fae3551SRodney W. Grimes.Em dangerous
1108fae3551SRodney W. Grimesflag to set,
1118fae3551SRodney W. Grimesand should not be used unless you are prepared to recreate the file
1128fae3551SRodney W. Grimessystem should your system crash.
1138fae3551SRodney W. Grimes.It force
1148fae3551SRodney W. GrimesThe same as
1158fae3551SRodney W. Grimes.Fl f ;
1168fae3551SRodney W. Grimesforces the revocation of write access when trying to downgrade
1171469eec8SDavid Greenmana filesystem mount status from read-write to read-only. Also
1181469eec8SDavid Greenmanforces the R/W mount of an unclean filesystem (dangerous; use with caution).
119fa947154SDavid Greenman.It noatime
120fa947154SDavid GreenmanDo not update the file access time when reading from a file. This option
121fa947154SDavid Greenmanis useful on filesystems where there are large numbers of files and
122fa947154SDavid Greenmanperformance is more critical than updating the file access time (which is
123fa947154SDavid Greenmanrarely ever important). This option is currently only supported on local
124fa947154SDavid Greenmanfilesystems.
125c06fe0a0SPeter Wemm.It noauto
126c06fe0a0SPeter WemmThis filesystem should be skipped when mount is run with the
127c06fe0a0SPeter Wemm.Fl a
128c06fe0a0SPeter Wemmflag.
1298fae3551SRodney W. Grimes.It nodev
1308fae3551SRodney W. GrimesDo not interpret character or block special devices on the file system.
1318fae3551SRodney W. GrimesThis option is useful for a server that has file systems containing
1328fae3551SRodney W. Grimesspecial devices for architectures other than its own.
1338fae3551SRodney W. Grimes.It noexec
1348fae3551SRodney W. GrimesDo not allow execution of any binaries on the mounted file system.
1358fae3551SRodney W. GrimesThis option is useful for a server that has file systems containing
1368fae3551SRodney W. Grimesbinaries for architectures other than its own.
1378fae3551SRodney W. Grimes.It nosuid
1388fae3551SRodney W. GrimesDo not allow set-user-identifier or set-group-identifier bits to take effect.
139b23472acSWolfram SchneiderNote: this option is worthless if a public available suid or sgid
140b23472acSWolfram Schneiderwrapper like
141951122deSSteve Price.Xr suidperl 1
142b23472acSWolfram Schneideris installed on your system.
1438fae3551SRodney W. Grimes.It rdonly
1448fae3551SRodney W. GrimesThe same as
1458fae3551SRodney W. Grimes.Fl r ;
1468fae3551SRodney W. Grimesmount the file system read-only (even the super-user may not write it).
1478fae3551SRodney W. Grimes.It sync
1488fae3551SRodney W. GrimesAll
1498fae3551SRodney W. Grimes.Tn I/O
1508fae3551SRodney W. Grimesto the file system should be done synchronously.
1518fae3551SRodney W. Grimes.It update
1528fae3551SRodney W. GrimesThe same as
1538fae3551SRodney W. Grimes.Fl u ;
1548fae3551SRodney W. Grimesindicate that the status of an already mounted file system should be changed.
1558fae3551SRodney W. Grimes.It union
1568fae3551SRodney W. GrimesCauses the namespace at the mount point to appear as the union
1578fae3551SRodney W. Grimesof the mounted filesystem root and the existing directory.
1588fae3551SRodney W. GrimesLookups will be done in the mounted filesystem first.
1598fae3551SRodney W. GrimesIf those operations fail due to a non-existent file the underlying
1608fae3551SRodney W. Grimesdirectory is then accessed.
1618fae3551SRodney W. GrimesAll creates are done in the mounted filesystem.
1628fae3551SRodney W. Grimes.El
1638fae3551SRodney W. Grimes.Pp
1648fae3551SRodney W. GrimesAny additional options specific to a filesystem type that is not
1658fae3551SRodney W. Grimesone of the internally known types (see the
1668fae3551SRodney W. Grimes.Fl t
1678fae3551SRodney W. Grimesoption) may be passed as a comma separated list; these options are
1688fae3551SRodney W. Grimesdistinguished by a leading
1698fae3551SRodney W. Grimes.Dq \&-
1708fae3551SRodney W. Grimes(dash).
1718fae3551SRodney W. GrimesOptions that take a value are specified using the syntax -option=value.
172951122deSSteve PriceFor example, the
173951122deSSteve Price.Nm
174951122deSSteve Pricecommand:
1758fae3551SRodney W. Grimes.Bd -literal -offset indent
1768fae3551SRodney W. Grimesmount -t mfs -o nosuid,-N,-s=4000 /dev/dk0b /tmp
1778fae3551SRodney W. Grimes.Ed
1788fae3551SRodney W. Grimes.Pp
1798fae3551SRodney W. Grimescauses
180951122deSSteve Price.Nm
1818fae3551SRodney W. Grimesto execute the equivalent of:
1828fae3551SRodney W. Grimes.Bd -literal -offset indent
1838fae3551SRodney W. Grimes/sbin/mount_mfs -o nosuid -N -s 4000 /dev/dk0b /tmp
1848fae3551SRodney W. Grimes.Ed
185a257a45eSJordan K. Hubbard.It Fl p
186a257a45eSJordan K. HubbardPrint mount information in fstab format. Implies also the
187a257a45eSJordan K. Hubbard.Fl v
188a257a45eSJordan K. Hubbardoption.
1898fae3551SRodney W. Grimes.It Fl r
1908fae3551SRodney W. GrimesThe file system is to be mounted read-only.
1918fae3551SRodney W. GrimesMount the file system read-only (even the super-user may not write it).
1928fae3551SRodney W. GrimesThe same as the
1938fae3551SRodney W. Grimes.Dq rdonly
1948fae3551SRodney W. Grimesargument to the
1958fae3551SRodney W. Grimes.Fl o
1968fae3551SRodney W. Grimesoption.
1978fae3551SRodney W. Grimes.It Fl t Ar "ufs \\*(Ba lfs \\*(Ba external type"
1988fae3551SRodney W. GrimesThe argument following the
1998fae3551SRodney W. Grimes.Fl t
2008fae3551SRodney W. Grimesis used to indicate the file system type.
2018fae3551SRodney W. GrimesThe type
2028fae3551SRodney W. Grimes.Ar ufs
2038fae3551SRodney W. Grimesis the default.
20493eb5567SGarrett WollmanThe
20593eb5567SGarrett Wollman.Fl t
20693eb5567SGarrett Wollmanoption can be used
2078fae3551SRodney W. Grimesto indicate that the actions should only be taken on
2088fae3551SRodney W. Grimesfilesystems of the specified type.
2098fae3551SRodney W. GrimesMore than one type may be specified in a comma separated list.
2108fae3551SRodney W. GrimesThe list of filesystem types can be prefixed with
2118fae3551SRodney W. Grimes.Dq no
2128fae3551SRodney W. Grimesto specify the filesystem types for which action should
2138fae3551SRodney W. Grimes.Em not
2148fae3551SRodney W. Grimesbe taken.
2158fae3551SRodney W. GrimesFor example, the
216951122deSSteve Price.Nm
2178fae3551SRodney W. Grimescommand:
2188fae3551SRodney W. Grimes.Bd -literal -offset indent
2198fae3551SRodney W. Grimesmount -a -t nonfs,mfs
2208fae3551SRodney W. Grimes.Ed
2218fae3551SRodney W. Grimes.Pp
2228fae3551SRodney W. Grimesmounts all filesystems except those of type
2238fae3551SRodney W. Grimes.Tn NFS
2248fae3551SRodney W. Grimesand
2258fae3551SRodney W. Grimes.Tn MFS .
2268fae3551SRodney W. Grimes.Pp
2278fae3551SRodney W. GrimesIf the type is not one of the internally known types,
228951122deSSteve Price.Nm
229951122deSSteve Pricewill attempt to execute a program in
2308fae3551SRodney W. Grimes.Pa /sbin/mount_ Ns Em XXX
2318fae3551SRodney W. Grimeswhere
2328fae3551SRodney W. Grimes.Em XXX
2338fae3551SRodney W. Grimesis replaced by the type name.
2348fae3551SRodney W. GrimesFor example, nfs filesystems are mounted by the program
2358fae3551SRodney W. Grimes.Pa /sbin/mount_nfs .
23693eb5567SGarrett Wollman.Pp
23793eb5567SGarrett WollmanMost filesystems will be dynamically loaded by their mount programs
23893eb5567SGarrett Wollmanif not already present in the kernel, using the
23993eb5567SGarrett Wollman.Xr vfsload 3
24093eb5567SGarrett Wollmansubroutine.  Because this mechanism requires writable temporary space,
24193eb5567SGarrett Wollmanthe filesystem type containing
24293eb5567SGarrett Wollman.Pa /tmp
24393eb5567SGarrett Wollmanmust be compiled into the kernel, and the filesystems containing
24493eb5567SGarrett Wollman.Pa /tmp
24593eb5567SGarrett Wollmanand
24693eb5567SGarrett Wollman.Pa /usr/bin/ld
24793eb5567SGarrett Wollmanmust be listed in
24893eb5567SGarrett Wollman.Pa /etc/fstab
24993eb5567SGarrett Wollmanbefore any filesystems which might be dynamically loaded.
2508fae3551SRodney W. Grimes.It Fl u
2518fae3551SRodney W. GrimesThe
2528fae3551SRodney W. Grimes.Fl u
2538fae3551SRodney W. Grimesflag indicates that the status of an already mounted file
2548fae3551SRodney W. Grimessystem should be changed.
2558fae3551SRodney W. GrimesAny of the options discussed above (the
2568fae3551SRodney W. Grimes.Fl o
2578fae3551SRodney W. Grimesoption)
2588fae3551SRodney W. Grimesmay be changed;
2598fae3551SRodney W. Grimesalso a file system can be changed from read-only to read-write
2608fae3551SRodney W. Grimesor vice versa.
2618fae3551SRodney W. GrimesAn attempt to change from read-write to read-only will fail if any
2628fae3551SRodney W. Grimesfiles on the filesystem are currently open for writing unless the
2638fae3551SRodney W. Grimes.Fl f
2648fae3551SRodney W. Grimesflag is also specified.
2658fae3551SRodney W. GrimesThe set of options is determined by first extracting the options
2668fae3551SRodney W. Grimesfor the file system from the
267951122deSSteve Price.Xr fstab 5
2688fae3551SRodney W. Grimestable,
2698fae3551SRodney W. Grimesthen applying any options specified by the
2708fae3551SRodney W. Grimes.Fl o
2718fae3551SRodney W. Grimesargument,
2728fae3551SRodney W. Grimesand finally applying the
2738fae3551SRodney W. Grimes.Fl r
2748fae3551SRodney W. Grimesor
2758fae3551SRodney W. Grimes.Fl w
2768fae3551SRodney W. Grimesoption.
2778fae3551SRodney W. Grimes.It Fl v
2788fae3551SRodney W. GrimesVerbose mode.
2798fae3551SRodney W. Grimes.It Fl w
2808fae3551SRodney W. GrimesThe file system object is to be read and write.
2818fae3551SRodney W. Grimes.Pp
2828fae3551SRodney W. GrimesThe options specific to NFS filesystems are described in the
2838fae3551SRodney W. Grimes.Xr mount_nfs 8
2848fae3551SRodney W. Grimesmanual page.
2858fae3551SRodney W. Grimes.Sh FILES
2868fae3551SRodney W. Grimes.Bl -tag -width /etc/fstab -compact
2878fae3551SRodney W. Grimes.It Pa /etc/fstab
2888fae3551SRodney W. Grimesfile system table
2898fae3551SRodney W. Grimes.El
2908fae3551SRodney W. Grimes.Sh SEE ALSO
2918fae3551SRodney W. Grimes.Xr mount 2 ,
29293eb5567SGarrett Wollman.Xr vfsload 3 ,
2938fae3551SRodney W. Grimes.Xr fstab 5 ,
2948fae3551SRodney W. Grimes.Xr mount_cd9660 8 ,
2958fae3551SRodney W. Grimes.Xr mount_fdesc 8 ,
2968fae3551SRodney W. Grimes.Xr mount_kernfs 8 ,
2978fae3551SRodney W. Grimes.Xr mount_lfs 8 ,
2988fae3551SRodney W. Grimes.Xr mount_mfs 8 ,
299677ab445SAndrey A. Chernov.Xr mount_msdos 8 ,
3008fae3551SRodney W. Grimes.Xr mount_nfs 8 ,
3018fae3551SRodney W. Grimes.Xr mount_null 8 ,
3028fae3551SRodney W. Grimes.Xr mount_portal 8 ,
3038fae3551SRodney W. Grimes.Xr mount_procfs 8 ,
3048fae3551SRodney W. Grimes.Xr mount_umap 8 ,
3058fae3551SRodney W. Grimes.Xr mount_union 8 ,
3068fae3551SRodney W. Grimes.Xr umount 8
3078fae3551SRodney W. Grimes.Sh BUGS
3088fae3551SRodney W. GrimesIt is possible for a corrupted file system to cause a crash.
3098fae3551SRodney W. Grimes.Sh HISTORY
3108fae3551SRodney W. GrimesA
311951122deSSteve Price.Nm
3128fae3551SRodney W. Grimescommand appeared in
313b8923d4cSWolfram Schneider.At v1 .
314