xref: /freebsd/sbin/mount/mount.8 (revision 8546f807e0deb9f796433d69382a48890b9cc200)
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
338546f807SSteve Price.\"	$Id: mount.8,v 1.20 1997/11/13 00:28:49 julian 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.
82fba1c154SSteve PriceExceptions are those marked as ``noauto'', excluded by the
83c06fe0a0SPeter Wemm.Fl t
84fba1c154SSteve Priceflag (see below), or if they are already mounted (except the
85fba1c154SSteve Priceroot filesystem which is always remounted to preserve
86fba1c154SSteve Pricetraditional single user mode behavior).
878fae3551SRodney W. Grimes.It Fl d
888fae3551SRodney W. GrimesCauses everything to be done except for the actual system call.
898fae3551SRodney W. GrimesThis option is useful in conjunction with the
908fae3551SRodney W. Grimes.Fl v
918fae3551SRodney W. Grimesflag to
928fae3551SRodney W. Grimesdetermine what the
93951122deSSteve Price.Nm
948fae3551SRodney W. Grimescommand is trying to do.
958fae3551SRodney W. Grimes.It Fl f
968fae3551SRodney W. GrimesForces the revocation of write access when trying to downgrade
971469eec8SDavid Greenmana filesystem mount status from read-write to read-only. Also
981469eec8SDavid Greenmanforces the R/W mount of an unclean filesystem (dangerous; use with
991469eec8SDavid Greenmancaution).
1008fae3551SRodney W. Grimes.It Fl o
1018fae3551SRodney W. GrimesOptions are specified with a
1028fae3551SRodney W. Grimes.Fl o
1038fae3551SRodney W. Grimesflag followed by a comma separated string of options.
1048fae3551SRodney W. GrimesThe following options are available:
1058fae3551SRodney W. Grimes.Bl -tag -width indent
1068fae3551SRodney W. Grimes.It async
1078fae3551SRodney W. GrimesAll
1088fae3551SRodney W. Grimes.Tn I/O
1098fae3551SRodney W. Grimesto the file system should be done asynchronously.
1108fae3551SRodney W. GrimesThis is a
1118fae3551SRodney W. Grimes.Em dangerous
1128fae3551SRodney W. Grimesflag to set,
1138fae3551SRodney W. Grimesand should not be used unless you are prepared to recreate the file
1148fae3551SRodney W. Grimessystem should your system crash.
1158fae3551SRodney W. Grimes.It force
1168fae3551SRodney W. GrimesThe same as
1178fae3551SRodney W. Grimes.Fl f ;
1188fae3551SRodney W. Grimesforces the revocation of write access when trying to downgrade
1191469eec8SDavid Greenmana filesystem mount status from read-write to read-only. Also
1201469eec8SDavid Greenmanforces the R/W mount of an unclean filesystem (dangerous; use with caution).
121fa947154SDavid Greenman.It noatime
122fa947154SDavid GreenmanDo not update the file access time when reading from a file. This option
123fa947154SDavid Greenmanis useful on filesystems where there are large numbers of files and
124fa947154SDavid Greenmanperformance is more critical than updating the file access time (which is
125fa947154SDavid Greenmanrarely ever important). This option is currently only supported on local
126fa947154SDavid Greenmanfilesystems.
127c06fe0a0SPeter Wemm.It noauto
128c06fe0a0SPeter WemmThis filesystem should be skipped when mount is run with the
129c06fe0a0SPeter Wemm.Fl a
130c06fe0a0SPeter Wemmflag.
13175b714acSKATO Takenori.It noclusterr
13275b714acSKATO TakenoriDisable read clustering.
13375b714acSKATO Takenori.It noclusterw
13475b714acSKATO TakenoriDisable write clustering.
1358fae3551SRodney W. Grimes.It nodev
1368fae3551SRodney W. GrimesDo not interpret character or block special devices on the file system.
1378fae3551SRodney W. GrimesThis option is useful for a server that has file systems containing
1388fae3551SRodney W. Grimesspecial devices for architectures other than its own.
1398fae3551SRodney W. Grimes.It noexec
1408fae3551SRodney W. GrimesDo not allow execution of any binaries on the mounted file system.
1418fae3551SRodney W. GrimesThis option is useful for a server that has file systems containing
1428fae3551SRodney W. Grimesbinaries for architectures other than its own.
1438fae3551SRodney W. Grimes.It nosuid
1448fae3551SRodney W. GrimesDo not allow set-user-identifier or set-group-identifier bits to take effect.
145b23472acSWolfram SchneiderNote: this option is worthless if a public available suid or sgid
146b23472acSWolfram Schneiderwrapper like
147951122deSSteve Price.Xr suidperl 1
148b23472acSWolfram Schneideris installed on your system.
1498fae3551SRodney W. Grimes.It rdonly
1508fae3551SRodney W. GrimesThe same as
1518fae3551SRodney W. Grimes.Fl r ;
1528fae3551SRodney W. Grimesmount the file system read-only (even the super-user may not write it).
1538fae3551SRodney W. Grimes.It sync
1548fae3551SRodney W. GrimesAll
1558fae3551SRodney W. Grimes.Tn I/O
1568fae3551SRodney W. Grimesto the file system should be done synchronously.
15752bf64c7SJulian Elischer.It suiddir
15852bf64c7SJulian ElischerA directory on the mounted filesystem will respond to the SUID bit
15952bf64c7SJulian Elischerbeing set, by setting the owner of any new files to be the same
16052bf64c7SJulian Elischeras the owner of the directory.
16152bf64c7SJulian ElischerNew directories will inherit the bit from their parents.
16252bf64c7SJulian ElischerExecute bits are removed from
16352bf64c7SJulian Elischerthe file, and it will not be given to root.
16452bf64c7SJulian Elischer.Pp
16552bf64c7SJulian ElischerThis feature is designed for use on fileservers serving PC users via
16652bf64c7SJulian Elischerftp, SAMBA, or netatalk. It provides security holes for shell users and as
16752bf64c7SJulian Elischersuch should not be used on shell machines, especially on home directories.
16852bf64c7SJulian ElischerThis option requires the SUIDDIR
16952bf64c7SJulian Elischeroption in the kernel to work. Only UFS filesystems support this option.
17052bf64c7SJulian ElischerSee
17152bf64c7SJulian Elischer.Xr chmod 2
17252bf64c7SJulian Elischerfor more information.
1738fae3551SRodney W. Grimes.It update
1748fae3551SRodney W. GrimesThe same as
1758fae3551SRodney W. Grimes.Fl u ;
1768fae3551SRodney W. Grimesindicate that the status of an already mounted file system should be changed.
1778fae3551SRodney W. Grimes.It union
1788fae3551SRodney W. GrimesCauses the namespace at the mount point to appear as the union
1798fae3551SRodney W. Grimesof the mounted filesystem root and the existing directory.
1808fae3551SRodney W. GrimesLookups will be done in the mounted filesystem first.
1818fae3551SRodney W. GrimesIf those operations fail due to a non-existent file the underlying
1828fae3551SRodney W. Grimesdirectory is then accessed.
1838fae3551SRodney W. GrimesAll creates are done in the mounted filesystem.
1848fae3551SRodney W. Grimes.El
1858fae3551SRodney W. Grimes.Pp
1868fae3551SRodney W. GrimesAny additional options specific to a filesystem type that is not
1878fae3551SRodney W. Grimesone of the internally known types (see the
1888fae3551SRodney W. Grimes.Fl t
1898fae3551SRodney W. Grimesoption) may be passed as a comma separated list; these options are
1908fae3551SRodney W. Grimesdistinguished by a leading
1918fae3551SRodney W. Grimes.Dq \&-
1928fae3551SRodney W. Grimes(dash).
1938fae3551SRodney W. GrimesOptions that take a value are specified using the syntax -option=value.
194951122deSSteve PriceFor example, the
195951122deSSteve Price.Nm
196951122deSSteve Pricecommand:
1978fae3551SRodney W. Grimes.Bd -literal -offset indent
1988fae3551SRodney W. Grimesmount -t mfs -o nosuid,-N,-s=4000 /dev/dk0b /tmp
1998fae3551SRodney W. Grimes.Ed
2008fae3551SRodney W. Grimes.Pp
2018fae3551SRodney W. Grimescauses
202951122deSSteve Price.Nm
2038fae3551SRodney W. Grimesto execute the equivalent of:
2048fae3551SRodney W. Grimes.Bd -literal -offset indent
2058fae3551SRodney W. Grimes/sbin/mount_mfs -o nosuid -N -s 4000 /dev/dk0b /tmp
2068fae3551SRodney W. Grimes.Ed
207a257a45eSJordan K. Hubbard.It Fl p
208a257a45eSJordan K. HubbardPrint mount information in fstab format. Implies also the
209a257a45eSJordan K. Hubbard.Fl v
210a257a45eSJordan K. Hubbardoption.
2118fae3551SRodney W. Grimes.It Fl r
2128fae3551SRodney W. GrimesThe file system is to be mounted read-only.
2138fae3551SRodney W. GrimesMount the file system read-only (even the super-user may not write it).
2148fae3551SRodney W. GrimesThe same as the
2158fae3551SRodney W. Grimes.Dq rdonly
2168fae3551SRodney W. Grimesargument to the
2178fae3551SRodney W. Grimes.Fl o
2188fae3551SRodney W. Grimesoption.
2198fae3551SRodney W. Grimes.It Fl t Ar "ufs \\*(Ba lfs \\*(Ba external type"
2208fae3551SRodney W. GrimesThe argument following the
2218fae3551SRodney W. Grimes.Fl t
2228fae3551SRodney W. Grimesis used to indicate the file system type.
2238fae3551SRodney W. GrimesThe type
2248fae3551SRodney W. Grimes.Ar ufs
2258fae3551SRodney W. Grimesis the default.
22693eb5567SGarrett WollmanThe
22793eb5567SGarrett Wollman.Fl t
22893eb5567SGarrett Wollmanoption can be used
2298fae3551SRodney W. Grimesto indicate that the actions should only be taken on
2308fae3551SRodney W. Grimesfilesystems of the specified type.
2318fae3551SRodney W. GrimesMore than one type may be specified in a comma separated list.
2328fae3551SRodney W. GrimesThe list of filesystem types can be prefixed with
2338fae3551SRodney W. Grimes.Dq no
2348fae3551SRodney W. Grimesto specify the filesystem types for which action should
2358fae3551SRodney W. Grimes.Em not
2368fae3551SRodney W. Grimesbe taken.
2378fae3551SRodney W. GrimesFor example, the
238951122deSSteve Price.Nm
2398fae3551SRodney W. Grimescommand:
2408fae3551SRodney W. Grimes.Bd -literal -offset indent
2418fae3551SRodney W. Grimesmount -a -t nonfs,mfs
2428fae3551SRodney W. Grimes.Ed
2438fae3551SRodney W. Grimes.Pp
2448fae3551SRodney W. Grimesmounts all filesystems except those of type
2458fae3551SRodney W. Grimes.Tn NFS
2468fae3551SRodney W. Grimesand
2478fae3551SRodney W. Grimes.Tn MFS .
2488fae3551SRodney W. Grimes.Pp
2498fae3551SRodney W. GrimesIf the type is not one of the internally known types,
250951122deSSteve Price.Nm
251951122deSSteve Pricewill attempt to execute a program in
2528fae3551SRodney W. Grimes.Pa /sbin/mount_ Ns Em XXX
2538fae3551SRodney W. Grimeswhere
2548fae3551SRodney W. Grimes.Em XXX
2558fae3551SRodney W. Grimesis replaced by the type name.
2568fae3551SRodney W. GrimesFor example, nfs filesystems are mounted by the program
2578fae3551SRodney W. Grimes.Pa /sbin/mount_nfs .
25893eb5567SGarrett Wollman.Pp
25993eb5567SGarrett WollmanMost filesystems will be dynamically loaded by their mount programs
26093eb5567SGarrett Wollmanif not already present in the kernel, using the
26193eb5567SGarrett Wollman.Xr vfsload 3
26293eb5567SGarrett Wollmansubroutine.  Because this mechanism requires writable temporary space,
26393eb5567SGarrett Wollmanthe filesystem type containing
26493eb5567SGarrett Wollman.Pa /tmp
26593eb5567SGarrett Wollmanmust be compiled into the kernel, and the filesystems containing
26693eb5567SGarrett Wollman.Pa /tmp
26793eb5567SGarrett Wollmanand
26893eb5567SGarrett Wollman.Pa /usr/bin/ld
26993eb5567SGarrett Wollmanmust be listed in
27093eb5567SGarrett Wollman.Pa /etc/fstab
27193eb5567SGarrett Wollmanbefore any filesystems which might be dynamically loaded.
2728fae3551SRodney W. Grimes.It Fl u
2738fae3551SRodney W. GrimesThe
2748fae3551SRodney W. Grimes.Fl u
2758fae3551SRodney W. Grimesflag indicates that the status of an already mounted file
2768fae3551SRodney W. Grimessystem should be changed.
2778fae3551SRodney W. GrimesAny of the options discussed above (the
2788fae3551SRodney W. Grimes.Fl o
2798fae3551SRodney W. Grimesoption)
2808fae3551SRodney W. Grimesmay be changed;
2818fae3551SRodney W. Grimesalso a file system can be changed from read-only to read-write
2828fae3551SRodney W. Grimesor vice versa.
2838fae3551SRodney W. GrimesAn attempt to change from read-write to read-only will fail if any
2848fae3551SRodney W. Grimesfiles on the filesystem are currently open for writing unless the
2858fae3551SRodney W. Grimes.Fl f
2868fae3551SRodney W. Grimesflag is also specified.
2878fae3551SRodney W. GrimesThe set of options is determined by first extracting the options
2888fae3551SRodney W. Grimesfor the file system from the
289951122deSSteve Price.Xr fstab 5
2908fae3551SRodney W. Grimestable,
2918fae3551SRodney W. Grimesthen applying any options specified by the
2928fae3551SRodney W. Grimes.Fl o
2938fae3551SRodney W. Grimesargument,
2948fae3551SRodney W. Grimesand finally applying the
2958fae3551SRodney W. Grimes.Fl r
2968fae3551SRodney W. Grimesor
2978fae3551SRodney W. Grimes.Fl w
2988fae3551SRodney W. Grimesoption.
2998fae3551SRodney W. Grimes.It Fl v
3008fae3551SRodney W. GrimesVerbose mode.
3018fae3551SRodney W. Grimes.It Fl w
3028fae3551SRodney W. GrimesThe file system object is to be read and write.
3038fae3551SRodney W. Grimes.Pp
3048fae3551SRodney W. GrimesThe options specific to NFS filesystems are described in the
3058fae3551SRodney W. Grimes.Xr mount_nfs 8
3068fae3551SRodney W. Grimesmanual page.
3076caa839dSJoerg Wunsch.Sh DIAGNOSTICS
3086caa839dSJoerg WunschVarious, most of them are self-explanatory.
3096caa839dSJoerg Wunsch.Pp
3106caa839dSJoerg Wunsch.Dl XXXXX filesystem is not available
3116caa839dSJoerg Wunsch.Pp
3126caa839dSJoerg WunschThe kernel doesn't support the respective filesystem type.  Note that
3136caa839dSJoerg Wunschsupport for a particular filesystem might be provided either on a static
3146caa839dSJoerg Wunsch(kernel compile-time), or dynamic basis (loaded as a kernel module by
3156caa839dSJoerg Wunsch.Xr modload 8 ).
3166caa839dSJoerg WunschNormally,
3176caa839dSJoerg Wunsch.Nm
3186caa839dSJoerg Wunschor its subprocesses attempt to dynamically load a filesystem module if
3196caa839dSJoerg Wunschit hasn't been configured statically, using
3206caa839dSJoerg Wunsch.Xr vfsload 3 .
3216caa839dSJoerg WunschIn this case, the above error message can also mean that you didn't
3226caa839dSJoerg Wunschhave permission to load the module.
3238fae3551SRodney W. Grimes.Sh FILES
3248fae3551SRodney W. Grimes.Bl -tag -width /etc/fstab -compact
3258fae3551SRodney W. Grimes.It Pa /etc/fstab
3268fae3551SRodney W. Grimesfile system table
3278fae3551SRodney W. Grimes.El
3288fae3551SRodney W. Grimes.Sh SEE ALSO
3298fae3551SRodney W. Grimes.Xr mount 2 ,
33093eb5567SGarrett Wollman.Xr vfsload 3 ,
3318fae3551SRodney W. Grimes.Xr fstab 5 ,
3328fae3551SRodney W. Grimes.Xr mount_cd9660 8 ,
3338546f807SSteve Price.Xr mount_devfs 8 ,
3348fae3551SRodney W. Grimes.Xr mount_fdesc 8 ,
3358fae3551SRodney W. Grimes.Xr mount_kernfs 8 ,
3368fae3551SRodney W. Grimes.Xr mount_lfs 8 ,
3378fae3551SRodney W. Grimes.Xr mount_mfs 8 ,
338677ab445SAndrey A. Chernov.Xr mount_msdos 8 ,
3398fae3551SRodney W. Grimes.Xr mount_nfs 8 ,
3408fae3551SRodney W. Grimes.Xr mount_null 8 ,
3418fae3551SRodney W. Grimes.Xr mount_portal 8 ,
3428fae3551SRodney W. Grimes.Xr mount_procfs 8 ,
3438fae3551SRodney W. Grimes.Xr mount_umap 8 ,
3448fae3551SRodney W. Grimes.Xr mount_union 8 ,
3458fae3551SRodney W. Grimes.Xr umount 8
3468fae3551SRodney W. Grimes.Sh BUGS
3478fae3551SRodney W. GrimesIt is possible for a corrupted file system to cause a crash.
3488fae3551SRodney W. Grimes.Sh HISTORY
3498fae3551SRodney W. GrimesA
350951122deSSteve Price.Nm
3518fae3551SRodney W. Grimescommand appeared in
352b8923d4cSWolfram Schneider.At v1 .
353