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