xref: /freebsd/sbin/mount/mount.8 (revision b7a1a0a5ff8895e6a5c9404d02357ac9e2eb8091)
1.\" Copyright (c) 1980, 1989, 1991, 1993
2.\"	The Regents of the University of California.  All rights reserved.
3.\"
4.\" Redistribution and use in source and binary forms, with or without
5.\" modification, are permitted provided that the following conditions
6.\" are met:
7.\" 1. Redistributions of source code must retain the above copyright
8.\"    notice, this list of conditions and the following disclaimer.
9.\" 2. Redistributions in binary form must reproduce the above copyright
10.\"    notice, this list of conditions and the following disclaimer in the
11.\"    documentation and/or other materials provided with the distribution.
12.\" 3. All advertising materials mentioning features or use of this software
13.\"    must display the following acknowledgement:
14.\"	This product includes software developed by the University of
15.\"	California, Berkeley and its contributors.
16.\" 4. Neither the name of the University nor the names of its contributors
17.\"    may be used to endorse or promote products derived from this software
18.\"    without specific prior written permission.
19.\"
20.\" THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
21.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
22.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
23.\" ARE DISCLAIMED.  IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
24.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
25.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
26.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
27.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
28.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
29.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
30.\" SUCH DAMAGE.
31.\"
32.\"     @(#)mount.8	8.7 (Berkeley) 3/27/94
33.\"
34.Dd March 27, 1994
35.Dt MOUNT 8
36.Os BSD 4
37.Sh NAME
38.Nm mount
39.Nd mount file systems
40.Sh SYNOPSIS
41.Nm mount
42.Op Fl adfruvw
43.Op Fl t Ar ufs | lfs | external_type
44.Nm mount
45.Op Fl dfruvw
46.Ar special | node
47.Nm mount
48.Op Fl dfruvw
49.Op Fl o Ar options
50.Op Fl t Ar ufs | lfs | external_type
51.Ar special node
52.Sh DESCRIPTION
53The
54.Nm mount
55command
56calls the
57.Xr mount 2
58system call to prepare and graft a
59.Ar "special device"
60or the remote node (rhost:path) on to the file system tree at the point
61.Ar node .
62If either
63.Ar special
64or
65.Ar node
66are not provided, the appropriate information is taken from the
67.Xr fstab 5
68file.
69.Pp
70The system maintains a list of currently mounted file systems.
71If no arguments are given to
72.Nm mount,
73this list is printed.
74.Pp
75The options are as follows:
76.Bl -tag -width indent
77.It Fl d
78Causes everything to be done except for the actual system call.
79This option is useful in conjunction with the
80.Fl v
81flag to
82determine what the
83.Nm mount
84command is trying to do.
85.It Fl f
86Forces the revocation of write access when trying to downgrade
87a filesystem mount status from read-write to read-only.
88.It Fl o
89Options are specified with a
90.Fl o
91flag followed by a comma separated string of options.
92The following options are available:
93.Bl -tag -width indent
94.It async
95All
96.Tn I/O
97to the file system should be done asynchronously.
98This is a
99.Em dangerous
100flag to set,
101and should not be used unless you are prepared to recreate the file
102system should your system crash.
103.It force
104The same as
105.Fl f ;
106forces the revocation of write access when trying to downgrade
107a filesystem mount status from read-write to read-only.
108.It nodev
109Do not interpret character or block special devices on the file system.
110This option is useful for a server that has file systems containing
111special devices for architectures other than its own.
112.It noexec
113Do not allow execution of any binaries on the mounted file system.
114This option is useful for a server that has file systems containing
115binaries for architectures other than its own.
116.It nosuid
117Do not allow set-user-identifier or set-group-identifier bits to take effect.
118.It rdonly
119The same as
120.Fl r ;
121mount the file system read-only (even the super-user may not write it).
122.It sync
123All
124.Tn I/O
125to the file system should be done synchronously.
126.It update
127The same as
128.Fl u ;
129indicate that the status of an already mounted file system should be changed.
130.It union
131Causes the namespace at the mount point to appear as the union
132of the mounted filesystem root and the existing directory.
133Lookups will be done in the mounted filesystem first.
134If those operations fail due to a non-existent file the underlying
135directory is then accessed.
136All creates are done in the mounted filesystem.
137.El
138.Pp
139Any additional options specific to a filesystem type that is not
140one of the internally known types (see the
141.Fl t
142option) may be passed as a comma separated list; these options are
143distinguished by a leading
144.Dq \&-
145(dash).
146Options that take a value are specified using the syntax -option=value.
147For example, the mount command:
148.Bd -literal -offset indent
149mount -t mfs -o nosuid,-N,-s=4000 /dev/dk0b /tmp
150.Ed
151.Pp
152causes
153.Nm mount
154to execute the equivalent of:
155.Bd -literal -offset indent
156/sbin/mount_mfs -o nosuid -N -s 4000 /dev/dk0b /tmp
157.Ed
158.It Fl r
159The file system is to be mounted read-only.
160Mount the file system read-only (even the super-user may not write it).
161The same as the
162.Dq rdonly
163argument to the
164.Fl o
165option.
166.It Fl t Ar "ufs \\*(Ba lfs \\*(Ba external type"
167The argument following the
168.Fl t
169is used to indicate the file system type.
170The type
171.Ar ufs
172is the default.
173The \fI-t\fP option can be used
174to indicate that the actions should only be taken on
175filesystems of the specified type.
176More than one type may be specified in a comma separated list.
177The list of filesystem types can be prefixed with
178.Dq no
179to specify the filesystem types for which action should
180.Em not
181be taken.
182For example, the
183.Nm mount
184command:
185.Bd -literal -offset indent
186mount -a -t nonfs,mfs
187.Ed
188.Pp
189mounts all filesystems except those of type
190.Tn NFS
191and
192.Tn MFS .
193.Pp
194If the type is not one of the internally known types,
195mount will attempt to execute a program in
196.Pa /sbin/mount_ Ns Em XXX
197where
198.Em XXX
199is replaced by the type name.
200For example, nfs filesystems are mounted by the program
201.Pa /sbin/mount_nfs .
202.It Fl u
203The
204.Fl u
205flag indicates that the status of an already mounted file
206system should be changed.
207Any of the options discussed above (the
208.Fl o
209option)
210may be changed;
211also a file system can be changed from read-only to read-write
212or vice versa.
213An attempt to change from read-write to read-only will fail if any
214files on the filesystem are currently open for writing unless the
215.Fl f
216flag is also specified.
217The set of options is determined by first extracting the options
218for the file system from the
219.Xr fstab
220table,
221then applying any options specified by the
222.Fl o
223argument,
224and finally applying the
225.Fl r
226or
227.Fl w
228option.
229.It Fl v
230Verbose mode.
231.It Fl w
232The file system object is to be read and write.
233.Pp
234The options specific to NFS filesystems are described in the
235.Xr mount_nfs 8
236manual page.
237.Sh FILES
238.Bl -tag -width /etc/fstab -compact
239.It Pa /etc/fstab
240file system table
241.El
242.Sh SEE ALSO
243.Xr mount 2 ,
244.Xr fstab 5 ,
245.Xr mount_cd9660 8 ,
246.Xr mount_fdesc 8 ,
247.Xr mount_kernfs 8 ,
248.Xr mount_lfs 8 ,
249.Xr mount_lofs 8 ,
250.Xr mount_mfs 8 ,
251.Xr mount_nfs 8 ,
252.Xr mount_null 8 ,
253.Xr mount_portal 8 ,
254.Xr mount_procfs 8 ,
255.Xr mount_umap 8 ,
256.Xr mount_union 8 ,
257.Xr umount 8
258.Sh BUGS
259It is possible for a corrupted file system to cause a crash.
260.Sh HISTORY
261A
262.Nm mount
263command appeared in
264.At v6 .
265