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