1 .\" $NetBSD: mount.8,v 1.68 2009/10/02 20:31:19 elad Exp $
3 .\" Copyright (c) 1980, 1989, 1991, 1993
4 .\" The Regents of the University of California. All rights reserved.
6 .\" Redistribution and use in source and binary forms, with or without
7 .\" modification, are permitted provided that the following conditions
9 .\" 1. Redistributions of source code must retain the above copyright
10 .\" notice, this list of conditions and the following disclaimer.
11 .\" 2. Redistributions in binary form must reproduce the above copyright
12 .\" notice, this list of conditions and the following disclaimer in the
13 .\" documentation and/or other materials provided with the distribution.
14 .\" 3. Neither the name of the University nor the names of its contributors
15 .\" may be used to endorse or promote products derived from this software
16 .\" without specific prior written permission.
18 .\" THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
19 .\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
20 .\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
21 .\" ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
22 .\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
23 .\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
24 .\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
25 .\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
26 .\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
27 .\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
30 .\" @(#)mount.8 8.8 (Berkeley) 6/16/94
37 .Nd mount file systems
44 .Brq Ar special | Ar node
53 command invokes a file system-specific program to prepare and graft the
55 device on to the file system tree at the point
57 or to update options for an already-mounted file system.
61 argument is always interpreted as a directory in the name space of
62 currently mounted file systems.
65 argument is interpreted in different ways
66 by the programs that handle different file system types;
69 interprets it as a device node,
71 interprets it as a directory name,
74 interprets it as reference to a remote host and a directory on that host.
76 The system maintains a list of currently mounted file systems.
77 This list is printed if
79 is invoked with no arguments, and with no options that require some
86 is provided, then the missing information
87 (including the file system type)
91 The provided argument is looked up first in the
96 If the matching entry in
102 field, the device or remote file system already mounted at
103 the location specified by
106 .\" XXX The above paragraph doesn't address the use of "-u"
115 In this case, if the file system type is not specified
120 may determine the type from the disk label (see
130 type is inferred, but this behaviour is deprecated, and will be
131 removed in a future version of
136 the file-system mounting policy is dictated by the running security models.
137 The default security model may allow unprivileged mounting; see
141 The options are as follows:
142 .Bl -tag -width indent
146 to try to mount all of the file systems listed in the
148 file except those for which the
154 flag, except that if a file system (other than the root file system)
155 appears to be already mounted,
157 will not try to mount it again.
159 assumes that a file system is already mounted if a file system with
160 the same type is mounted on the given mount point.
161 More stringent checks are not possible because some file system types
162 report strange values for the mounted-from device for mounted file
165 Causes everything to be done except for the invocation of
166 the file system-specific program.
167 This option is useful in conjunction with the
169 flag to determine what the
171 command is trying to do.
173 Forces the revocation of write access when trying to downgrade
174 a file system mount status from read-write to read-only.
176 Options are specified with a
178 flag followed by a comma separated string of options.
179 The following options are available:
180 .Bl -tag -width nocoredump
184 to the file system should be done asynchronously.
185 In the event of a crash,
186 .Em "it is impossible for the system to verify the integrity of data on a file system mounted with this option" .
187 You should only use this option if you have an application-specific data
188 recovery mechanism, or are willing to recreate the file system from scratch.
196 forces the revocation of write access when trying to downgrade
197 a file system mount status from read-write to read-only.
199 Retrieves the file system specific mount arguments for the given
200 mounted file system and prints them.
205 causes the mount point to be excluded from the
206 list of file systems shown by default with
209 Never update the access time field for files.
210 This option is useful for optimizing read performance on file systems
211 that are used as news spools.
213 This file system should be skipped when mount is run with the
217 Do not allow programs to create crash dumps (core files) on the file system.
218 This option can be used to help protect sensitive
219 data by keeping core files (which may contain sensitive data)
220 from being created on insecure file systems.
221 Only core files that would be created by program crashes are
222 prevented by use of this flag; the behavior of
226 Do not interpret character or block special devices on the file system.
227 This option is useful for a server that has file systems containing
228 special devices for architectures other than its own.
230 Do not update modification times on device special files.
231 This option is useful on laptops
232 or other systems that perform power management.
234 Do not allow execution of any binaries on the mounted file system.
235 This option is useful for a server that has file systems containing
236 binaries for architectures other than its own.
238 Do not allow set-user-identifier or set-group-identifier bits to take effect.
240 (NFS only) Use the specified NFS port.
244 mount the file system read-only (even the super-user may not write it).
246 Reload all incore data for a file system.
247 This is used mainly after running
249 on the root file system and finding things to fix.
250 The file system must be mounted read-only.
251 All cached meta-data are invalidated, superblock and summary information
252 is re-read from disk, all cached inactive vnodes and file data are
253 invalidated and all inode data are re-read for all active vnodes.
255 Instead of running mount_type to mount the file system, run rump_type.
256 This uses a userspace server to mount the file system and does not
257 require kernel support for the specific file system type.
260 flag and respective rump_type manual page for more information.
262 (FFS only with UFS2 superblock layout)
263 Mount the file system with
265 meta-data journaling, also known simply as logging.
266 It provides rapid metadata updates and eliminates the need to check
267 file system consistency after a system outage.
268 A file system mounted with
270 can not be mounted with
274 option to be enabled in the running kernel.
277 for more information.
279 Recognize permission of symbolic link when reading or traversing link.
283 to the file system should be done synchronously.
284 This is not equivalent to the normal mode in which only
285 metadata is written synchronously.
291 Causes the namespace at the mount point to appear as the union
292 of the mounted file system root and the existing directory.
293 Lookups will be done in the mounted file system first.
294 If those operations fail due to a non-existent file the underlying
295 directory is then accessed.
296 All creates are done in the mounted file system, except for the fdesc
301 indicate that the status of an already mounted file system should be changed.
304 Any additional options specific to a given file system type (see the
306 option) may be passed as a comma separated list; these options are
307 distinguished by a leading
310 Options that take a value are specified using the syntax -option=value.
311 For example, the mount command:
312 .Bd -literal -offset indent
313 mount -t mfs -o nosuid,-N,-s=32m swap /tmp
318 to execute the equivalent of:
319 .Bd -literal -offset indent
320 /sbin/mount_mfs -o nosuid -N -s 32m swap /tmp
323 The file system is to be mounted read-only.
324 Mount the file system read-only (even the super-user may not write it).
331 The argument following the
333 is used to indicate the file system type.
339 option can be used to indicate that the actions
340 should only be taken on file systems of the specified type.
341 More than one type may be specified in a comma separated list.
342 The list of file system types can be prefixed with
344 to specify the file system types for which action should
350 .Bd -literal -offset indent
351 mount -a -t nonfs,mfs
354 mounts all file systems except those of type
360 will attempt to execute a program in
361 .Pa /sbin/mount_ Ns Em XXX
364 is replaced by the type name.
365 For example, nfs file systems are mounted by the program
366 .Pa /sbin/mount_nfs .
370 flag indicates that the status of an already mounted file
371 system should be changed.
372 Any of the options discussed above (the
376 also a file system can be changed from read-only to read-write
378 An attempt to change from read-write to read-only will fail if any
379 files on the file system are currently open for writing unless the
381 flag is also specified.
382 The set of options is determined by first extracting the options
383 for the file system from the
385 file, then applying any options specified by the
388 and finally applying the
395 If this flag is specified more than once, then the
396 file system-specific mount arguments are printed for the given mounted
399 The file system object is to be read and write.
402 The options specific to the various file system types are
403 described in the manual pages for those file systems'
406 For instance the options specific to Berkeley
407 Fast File System (FFS) are described in the
411 The particular type of file system in each partition of a disk can
412 be found by examining the disk label with the
416 .Bl -tag -width /etc/fstab -compact
421 Some useful examples:
423 .Bl -hang -offset indent -width "MS-DOS"
426 mount -t cd9660 -r /dev/cd0a /cdrom
429 mount -t msdos /dev/fd0a /floppy
432 mount -t nfs nfs-server-host:/directory/path /mount-point
433 .It Tn MFS (32 megabyte)
435 mount -t mfs -o nosuid,-s=32m swap /tmp
442 can be used to make it easy to manually mount and unmount removable
443 media using just the mountpoint filename, with an entry like this:
445 .Dl /dev/cd0a /cdrom cd9660 ro,noauto 0 0
447 That would allow a simple command like
453 file system format in the first
458 .Dq Operation not supported by device
459 indicates that the mount for the specified file-system type cannot be
460 completed because the kernel lacks support for the said file-system.
465 .Dq Operation not permitted
466 may indicate that the mount options include privileged options and/or
467 don't include options that exclude privileged options.
468 One should try using at least
473 .Bd -literal -offset indent
474 mount -t cd9660 -o nodev,nosuid /dev/cd0a /mnt
489 .Xr mount_filecore 8 ,
497 .Xr mount_overlay 8 ,