xref: /freebsd/sbin/mount/mount.8 (revision 0de89efe5c443f213c7ea28773ef2dc6cf3af2ed)
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.8 (Berkeley) 6/16/94
33.\"	$Id: mount.8,v 1.18 1997/08/24 21:02:48 steve Exp $
34.\"
35.Dd June 16, 1994
36.Dt MOUNT 8
37.Os BSD 4
38.Sh NAME
39.Nm mount
40.Nd mount file systems
41.Sh SYNOPSIS
42.Nm mount
43.Op Fl adfpruvw
44.Op Fl t Ar ufs | lfs | external_type
45.Nm mount
46.Op Fl dfpruvw
47.Ar special | node
48.Nm mount
49.Op Fl dfpruvw
50.Op Fl o Ar options
51.Op Fl t Ar ufs | lfs | external_type
52.Ar special node
53.Sh DESCRIPTION
54The
55.Nm
56command
57calls the
58.Xr mount 2
59system call to prepare and graft a
60.Ar "special device"
61or the remote node (rhost:path) on to the file system tree at the point
62.Ar node .
63If either
64.Ar special
65or
66.Ar node
67are not provided, the appropriate information is taken from the
68.Xr fstab 5
69file.
70.Pp
71The system maintains a list of currently mounted file systems.
72If no arguments are given to
73.Nm mount ,
74this list is printed.
75.Pp
76The options are as follows:
77.Bl -tag -width indent
78.It Fl a
79All the filesystems described in
80.Xr fstab 5
81are mounted.
82Exceptions are those marked as ``noauto'', excluded by the
83.Fl t
84flag (see below), or if they are already mounted (except the
85root filesystem which is always remounted to preserve
86traditional single user mode behavior).
87.It Fl d
88Causes everything to be done except for the actual system call.
89This option is useful in conjunction with the
90.Fl v
91flag to
92determine what the
93.Nm
94command is trying to do.
95.It Fl f
96Forces the revocation of write access when trying to downgrade
97a filesystem mount status from read-write to read-only. Also
98forces the R/W mount of an unclean filesystem (dangerous; use with
99caution).
100.It Fl o
101Options are specified with a
102.Fl o
103flag followed by a comma separated string of options.
104The following options are available:
105.Bl -tag -width indent
106.It async
107All
108.Tn I/O
109to the file system should be done asynchronously.
110This is a
111.Em dangerous
112flag to set,
113and should not be used unless you are prepared to recreate the file
114system should your system crash.
115.It force
116The same as
117.Fl f ;
118forces the revocation of write access when trying to downgrade
119a filesystem mount status from read-write to read-only. Also
120forces the R/W mount of an unclean filesystem (dangerous; use with caution).
121.It noatime
122Do not update the file access time when reading from a file. This option
123is useful on filesystems where there are large numbers of files and
124performance is more critical than updating the file access time (which is
125rarely ever important). This option is currently only supported on local
126filesystems.
127.It noauto
128This filesystem should be skipped when mount is run with the
129.Fl a
130flag.
131.It noclusterr
132Disable read clustering.
133.It noclusterw
134Disable write clustering.
135.It nodev
136Do not interpret character or block special devices on the file system.
137This option is useful for a server that has file systems containing
138special devices for architectures other than its own.
139.It noexec
140Do not allow execution of any binaries on the mounted file system.
141This option is useful for a server that has file systems containing
142binaries for architectures other than its own.
143.It nosuid
144Do not allow set-user-identifier or set-group-identifier bits to take effect.
145Note: this option is worthless if a public available suid or sgid
146wrapper like
147.Xr suidperl 1
148is installed on your system.
149.It rdonly
150The same as
151.Fl r ;
152mount the file system read-only (even the super-user may not write it).
153.It sync
154All
155.Tn I/O
156to the file system should be done synchronously.
157.It update
158The same as
159.Fl u ;
160indicate that the status of an already mounted file system should be changed.
161.It union
162Causes the namespace at the mount point to appear as the union
163of the mounted filesystem root and the existing directory.
164Lookups will be done in the mounted filesystem first.
165If those operations fail due to a non-existent file the underlying
166directory is then accessed.
167All creates are done in the mounted filesystem.
168.El
169.Pp
170Any additional options specific to a filesystem type that is not
171one of the internally known types (see the
172.Fl t
173option) may be passed as a comma separated list; these options are
174distinguished by a leading
175.Dq \&-
176(dash).
177Options that take a value are specified using the syntax -option=value.
178For example, the
179.Nm
180command:
181.Bd -literal -offset indent
182mount -t mfs -o nosuid,-N,-s=4000 /dev/dk0b /tmp
183.Ed
184.Pp
185causes
186.Nm
187to execute the equivalent of:
188.Bd -literal -offset indent
189/sbin/mount_mfs -o nosuid -N -s 4000 /dev/dk0b /tmp
190.Ed
191.It Fl p
192Print mount information in fstab format. Implies also the
193.Fl v
194option.
195.It Fl r
196The file system is to be mounted read-only.
197Mount the file system read-only (even the super-user may not write it).
198The same as the
199.Dq rdonly
200argument to the
201.Fl o
202option.
203.It Fl t Ar "ufs \\*(Ba lfs \\*(Ba external type"
204The argument following the
205.Fl t
206is used to indicate the file system type.
207The type
208.Ar ufs
209is the default.
210The
211.Fl t
212option can be used
213to indicate that the actions should only be taken on
214filesystems of the specified type.
215More than one type may be specified in a comma separated list.
216The list of filesystem types can be prefixed with
217.Dq no
218to specify the filesystem types for which action should
219.Em not
220be taken.
221For example, the
222.Nm
223command:
224.Bd -literal -offset indent
225mount -a -t nonfs,mfs
226.Ed
227.Pp
228mounts all filesystems except those of type
229.Tn NFS
230and
231.Tn MFS .
232.Pp
233If the type is not one of the internally known types,
234.Nm
235will attempt to execute a program in
236.Pa /sbin/mount_ Ns Em XXX
237where
238.Em XXX
239is replaced by the type name.
240For example, nfs filesystems are mounted by the program
241.Pa /sbin/mount_nfs .
242.Pp
243Most filesystems will be dynamically loaded by their mount programs
244if not already present in the kernel, using the
245.Xr vfsload 3
246subroutine.  Because this mechanism requires writable temporary space,
247the filesystem type containing
248.Pa /tmp
249must be compiled into the kernel, and the filesystems containing
250.Pa /tmp
251and
252.Pa /usr/bin/ld
253must be listed in
254.Pa /etc/fstab
255before any filesystems which might be dynamically loaded.
256.It Fl u
257The
258.Fl u
259flag indicates that the status of an already mounted file
260system should be changed.
261Any of the options discussed above (the
262.Fl o
263option)
264may be changed;
265also a file system can be changed from read-only to read-write
266or vice versa.
267An attempt to change from read-write to read-only will fail if any
268files on the filesystem are currently open for writing unless the
269.Fl f
270flag is also specified.
271The set of options is determined by first extracting the options
272for the file system from the
273.Xr fstab 5
274table,
275then applying any options specified by the
276.Fl o
277argument,
278and finally applying the
279.Fl r
280or
281.Fl w
282option.
283.It Fl v
284Verbose mode.
285.It Fl w
286The file system object is to be read and write.
287.Pp
288The options specific to NFS filesystems are described in the
289.Xr mount_nfs 8
290manual page.
291.Sh DIAGNOSTICS
292Various, most of them are self-explanatory.
293.Pp
294.Dl XXXXX filesystem is not available
295.Pp
296The kernel doesn't support the respective filesystem type.  Note that
297support for a particular filesystem might be provided either on a static
298(kernel compile-time), or dynamic basis (loaded as a kernel module by
299.Xr modload 8 ).
300Normally,
301.Nm
302or its subprocesses attempt to dynamically load a filesystem module if
303it hasn't been configured statically, using
304.Xr vfsload 3 .
305In this case, the above error message can also mean that you didn't
306have permission to load the module.
307.Sh FILES
308.Bl -tag -width /etc/fstab -compact
309.It Pa /etc/fstab
310file system table
311.El
312.Sh SEE ALSO
313.Xr mount 2 ,
314.Xr vfsload 3 ,
315.Xr fstab 5 ,
316.Xr mount_cd9660 8 ,
317.Xr mount_fdesc 8 ,
318.Xr mount_kernfs 8 ,
319.Xr mount_lfs 8 ,
320.Xr mount_mfs 8 ,
321.Xr mount_msdos 8 ,
322.Xr mount_nfs 8 ,
323.Xr mount_null 8 ,
324.Xr mount_portal 8 ,
325.Xr mount_procfs 8 ,
326.Xr mount_umap 8 ,
327.Xr mount_union 8 ,
328.Xr umount 8
329.Sh BUGS
330It is possible for a corrupted file system to cause a crash.
331.Sh HISTORY
332A
333.Nm
334command appeared in
335.At v1 .
336