xref: /freebsd/sbin/mount/mount.8 (revision 11f0b352e05306cf6f1f85e9087022c0a92624a3)
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.\" $FreeBSD$
34.\"
35.Dd June 16, 1994
36.Dt MOUNT 8
37.Os
38.Sh NAME
39.Nm mount
40.Nd mount filesystems
41.Sh SYNOPSIS
42.Nm
43.Op Fl adfpruvw
44.Op Fl t Ar ufs | external_type
45.Nm
46.Op Fl dfpruvw
47.Ar special | node
48.Nm
49.Op Fl dfpruvw
50.Op Fl o Ar options
51.Op Fl t Ar ufs | external_type
52.Ar special node
53.Sh DESCRIPTION
54The
55.Nm
56utility calls 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 filesystem 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 filesystems.
71If no arguments are given to
72.Nm ,
73this list is printed.
74.Pp
75The options are as follows:
76.Bl -tag -width indent
77.It Fl a
78All the filesystems described in
79.Xr fstab 5
80are mounted.
81Exceptions are those marked as
82.Dq noauto ,
83excluded by the
84.Fl t
85flag (see below), or if they are already mounted (except the
86root filesystem which is always remounted to preserve
87traditional single user mode behavior).
88.It Fl d
89Causes everything to be done except for the actual system call.
90This option is useful in conjunction with the
91.Fl v
92flag to
93determine what the
94.Nm
95command is trying to do.
96.It Fl f
97Forces the revocation of write access when trying to downgrade
98a filesystem mount status from read-write to read-only.
99Also
100forces the R/W mount of an unclean filesystem (dangerous; use with
101caution).
102.It Fl o
103Options are specified with a
104.Fl o
105flag followed by a comma separated string of options.
106In case of conflicting options being specified, the rightmost option
107takes effect.
108The following options are available:
109.Bl -tag -width indent
110.It Cm async
111All
112.Tn I/O
113to the filesystem should be done asynchronously.
114This is a
115.Em dangerous
116flag to set,
117and should not be used unless you are prepared to recreate the file
118system should your system crash.
119.It Cm current
120When used with the
121.Fl u
122flag, this is the same as specifying the options currently in effect for
123the mounted filesystem.
124.It Cm force
125The same as
126.Fl f ;
127forces the revocation of write access when trying to downgrade
128a filesystem mount status from read-write to read-only.
129Also
130forces the R/W mount of an unclean filesystem (dangerous; use with caution).
131.It Cm fstab
132When used with the
133.Fl u
134flag, this is the same as specifying all the options listed in the
135.Xr fstab 5
136file for the filesystem.
137.It Cm noasync
138Metadata I/O should be done synchronously, while data I/O should be done
139asynchronously.
140This is the default.
141.It Cm noatime
142Do not update the file access time when reading from a file.
143This option
144is useful on filesystems where there are large numbers of files and
145performance is more critical than updating the file access time (which is
146rarely ever important).
147This option is currently only supported on local filesystems.
148.It Cm noauto
149This filesystem should be skipped when
150.Nm
151is run with the
152.Fl a
153flag.
154.It Cm noclusterr
155Disable read clustering.
156.It Cm noclusterw
157Disable write clustering.
158.It Cm nodev
159Do not interpret character or block special devices on the filesystem.
160This option is useful for a server that has filesystems containing
161special devices for architectures other than its own.
162.It Cm noexec
163Do not allow execution of any binaries on the mounted filesystem.
164This option is useful for a server that has filesystems containing
165binaries for architectures other than its own.
166.It Cm nosuid
167Do not allow set-user-identifier or set-group-identifier bits to take effect.
168Note: this option is worthless if a public available suid or sgid
169wrapper like
170.Xr suidperl 1
171is installed on your system.
172.It Cm nosymfollow
173Do not follow symlinks
174on the mounted filesystem.
175.It Cm rdonly
176The same as
177.Fl r ;
178mount the filesystem read-only (even the super-user may not write it).
179.It Cm sync
180All
181.Tn I/O
182to the filesystem should be done synchronously.
183.It Cm suiddir
184A directory on the mounted filesystem will respond to the SUID bit
185being set, by setting the owner of any new files to be the same
186as the owner of the directory.
187New directories will inherit the bit from their parents.
188Execute bits are removed from
189the file, and it will not be given to root.
190.Pp
191This feature is designed for use on fileservers serving PC users via
192ftp, SAMBA, or netatalk.
193It provides security holes for shell users and as
194such should not be used on shell machines, especially on home directories.
195This option requires the SUIDDIR
196option in the kernel to work.
197Only UFS filesystems support this option.
198See
199.Xr chmod 2
200for more information.
201.It Cm update
202The same as
203.Fl u ;
204indicate that the status of an already mounted filesystem should be changed.
205.It Cm union
206Causes the namespace at the mount point to appear as the union
207of the mounted filesystem root and the existing directory.
208Lookups will be done in the mounted filesystem first.
209If those operations fail due to a non-existent file the underlying
210directory is then accessed.
211All creates are done in the mounted filesystem.
212.El
213.Pp
214Any additional options specific to a filesystem type that is not
215one of the internally known types (see the
216.Fl t
217option) may be passed as a comma separated list; these options are
218distinguished by a leading
219.Dq \&-
220(dash).
221Options that take a value are specified using the syntax -option=value.
222For example, the
223.Nm
224command:
225.Bd -literal -offset indent
226mount -t unionfs -o -b /sys $HOME/sys
227.Ed
228.Pp
229causes
230.Nm
231to execute the equivalent of:
232.Bd -literal -offset indent
233/sbin/mount_unionfs -b /sys $HOME/sys
234.Ed
235.Pp
236Additional options specific to filesystem types
237which are not internally known
238(see the description of the
239.Fl t
240option below)
241may be described in the manual pages for the associated
242.Pa /sbin/mount_ Ns Sy XXX
243utilities.
244.It Fl p
245Print mount information in
246.Xr fstab 5
247format.
248Implies also the
249.Fl v
250option.
251.It Fl r
252The filesystem is to be mounted read-only.
253Mount the filesystem read-only (even the super-user may not write it).
254The same as the
255.Cm rdonly
256argument to the
257.Fl o
258option.
259.It Fl t Ar ufs | external_type
260The argument following the
261.Fl t
262is used to indicate the filesystem type.
263The type
264.Ar ufs
265is the default.
266The
267.Fl t
268option can be used
269to indicate that the actions should only be taken on
270filesystems of the specified type.
271More than one type may be specified in a comma separated list.
272The list of filesystem types can be prefixed with
273.Dq no
274to specify the filesystem types for which action should
275.Em not
276be taken.
277For example, the
278.Nm
279command:
280.Bd -literal -offset indent
281mount -a -t nonfs,nullfs
282.Ed
283.Pp
284mounts all filesystems except those of type
285.Tn NFS
286and
287.Tn NULLFS .
288.Pp
289If the type is not one of the internally known types,
290.Nm
291will attempt to execute a program in
292.Pa /sbin/mount_ Ns Sy XXX
293where
294.Sy XXX
295is replaced by the type name.
296For example, nfs filesystems are mounted by the program
297.Pa /sbin/mount_nfs .
298.Pp
299Most filesystems will be dynamically loaded by their
300.Nm
301programs
302if not already present in the kernel, using the
303.Xr vfsload 3
304subroutine.
305Because this mechanism requires writable temporary space,
306the filesystem type containing
307.Pa /tmp
308must be compiled into the kernel, and the filesystems containing
309.Pa /tmp
310and
311.Pa /usr/bin/ld
312must be listed in
313.Pa /etc/fstab
314before any filesystems which might be dynamically loaded.
315.It Fl u
316The
317.Fl u
318flag indicates that the status of an already mounted file
319system should be changed.
320Any of the options discussed above (the
321.Fl o
322option)
323may be changed;
324also a filesystem can be changed from read-only to read-write
325or vice versa.
326An attempt to change from read-write to read-only will fail if any
327files on the filesystem are currently open for writing unless the
328.Fl f
329flag is also specified.
330The set of options is determined by applying the options specified
331in the argument to
332.Fl o
333and finally applying the
334.Fl r
335or
336.Fl w
337option.
338.It Fl v
339Verbose mode.
340.It Fl w
341The filesystem object is to be read and write.
342.El
343.Sh DIAGNOSTICS
344Various, most of them are self-explanatory.
345.Pp
346.Dl XXXXX filesystem is not available
347.Pp
348The kernel does not support the respective filesystem type.
349Note that
350support for a particular filesystem might be provided either on a static
351(kernel compile-time), or dynamic basis (loaded as a kernel module by
352.Xr kldload 8 ) .
353Normally,
354.Nm
355or its subprocesses attempt to dynamically load a filesystem module if
356it has not been configured statically, using
357.Xr vfsload 3 .
358In this case, the above error message can also mean that you did not
359have permission to load the module.
360.Sh FILES
361.Bl -tag -width /etc/fstab -compact
362.It Pa /etc/fstab
363filesystem table
364.El
365.Sh SEE ALSO
366.Xr mount 2 ,
367.Xr vfsload 3 ,
368.Xr fstab 5 ,
369.Xr kldload 8 ,
370.Xr mount_cd9660 8 ,
371.Xr mount_devfs 8 ,
372.Xr mount_ext2fs 8 ,
373.Xr mount_fdescfs 8 ,
374.Xr mount_hpfs 8 ,
375.Xr mount_linprocfs 8 ,
376.Xr mount_msdosfs 8 ,
377.Xr mount_nfs 8 ,
378.Xr mount_ntfs 8 ,
379.Xr mount_nullfs 8 ,
380.Xr mount_nwfs 8 ,
381.Xr mount_portalfs 8 ,
382.Xr mount_procfs 8 ,
383.Xr mount_smbfs 8 ,
384.Xr mount_std 8 ,
385.Xr mount_udf 8 ,
386.Xr mount_umapfs 8 ,
387.Xr mount_unionfs 8 ,
388.Xr umount 8
389.Sh BUGS
390It is possible for a corrupted filesystem to cause a crash.
391.Sh CAVEATS
392After a successful
393.Nm ,
394the permissions on the original mount point determine if
395.Pa ..\&
396is accessible from the mounted filesystem.
397The minimum permissions for
398the mount point for traversal across the mount point in both
399directions to be possible for all users is 0111 (execute for all).
400.Sh HISTORY
401A
402.Nm
403utility appeared in
404.At v1 .
405