xref: /dragonfly/sbin/mount/mount.8 (revision 9348a738)
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. Neither the name of the University nor the names of its contributors
13.\"    may be used to endorse or promote products derived from this software
14.\"    without specific prior written permission.
15.\"
16.\" THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
17.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
18.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
19.\" ARE DISCLAIMED.  IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
20.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
21.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
22.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
23.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
24.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
25.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
26.\" SUCH DAMAGE.
27.\"
28.\"     @(#)mount.8	8.8 (Berkeley) 6/16/94
29.\" $FreeBSD: src/sbin/mount/mount.8,v 1.31.2.12 2003/02/23 21:17:42 trhodes Exp $
30.\"
31.Dd May 15, 2016
32.Dt MOUNT 8
33.Os
34.Sh NAME
35.Nm mount
36.Nd mount file systems
37.Sh SYNOPSIS
38.Nm
39.Op Fl adfpruvw
40.Op Fl F Ar fstab
41.Op Fl o Ar options
42.Op Fl t Ar type
43.Nm
44.Op Fl dfpruvw
45.Brq Ar special | node
46.Nm
47.Op Fl dfpruvw
48.Op Fl o Ar options
49.Op Fl t Ar type
50.Ar special node
51.Sh DESCRIPTION
52The
53.Nm
54utility calls the
55.Xr mount 2
56system call to prepare and graft a
57.Ar "special device"
58or the remote node (rhost:path) on to the file system tree at the point
59.Ar node .
60If either
61.Ar special
62or
63.Ar node
64are not provided, the appropriate information is taken from the
65.Xr fstab 5
66file.
67.Pp
68The system maintains a list of currently mounted file systems.
69If no arguments are given to
70.Nm ,
71this list is printed.
72.Pp
73The options are as follows:
74.Bl -tag -width indent
75.It Fl a
76All the filesystems described in
77.Xr fstab 5
78are mounted.
79Exceptions are those marked as
80.Dq noauto ,
81excluded by the
82.Fl t
83flag (see below), or if they are already mounted (except the
84root filesystem which is always remounted to preserve
85traditional single user mode behavior).
86.It Fl d
87Causes everything to be done except for the actual system call.
88This option is useful in conjunction with the
89.Fl v
90flag to
91determine what the
92.Nm
93command is trying to do.
94.It Fl F Ar fstab
95Specify the
96.Pa fstab
97file to use.
98.It Fl f
99Forces the revocation of write access when trying to downgrade
100a filesystem mount status from read-write to read-only.
101Also
102forces the R/W mount of an unclean filesystem (dangerous; use with
103caution).
104.It Fl o
105Options are specified with a
106.Fl o
107flag followed by a comma separated string of options.
108If a
109.Dq no
110prefix is added or removed from a option name, then meaning is negated.
111In case of conflicting options being specified, the rightmost option
112takes effect.
113The following options are available:
114.Bl -tag -width indent
115.It Cm async
116All
117.Tn I/O
118to the file system should be done asynchronously.
119This is a
120.Em dangerous
121flag to set,
122and should not be used unless you are prepared to recreate the file
123system should your system crash.
124.It Cm automounted
125This flag indicates that the file system was mounted by
126.Xr automountd 8 .
127Automounted file systems are automatically unmounted by
128.Xr autounmountd 8 .
129.It Cm current
130When used with the
131.Fl u
132flag, this is the same as specifying the options currently in effect for
133the mounted filesystem.
134.It Cm force
135The same as
136.Fl f ;
137forces the revocation of write access when trying to downgrade
138a filesystem mount status from read-write to read-only.
139Also
140forces the R/W mount of an unclean filesystem (dangerous; use with caution).
141.It Cm fstab
142When used with the
143.Fl u
144flag, this is the same as specifying all the options listed in the
145.Xr fstab 5
146file for the filesystem.
147.It Cm noasync
148Metadata I/O should be done synchronously, while data I/O should be done
149asynchronously.
150This is the default.
151.It Cm noatime
152Do not update the file access time when reading from a file.
153This option
154is useful on filesystems where there are large numbers of files and
155performance is more critical than updating the file access time (which is
156rarely ever important).
157This option is currently only supported on local filesystems.
158.It Cm noauto
159This filesystem should be skipped when
160.Nm
161is run with the
162.Fl a
163flag.
164.It Cm noclusterr
165Disable read clustering.
166.It Cm noclusterw
167Disable write clustering.
168.It Cm nodev
169Do not interpret character or block special devices on the file system.
170This option is useful for a server that has file systems containing
171special devices for architectures other than its own.
172This option is set automatically when the user does not have super-user
173privileges.
174.It Cm noexec
175Do not allow execution of any binaries on the mounted file system.
176This option is useful for a server that has file systems containing
177binaries for architectures other than its own.
178.It Cm nosuid
179Do not allow set-user-identifier or set-group-identifier bits to take effect.
180Note: this option is worthless if a public available suid or sgid
181wrapper like
182.Xr suidperl 1
183is installed on your system.
184It is set automatically when the user does not have super-user privileges.
185.It Cm nosymfollow
186Do not follow symlinks
187on the mounted file system.
188.It Cm rdonly , ro , norw
189The same as
190.Fl r ;
191mount the file system read-only (even the super-user may not write it).
192.It Cm sync
193All
194.Tn I/O
195to the file system should be done synchronously.
196.It Cm trim
197If the device supports TRIM
198.Va ( kern.cam.da.X.trim_enabled
199exists) and is set,
200the file system will perform online trim for corresponding block deletions.
201Currently, only
202.Xr UFS 5
203supports this feature.
204.It Cm suiddir
205A directory on the mounted filesystem will respond to the SUID bit
206being set, by setting the owner of any new files to be the same
207as the owner of the directory.
208New directories will inherit the bit from their parents.
209Execute bits are removed from
210the file, and it will not be given to root.
211.Pp
212This feature is designed for use on fileservers serving PC users via
213ftp or SAMBA.
214It provides security holes for shell users and as
215such should not be used on shell machines, especially on home directories.
216This option requires the SUIDDIR
217option in the kernel to work.
218Only
219.Xr UFS 5
220filesystems support this option.
221See
222.Xr chmod 2
223for more information.
224.It Cm update
225The same as
226.Fl u ;
227indicate that the status of an already mounted file system should be changed.
228.It Cm ignore
229Will be ignored by
230.Xr df 1 .
231.El
232.Pp
233Any additional options specific to a filesystem type that is not
234one of the internally known types (see the
235.Fl t
236option) may be passed as a comma separated list; these options are
237distinguished by a leading
238.Dq \&-
239(dash).
240Options that take a value are specified using the syntax -option=value.
241For example, the
242.Nm
243command:
244.Bd -literal -offset indent
245mount -t mfs -o nosuid,-N,-s=4000 /dev/da0s0b /tmp
246.Ed
247.Pp
248causes
249.Nm
250to execute the equivalent of:
251.Bd -literal -offset indent
252/sbin/mount_mfs -o nosuid -N -s 4000 /dev/da0s0b /tmp
253.Ed
254.Pp
255Additional options specific to filesystem types
256which are not internally known
257(see the description of the
258.Fl t
259option below)
260may be described in the manual pages for the associated
261.Pa /sbin/mount_ Ns Sy XXX
262utilities.
263.It Fl p
264Print mount information in
265.Xr fstab 5
266format.
267If fstab is missing or if the freq and passno fields are omitted,
268the default values as described in
269.Xr fstab 5
270are used.
271Implies also the
272.Fl v
273option.
274.It Fl r
275The file system is to be mounted read-only.
276Mount the file system read-only (even the super-user may not write it).
277The same as the
278.Cm rdonly
279argument to the
280.Fl o
281option.
282.It Fl t Ar type
283The argument following the
284.Fl t
285is used to indicate the file system type.
286The type
287.Cm ufs
288is the default.
289The
290.Fl t
291option can be used
292to indicate that the actions should only be taken on
293filesystems of the specified type.
294More than one type may be specified in a comma separated list.
295The list of filesystem types can be prefixed with
296.Dq no
297to specify the filesystem types for which action should
298.Em not
299be taken.
300For example, the
301.Nm
302command:
303.Bd -literal -offset indent
304mount -a -t nonfs,mfs
305.Ed
306.Pp
307mounts all filesystems except those of type
308.Tn NFS
309and
310.Tn MFS .
311.Pp
312If the type is not the internally known type,
313.Cm ufs ,
314.Nm
315will attempt to execute a program in
316.Pa /sbin/mount_ Ns Sy XXX
317where
318.Sy XXX
319is replaced by the type name.
320For example, nfs filesystems are mounted by the program
321.Pa /sbin/mount_nfs .
322.Pp
323Most filesystems will be dynamically loaded by their
324.Nm
325programs
326if not already present in the kernel, using the
327.Xr vfsload 3
328subroutine.
329Because this mechanism requires writable temporary space,
330the filesystem type containing
331.Pa /tmp
332must be compiled into the kernel, and the filesystems containing
333.Pa /tmp
334and
335.Pa /usr/bin/ld
336must be listed in
337.Pa /etc/fstab
338before any filesystems which might be dynamically loaded.
339.It Fl u
340The
341.Fl u
342flag indicates that the status of an already mounted file
343system should be changed.
344Any of the options discussed above (the
345.Fl o
346option)
347may be changed;
348also a file system can be changed from read-only to read-write
349or vice versa.
350An attempt to change from read-write to read-only will fail if any
351files on the filesystem are currently open for writing unless the
352.Fl f
353flag is also specified.
354The set of options is determined by applying the options specified
355in the argument to
356.Fl o
357and finally applying the
358.Fl r
359or
360.Fl w
361option.
362.It Fl v
363Verbose mode.
364.It Fl w
365The file system object is to be read and write.
366.El
367.Sh ENVIRONMENT
368.Bl -tag -width PATH_FSTAB
369.It Pa PATH_FSTAB
370If the environment variable
371.Pa PATH_FSTAB
372is set all operations are performed against the specified file.
373.El
374.Sh FILES
375.Bl -tag -width /etc/fstab -compact
376.It Pa /etc/fstab
377file system table
378.El
379.Sh DIAGNOSTICS
380Various, most of them are self-explanatory.
381.Pp
382.Dl XXXXX filesystem is not available
383.Pp
384The kernel does not support the respective filesystem type.
385Note that
386support for a particular filesystem might be provided either on a static
387(kernel compile-time), or dynamic basis (loaded as a kernel module by
388.Xr kldload 8 ) .
389Normally,
390.Nm
391or its subprocesses attempt to dynamically load a filesystem module if
392it has not been configured statically, using
393.Xr vfsload 3 .
394In this case, the above error message can also mean that you did not
395have permission to load the module.
396.Sh SEE ALSO
397.Xr df 1 ,
398.Xr lsvfs 1 ,
399.Xr mount 2 ,
400.Xr vfsload 3 ,
401.Xr devtab 5 ,
402.Xr fstab 5 ,
403.Xr UFS 5 ,
404.Xr automount 8 ,
405.Xr automountd 8 ,
406.Xr autounmountd 8 ,
407.Xr kldload 8 ,
408.Xr mount_cd9660 8 ,
409.Xr mount_devfs 8 ,
410.Xr mount_ext2fs 8 ,
411.Xr mount_hammer 8 ,
412.Xr mount_hpfs 8 ,
413.Xr mount_mfs 8 ,
414.Xr mount_msdos 8 ,
415.Xr mount_nfs 8 ,
416.Xr mount_ntfs 8 ,
417.Xr mount_null 8 ,
418.Xr mount_procfs 8 ,
419.Xr mount_smbfs 8 ,
420.Xr mount_std 8 ,
421.Xr mount_tmpfs 8 ,
422.Xr mount_udf 8 ,
423.Xr sysctl 8 ,
424.Xr umount 8
425.Sh HISTORY
426A
427.Nm
428utility appeared in
429.At v1 .
430.Sh CAVEATS
431After a successful
432.Nm ,
433the permissions on the original mount point determine if
434.Pa ..\&
435is accessible from the mounted file system.
436The minimum permissions for
437the mount point for traversal across the mount point in both
438directions to be possible for all users is 0111 (execute for all).
439.Sh BUGS
440It is possible for a corrupted file system to cause a crash.
441