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