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