]> git.ipfire.org Git - thirdparty/util-linux.git/blame - sys-utils/mount.8
mount: (man) small typo fixes
[thirdparty/util-linux.git] / sys-utils / mount.8
CommitLineData
60a2a323 1.\" Copyright (c) 1996-2004 Andries Brouwer
0d05f161 2.\" Copyright (C) 2006-2012 Karel Zak <kzak@redhat.com>
60a2a323
KZ
3.\"
4.\" This page is somewhat derived from a page that was
5.\" (c) 1980, 1989, 1991 The Regents of the University of California
6.\" and had been heavily modified by Rik Faith and myself.
7.\" (Probably no BSD text remains.)
8.\" Fragments of text were written by Werner Almesberger, Remy Card,
9.\" Stephen Tweedie and Eric Youngdale.
10.\"
11.\" This is free documentation; you can redistribute it and/or
12.\" modify it under the terms of the GNU General Public License as
13.\" published by the Free Software Foundation; either version 2 of
14.\" the License, or (at your option) any later version.
15.\"
16.\" The GNU General Public License's references to "object code"
17.\" and "executables" are to be interpreted as the output of any
18.\" document formatting or typesetting system, including
19.\" intermediate and printed output.
20.\"
21.\" This manual is distributed in the hope that it will be useful,
22.\" but WITHOUT ANY WARRANTY; without even the implied warranty of
23.\" MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
24.\" GNU General Public License for more details.
25.\"
7cebf0bb
SK
26.\" You should have received a copy of the GNU General Public License along
27.\" with this program; if not, write to the Free Software Foundation, Inc.,
28.\" 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
60a2a323 29.\"
bcdf0978 30.TH MOUNT 8 "August 2015" "util-linux" "System Administration"
60a2a323
KZ
31.SH NAME
32mount \- mount a filesystem
33.SH SYNOPSIS
34.B mount
00d1cc1d 35.RB [ \-l | \-h | \-V ]
60a2a323 36.LP
00d1cc1d 37.B mount \-a
60a2a323
KZ
38.RB [ \-fFnrsvw ]
39.RB [ \-t
00d1cc1d 40.IR fstype ]
60a2a323
KZ
41.RB [ \-O
42.IR optlist ]
43.LP
44.B mount
45.RB [ \-fnrsvw ]
46.RB [ \-o
00d1cc1d 47.IR options ]
60a2a323
KZ
48.IR device | dir
49.LP
50.B mount
51.RB [ \-fnrsvw ]
52.RB [ \-t
00d1cc1d 53.IB fstype ]
60a2a323
KZ
54.RB [ \-o
55.IR options ]
56.I device dir
57.SH DESCRIPTION
58All files accessible in a Unix system are arranged in one big
59tree, the file hierarchy, rooted at
46f057ed 60.IR / .
3711f113 61These files can be spread out over several devices. The
60a2a323
KZ
62.B mount
63command serves to attach the filesystem found on some device
3711f113 64to the big file tree. Conversely, the
60a2a323 65.BR umount (8)
0ed9c7d5
KZ
66command will detach it again. The filesystem is used to control how data is
67stored on the device or provided in a virtual way by network or another services.
60a2a323
KZ
68
69The standard form of the
70.B mount
3711f113 71command is:
60a2a323
KZ
72.RS
73
74.br
75.BI "mount \-t" " type device dir"
76.br
77
78.RE
79This tells the kernel to attach the filesystem found on
80.I device
81(which is of type
82.IR type )
83at the directory
84.IR dir .
9fb4ab8e
KZ
85The option \fB\-t \fItype\fR is optional. The
86.B mount
87command is usually able to detect a filesystem. The root permissions are necessary
88to mount a filesystem by default. See section "Non-superuser mounts" below for more details.
60a2a323
KZ
89The previous contents (if any) and owner and mode of
90.I dir
91become invisible, and as long as this filesystem remains mounted,
92the pathname
93.I dir
94refers to the root of the filesystem on
95.IR device .
96
3711f113 97If only the directory or the device is given, for example:
60a2a323 98.RS
bcdf0978 99.sp
0bb7e904 100.B mount /dir
bcdf0978 101.sp
60a2a323 102.RE
3711f113 103then \fBmount\fR looks for a mountpoint (and if not found then for a device) in the
0bb7e904 104.I /etc/fstab
3711f113 105file. It's possible to use the
0d05f161 106.B \-\-target
aedeaa40 107or
0d05f161 108.B \-\-source
3711f113 109options to avoid ambivalent interpretation of the given argument. For example:
aedeaa40 110.RS
bcdf0978 111.sp
0bb7e904 112.B mount \-\-target /mountpoint
bcdf0978 113.sp
aedeaa40
KZ
114.RE
115
8e782a83 116The same filesystem may be mounted more than once, and in some cases (e.g.
381db76d 117network filesystems) the same filesystem may be mounted on the same
8e782a83 118mountpoint more times. The mount command does not implement any policy to
07975119 119control this behavior. All behavior is controlled by the kernel and it is usually
381db76d 120specific to the filesystem driver. The exception is \fB\-\-all\fR, in this case
f49cf49b 121already mounted filesystems are ignored (see \fB\-\-all\fR below for more details).
8e782a83 122
81421334 123.SS Listing the mounts
5f7c1890
KZ
124The listing mode is maintained for backward compatibility only.
125
3711f113 126For more robust and customizable output use
5f7c1890 127.BR findmnt (8),
3711f113 128\fBespecially in your scripts\fP. Note that control characters in the
5f7c1890
KZ
129mountpoint name are replaced with '?'.
130
3711f113
BS
131The following command lists all mounted filesystems (of type
132.IR type ):
3711f113 133.RS
bcdf0978 134.sp
0d05f161 135.BR "mount " [ \-l "] [" "\-t \fItype\/\fP" ]
bcdf0978 136.sp
3711f113 137.RE
3711f113 138The option \fB\-l\fR adds labels to this listing. See below.
60a2a323 139
0ed9c7d5 140.SS Indicating the device and filesystem
3711f113 141Most devices are indicated by a filename (of a block special device), like
60a2a323 142.IR /dev/sda1 ,
3711f113 143but there are other possibilities. For example, in the case of an NFS mount,
60a2a323
KZ
144.I device
145may look like
146.IR knuth.cwi.nl:/dir .
3711f113
BS
147It is also possible to indicate a block special device using its filesystem label
148or UUID (see the \fB\-L\fR and \fB\-U\fR options below), or its partition label
0ed9c7d5
KZ
149or UUID. Partition identifiers are supported for example for GUID Partition
150Tables (GPT).
151
b2de475c
MB
152The device names of disk partitions are unstable; hardware reconfiguration,
153adding or removing a device can cause changes in names. This is the reason why it's
154strongly recommended to use filesystem or partition identifiers like UUID or
0ed9c7d5
KZ
155LABEL.
156
b2de475c 157The command \fBlsblk --fs\fR provides an overview of filesystems, LABELs and UUIDs
0ed9c7d5
KZ
158on available block devices. The command \fBblkid -p <device>\fR provides details about
159a filesystem on the specified device.
71e87708
KZ
160
161Don't forget that there is no guarantee that UUIDs and labels are really
162unique, especially if you move, share or copy the device. Use
0d05f161 163.B "lsblk \-o +UUID,PARTUUID"
71e87708 164to verify that the UUIDs are really unique in your system.
60a2a323 165
0ed9c7d5 166The recommended setup is to use tags (e.g.\& \fBUUID=\fIuuid\fR) rather than
46f057ed
MK
167.I /dev/disk/by-{label,uuid,partuuid,partlabel}
168udev symlinks in the
169.I /etc/fstab
170file. Tags are
3711f113 171more readable, robust and portable. The
60a2a323
KZ
172.BR mount (8)
173command internally uses udev
3711f113 174symlinks, so the use of symlinks in /etc/fstab has no advantage over tags.
60a2a323
KZ
175For more details see
176.BR libblkid (3).
177
178Note that
179.BR mount (8)
3711f113 180uses UUIDs as strings. The UUIDs from the command line or from
60a2a323 181.BR fstab (5)
3711f113 182are not converted to internal binary representation. The string representation
60a2a323
KZ
183of the UUID should be based on lower case characters.
184
185The
186.I proc
187filesystem is not associated with a special device, and when
188mounting it, an arbitrary keyword, such as
189.I proc
190can be used instead of a device specification.
191(The customary choice
192.I none
c72fa620
AJ
193is less fortunate: the error message `none already mounted' from
194.B mount
60a2a323 195can be confusing.)
60a2a323 196
81421334 197.SS The files /etc/fstab, /etc/mtab and /proc/mounts
60a2a323
KZ
198The file
199.I /etc/fstab
200(see
201.BR fstab (5)),
202may contain lines describing what devices are usually
3711f113 203mounted where, using which options. The default location of the
60a2a323 204.BR fstab (5)
3711f113
BS
205file can be overridden with the
206.BI \-\-fstab " path"
207command-line option (see below for more details).
60a2a323
KZ
208.LP
209The command
210.RS
211.sp
212.B mount \-a
213.RB [ \-t
214.IR type ]
215.RB [ \-O
216.IR optlist ]
217.sp
218.RE
219(usually given in a bootscript) causes all filesystems mentioned in
220.I fstab
221(of the proper type and/or having or not having the proper options)
222to be mounted as indicated, except for those whose line contains the
223.B noauto
3711f113 224keyword. Adding the
60a2a323 225.B \-F
00d1cc1d 226option will make \fBmount\fR fork, so that the
60a2a323
KZ
227filesystems are mounted simultaneously.
228.LP
229When mounting a filesystem mentioned in
0d05f161 230.I fstab
60a2a323 231or
0d05f161 232.IR mtab ,
3711f113 233it suffices to specify on the command line only the device, or only the mount point.
00d1cc1d 234.sp
60a2a323
KZ
235The programs
236.B mount
237and
238.B umount
00d1cc1d 239traditionally maintained a list of currently mounted filesystems in the file
60a2a323 240.IR /etc/mtab .
b6cc1210 241The support for regular classic
559ee54a 242.I /etc/mtab
b6cc1210
KZ
243is completely disabled in compile time by default, because on current Linux
244systems it is better to make it a symlink to
06716dff 245.I /proc/mounts
b6cc1210 246instead. The regular mtab file maintained in userspace cannot reliably
00d1cc1d 247work with namespaces, containers and other advanced Linux features.
b6cc1210
KZ
248If the regular mtab support is enabled than it's possible to
249use the file as well as the symlink.
00d1cc1d 250.sp
60a2a323
KZ
251If no arguments are given to
252.BR mount ,
00d1cc1d
BS
253the list of mounted filesystems is printed.
254.sp
3711f113
BS
255If you want to override mount options from
256.I /etc/fstab
257you have to use the \fB\-o\fR option:
258.RS
259.sp
260.BI mount " device" \fR| "dir " \-o " options"
261.sp
262.RE
263and then the mount options from the command line will be appended to
264the list of options from
265.IR /etc/fstab .
b8ec0cb4
KZ
266This default behaviour is possible to change by command line
267option \fB\-\-options\-mode\fR.
3711f113
BS
268The usual behavior is that the last option wins if there are conflicting
269ones.
00d1cc1d 270.sp
60a2a323
KZ
271The
272.B mount
273program does not read the
274.I /etc/fstab
3711f113 275file if both
60a2a323 276.I device
eb0eb262 277(or LABEL, UUID, PARTUUID or PARTLABEL) and
60a2a323 278.I dir
3711f113
BS
279are specified. For example, to mount device
280.BR foo " at " /dir :
60a2a323
KZ
281.RS
282.sp
283.B "mount /dev/foo /dir"
284.sp
285.RE
b8ec0cb4
KZ
286This default behaviour is possible to change by command line option
287\fB\-\-options\-source\-force\fR to always read configuration from fstab. For
288non-root users
289.B mount
290always read fstab configuration.
60a2a323 291
81421334 292.SS Non-superuser mounts
60a2a323
KZ
293Normally, only the superuser can mount filesystems.
294However, when
295.I fstab
296contains the
297.B user
3711f113 298option on a line, anybody can mount the corresponding filesystem.
60a2a323
KZ
299.LP
300Thus, given a line
301.RS
302.sp
303.B "/dev/cdrom /cd iso9660 ro,user,noauto,unhide"
304.sp
305.RE
3711f113 306any user can mount the iso9660 filesystem found on an inserted CDROM
bcdf0978 307using the command:
60a2a323 308.RS
60a2a323
KZ
309.B "mount /cd"
310.sp
311.RE
2480b527
KZ
312Note that \fBmount\fR is very strict about non-root users and all paths
313specified on command line are verified before fstab is parsed or a helper
cf41837f 314program is executed. It's strongly recommended to use a valid mountpoint to
2480b527
KZ
315specify filesystem, otherwise \fBmount\fR may fail. For example it's bad idea
316to use NFS or CIFS source on command line.
317.PP
60a2a323
KZ
318For more details, see
319.BR fstab (5).
320Only the user that mounted a filesystem can unmount it again.
3711f113 321If any user should be able to unmount it, then use
60a2a323
KZ
322.B users
323instead of
324.B user
325in the
326.I fstab
327line.
328The
329.B owner
330option is similar to the
331.B user
332option, with the restriction that the user must be the owner
3711f113 333of the special file. This may be useful e.g.\& for
60a2a323
KZ
334.I /dev/fd
335if a login script makes the console user owner of this device.
336The
337.B group
338option is similar, with the restriction that the user must be
339member of the group of the special file.
60a2a323 340
5109589c 341.SS Bind mount operation
9f3d0fce 342Remount part of the file hierarchy somewhere else. The call is:
3711f113 343
60a2a323
KZ
344.RS
345.br
0d05f161 346.B mount \-\-bind
60a2a323
KZ
347.I olddir newdir
348.RE
3711f113
BS
349
350or by using this fstab entry:
351
60a2a323
KZ
352.RS
353.br
3711f113
BS
354.BI / olddir
355.BI / newdir
fb724eef 356.B none bind
60a2a323
KZ
357.RE
358
3711f113 359After this call the same contents are accessible in two places.
5109589c
KZ
360
361It is important to understand that "bind" does not to create any second-class
362or special node in the kernel VFS. The "bind" is just another operation to
363attach a filesystem. There is nowhere stored information that the filesystem
364has been attached by "bind" operation. The \fIolddir\fR and \fInewdir\fR are
381db76d 365independent and the \fIolddir\fR may be umounted.
5109589c 366
3711f113 367One can also remount a single file (on a single file). It's also
60a2a323
KZ
368possible to use the bind mount to create a mountpoint from a regular
369directory, for example:
370
371.RS
372.br
3711f113 373.B mount \-\-bind foo foo
60a2a323
KZ
374.RE
375
376The bind mount call attaches only (part of) a single filesystem, not possible
3711f113
BS
377submounts. The entire file hierarchy including submounts is attached
378a second place by using:
60a2a323
KZ
379
380.RS
381.br
0d05f161 382.B mount \-\-rbind
60a2a323
KZ
383.I olddir newdir
384.RE
385
f1a7a86d
KZ
386Note that the filesystem mount options maintained by kernel will remain the same as those
387on the original mount point. The userspace mount options (e.g. _netdev) will not be copied
388by
389.BR mount (8)
390and it's necessary explicitly specify the options on mount command line.
9ac77b8a 391
bcdf0978
BS
392.BR mount (8)
393since v2.27 allows to change the mount options by passing the
394relevant options along with
395.BR \-\-bind .
396For example:
60a2a323
KZ
397
398.RS
399.br
417234cb 400.B mount -o bind,ro foo foo
60a2a323
KZ
401.RE
402
bcdf0978 403This feature is not supported by the Linux kernel; it is implemented in userspace
3be5d977
MK
404by an additional \fBmount\fR(2) remounting system call.
405This solution is not atomic.
9ac77b8a 406
bcdf0978 407The alternative (classic) way to create a read-only bind mount is to use the remount
9ac77b8a 408operation, for example:
60a2a323
KZ
409
410.RS
411.br
0d05f161 412.B mount \-\-bind
60a2a323
KZ
413.I olddir newdir
414.br
fa177917 415.B mount \-o remount,bind,ro
60a2a323
KZ
416.I olddir newdir
417.RE
d7890778 418
bcdf0978
BS
419Note that a read-only bind will create a read-only mountpoint (VFS entry),
420but the original filesystem superblock will still be writable, meaning that the
d7890778
KZ
421.I olddir
422will be writable, but the
423.I newdir
424will be read-only.
9ac77b8a 425
fa177917 426It's also possible to change nosuid, nodev, noexec, noatime, nodiratime and
e82b77e9
KZ
427relatime VFS entry flags by "remount,bind" operation. The another (for example
428filesystem specific flags) are silently ignored. It's impossible to change mount
429options recursively (for example with \fB-o rbind,ro\fR).
9b76b0e9
KZ
430
431.BR mount (8)
432since v2.31 ignores the \fBbind\fR flag from
433.I /etc/fstab
434on
435.B remount operation
436(if "-o remount" specified on command line). This is necessary to fully control
437mount options on remount by command line. In the previous versions the bind
438flag has been always applied and it was impossible to re-define mount options
439without interaction with the bind semantic. This
440.BR mount (8)
441behavior does not affect situations when "remount,bind" is specified in the
442.I /etc/fstab
443file.
60a2a323 444
81421334 445.SS The move operation
9f3d0fce 446Move a
60a2a323 447.B mounted tree
9f3d0fce 448to another place (atomically). The call is:
3711f113 449
60a2a323
KZ
450.RS
451.br
0d05f161 452.B mount \-\-move
60a2a323
KZ
453.I olddir newdir
454.RE
3711f113
BS
455
456This will cause the contents which previously appeared under
457.I olddir
458to now be accessible under
459.IR newdir .
460The physical location of the files is not changed.
461Note that
60a2a323
KZ
462.I olddir
463has to be a mountpoint.
fcc0413a 464
3711f113
BS
465Note also that moving a mount residing under a shared mount is invalid and
466unsupported. Use
8a4c64e6 467.B findmnt \-o TARGET,PROPAGATION
fcc0413a 468to see the current propagation flags.
60a2a323 469
81421334 470.SS Shared subtree operations
60a2a323 471Since Linux 2.6.15 it is possible to mark a mount and its submounts as shared,
3711f113
BS
472private, slave or unbindable. A shared mount provides the ability to create mirrors
473of that mount such that mounts and unmounts within any of the mirrors propagate
474to the other mirror. A slave mount receives propagation from its master, but
475not vice versa. A private mount carries no propagation abilities. An
60a2a323 476unbindable mount is a private mount which cannot be cloned through a bind
3711f113 477operation. The detailed semantics are documented in
46f057ed 478.I Documentation/filesystems/sharedsubtree.txt
60a2a323
KZ
479file in the kernel source tree.
480
3711f113
BS
481Supported operations are:
482
60a2a323
KZ
483.RS
484.nf
b06c1ca6
WP
485.BI "mount \-\-make\-shared " mountpoint
486.BI "mount \-\-make\-slave " mountpoint
487.BI "mount \-\-make\-private " mountpoint
488.BI "mount \-\-make\-unbindable " mountpoint
60a2a323
KZ
489.fi
490.RE
491
3711f113 492The following commands allow one to recursively change the type of all the
60a2a323
KZ
493mounts under a given mountpoint.
494
495.RS
496.nf
b06c1ca6
WP
497.BI "mount \-\-make\-rshared " mountpoint
498.BI "mount \-\-make\-rslave " mountpoint
499.BI "mount \-\-make\-rprivate " mountpoint
500.BI "mount \-\-make\-runbindable " mountpoint
60a2a323
KZ
501.fi
502.RE
be6904b9
KZ
503
504.BR mount (8)
505.B does not read
506.BR fstab (5)
3711f113
BS
507when a \fB\-\-make-\fR* operation is requested. All necessary information has to be
508specified on the command line.
be6904b9 509
3711f113
BS
510Note that the Linux kernel does not allow to change multiple propagation flags
511with a single
be6904b9 512.BR mount (2)
267b44e6
KZ
513system call, and the flags cannot be mixed with other mount options and operations.
514
515Since util-linux 2.23 the \fBmount\fR command allows to do more propagation
516(topology) changes by one mount(8) call and do it also together with other
517mount operations. This feature is EXPERIMENTAL. The propagation flags are applied
518by additional \fBmount\fR(2) system calls when the preceding mount operations
519were successful. Note that this use case is not atomic. It is possible to
520specify the propagation flags in
be6904b9
KZ
521.BR fstab (5)
522as mount options
3711f113
BS
523.RB ( private ,
524.BR slave ,
525.BR shared ,
526.BR unbindable ,
527.BR rprivate ,
528.BR rslave ,
529.BR rshared ,
530.BR runbindable ).
531
532For example:
533
be6904b9
KZ
534.RS
535.nf
0bb7e904 536.B mount \-\-make\-private \-\-make\-unbindable /dev/sda1 /foo
be6904b9
KZ
537.fi
538.RE
539
3711f113
BS
540is the same as:
541
be6904b9
KZ
542.RS
543.nf
0bb7e904
BIG
544.B mount /dev/sda1 /foox
545.B mount \-\-make\-private /foo
546.B mount \-\-make\-unbindable /foo
be6904b9
KZ
547.fi
548.RE
60a2a323 549
3711f113 550.SH COMMAND-LINE OPTIONS
60a2a323
KZ
551The full set of mount options used by an invocation of
552.B mount
553is determined by first extracting the
554mount options for the filesystem from the
555.I fstab
556table, then applying any options specified by the
557.B \-o
558argument, and finally applying a
559.BR \-r " or " \-w
560option, when present.
561
3711f113
BS
562The command \fBmount\fR does not pass all command-line options to the
563\fB/sbin/mount.\fIsuffix\fR mount helpers. The interface between \fBmount\fR
81421334 564and the mount helpers is described below in the section \fBEXTERNAL HELPERS\fR.
00d1cc1d 565.sp
3711f113 566Command-line options available for the
60a2a323 567.B mount
3711f113 568command are:
00d1cc1d
BS
569.TP
570.BR \-a , " \-\-all"
60a2a323 571Mount all filesystems (of the given types) mentioned in
0d05f161 572.I fstab
31e93a55
KZ
573(except for those whose line contains the
574.B noauto
3711f113
BS
575keyword). The filesystems are mounted following their order in
576.IR fstab .
f49cf49b
KZ
577The mount command compares filesystem source, target (and fs root for bind
578mount or btrfs) to detect already mounted filesystems. The kernel table with
579already mounted filesystems is cached during \fBmount \-\-all\fR. It means
580that all duplicated fstab entries will be mounted.
302419e8 581.sp
189a1bf3
KZ
582The option \fB\-\-all\fR is possible to use for remount operation too. In this
583case all filters (\fB\-t\fR and \fB\-O\fR) are applied to the table of already
584mounted filesystems.
585.sp
f3af8329 586Note that it is a bad practice to use \fBmount \-a\fR for
0bb7e904 587.I fstab
302419e8 588checking. The recommended solution is \fBfindmnt \-\-verify\fR.
00d1cc1d
BS
589.TP
590.BR \-B , " \-\-bind"
591Remount a subtree somewhere else (so that its contents are available
81421334 592in both places). See above, under \fBBind mounts\fR.
00d1cc1d 593.TP
b06c1ca6 594.BR \-c , " \-\-no\-canonicalize"
00d1cc1d
BS
595Don't canonicalize paths. The mount command canonicalizes all paths
596(from command line or fstab) by default. This option can be used
597together with the
598.B \-f
599flag for already canonicalized absolute paths. The option is designed for mount
600helpers which call \fBmount -i\fR. It is strongly recommended to not use this
601command-line option for normal mount operations.
602.sp
603Note that \fBmount\fR(8) does not pass this option to the
604\fB/sbin/mount.\fItype\fR helpers.
605.TP
606.BR \-F , " \-\-fork"
60a2a323
KZ
607(Used in conjunction with
608.BR \-a .)
3711f113 609Fork off a new incarnation of \fBmount\fR for each device.
60a2a323
KZ
610This will do the mounts on different devices or different NFS servers
611in parallel.
612This has the advantage that it is faster; also NFS timeouts go in
3711f113 613parallel. A disadvantage is that the mounts are done in undefined order.
60a2a323
KZ
614Thus, you cannot use this option if you want to mount both
615.I /usr
616and
617.IR /usr/spool .
618.IP "\fB\-f, \-\-fake\fP"
619Causes everything to be done except for the actual system call; if it's not
620obvious, this ``fakes'' mounting the filesystem. This option is useful in
621conjunction with the
622.B \-v
623flag to determine what the
624.B mount
3711f113
BS
625command is trying to do. It can also be used to add entries for devices
626that were mounted earlier with the \fB\-n\fR option. The \fB\-f\fR option
627checks for an existing record in /etc/mtab and fails when the record already
628exists (with a regular non-fake mount, this check is done by the kernel).
b06c1ca6 629.IP "\fB\-i, \-\-internal\-only\fP"
3711f113 630Don't call the \fB/sbin/mount.\fIfilesystem\fR helper even if it exists.
00d1cc1d
BS
631.TP
632.BR \-L , " \-\-label " \fIlabel
633Mount the partition that has the specified
634.IR label .
635.TP
b06c1ca6 636.BR \-l , " \-\-show\-labels"
3711f113 637Add the labels in the mount output. \fBmount\fR must have
aedd46f6 638permission to read the disk device (e.g.\& be set-user-ID root) for this to work.
60a2a323
KZ
639One can set such a label for ext2, ext3 or ext4 using the
640.BR e2label (8)
641utility, or for XFS using
642.BR xfs_admin (8),
643or for reiserfs using
644.BR reiserfstune (8).
00d1cc1d
BS
645.TP
646.BR \-M , " \-\-move"
81421334
BS
647Move a subtree to some other place. See above, the subsection
648\fBThe move operation\fR.
00d1cc1d 649.TP
b06c1ca6 650.BR \-n , " \-\-no\-mtab"
60a2a323
KZ
651Mount without writing in
652.IR /etc/mtab .
653This is necessary for example when
654.I /etc
655is on a read-only filesystem.
00d1cc1d 656.TP
d45e8ef9
VD
657.BR \-N , " \-\-namespace " \fIns
658Perform mount in namespace specified by \fIns\fR.
d59766a6
VD
659\fIns\fR is either PID of process running in that namespace
660or special file representing that namespace.
b6cc1210
KZ
661.sp
662.BR mount (8)
663switches to the namespace when it reads /etc/fstab, writes /etc/mtab (or writes to /run/mount) and calls
559ee54a 664.BR mount (2)
b6cc1210
KZ
665system call, otherwise it runs in the original namespace. It means that the target namespace does not have
666to contain any libraries or another requirements necessary to execute
559ee54a 667.BR mount (2)
b6cc1210
KZ
668command.
669.sp
d59766a6 670See \fBnamespaces\fR(7) for more information.
d45e8ef9 671.TP
b06c1ca6 672.BR \-O , " \-\-test\-opts " \fIopts
00d1cc1d
BS
673Limit the set of filesystems to which the
674.B \-a
675option applies. In this regard it is like the
676.B \-t
677option except that
678.B \-O
679is useless without
680.BR \-a .
681For example, the command:
682.RS
683.RS
684.sp
685.B "mount \-a \-O no_netdev"
686.sp
687.RE
688mounts all filesystems except those which have the option
689.I _netdev
690specified in the options field in the
691.I /etc/fstab
692file.
4593e075 693
00d1cc1d
BS
694It is different from
695.B \-t
696in that each option is matched exactly; a leading
697.B no
698at the beginning of one option does not negate the rest.
699
700The
701.B \-t
702and
703.B \-O
704options are cumulative in effect; that is, the command
705.RS
706.sp
707.B "mount \-a \-t ext2 \-O _netdev"
708.sp
709.RE
710mounts all ext2 filesystems with the _netdev option, not all filesystems
711that are either ext2 or have the _netdev option specified.
712.RE
713.TP
714.BR \-o , " \-\-options " \fIopts
715Use the specified mount options. The \fIopts\fR argument is
716a comma-separated list. For example:
717.RS
718.RS
719.sp
720.B "mount LABEL=mydisk \-o noatime,nodev,nosuid"
721.sp
722.RE
723
724For more details, see the
725.B FILESYSTEM-INDEPENDENT MOUNT OPTIONS
726and
727.B FILESYSTEM-SPECIFIC MOUNT OPTIONS
728sections.
729.RE
730
7238285b
VD
731.TP
732.BR "\-\-options\-mode " \fImode
733Controls how to combine options from fstab/mtab with options from command line.
734\fImode\fR can be one of
735.BR ignore ", " append ", " prepend " or " replace .
50ed5519 736For example \fBappend\fR means that options from fstab are appended to options from command line.
b8ec0cb4
KZ
737Default value is \fBprepend\fR -- it means command line options are evaluated after fstab options.
738Note that the last option wins if there are conflicting ones.
7238285b
VD
739
740.TP
741.BR "\-\-options\-source " \fIsource
742Source of default options.
743\fIsource\fR is comma separated list of
744.BR fstab ", " mtab " and " disable .
745\fBdisable\fR disables
746.BR fstab " and " mtab
747and disables \fB\-\-options\-source\-force\fR.
748Default value is \fBfstab,mtab\fR.
749
750.TP
0bb7e904 751.B \-\-options\-source\-force
7238285b
VD
752Use options from fstab/mtab even if both \fIdevice\fR and \fIdir\fR are specified.
753
00d1cc1d
BS
754.TP
755.BR \-R , " \-\-rbind"
756Remount a subtree and all possible submounts somewhere else (so that its
81421334
BS
757contents are available in both places). See above, the subsection
758\fBBind mounts\fR.
00d1cc1d 759.TP
b06c1ca6 760.BR \-r , " \-\-read\-only"
3711f113 761Mount the filesystem read-only. A synonym is
60a2a323 762.BR "\-o ro" .
00d1cc1d 763.sp
60a2a323 764Note that, depending on the filesystem type, state and kernel behavior, the
3711f113
BS
765system may still write to the device. For example, ext3 and ext4 will replay the
766journal if the filesystem is dirty. To prevent this kind of write access, you
767may want to mount an ext3 or ext4 filesystem with the \fBro,noload\fR mount
768options or set the block device itself to read-only mode, see the
769.BR blockdev (8)
770command.
00d1cc1d
BS
771.TP
772.B \-s
773Tolerate sloppy mount options rather than failing. This will ignore mount
774options not supported by a filesystem type. Not all filesystems support this
775option. Currently it's supported by the \fBmount.nfs\fR mount helper only.
776.TP
777.BI \-\-source " device"
778If only one argument for the mount command is given then the argument might be
779interpreted as target (mountpoint) or source (device). This option allows to
780explicitly define that the argument is the mount source.
781.TP
782.BI \-\-target " directory"
783If only one argument for the mount command is given then the argument might be
784interpreted as target (mountpoint) or source (device). This option allows to
785explicitly define that the argument is the mount target.
786.TP
787.BR \-T , " \-\-fstab " \fIpath
3711f113 788Specifies an alternative fstab file. If \fIpath\fP is a directory then the files
c633953c 789in the directory are sorted by
3711f113
BS
790.BR strverscmp (3);
791files that start with "."\& or without an \&.fstab extension are ignored. The option
792can be specified more than once. This option is mostly designed for initramfs
793or chroot scripts where additional configuration is specified beyond standard
c633953c 794system configuration.
00d1cc1d 795.sp
3711f113
BS
796Note that \fBmount\fR(8) does not pass the option \fB\-\-fstab\fP to the
797\fB/sbin/mount.\fItype\fR helpers, meaning that the alternative fstab files will be
798invisible for the helpers. This is no problem for normal mounts, but user
799(non-root) mounts always require fstab to verify the user's rights.
00d1cc1d
BS
800.TP
801.BR \-t , " \-\-types " \fIfstype
60a2a323
KZ
802The argument following the
803.B \-t
804is used to indicate the filesystem type. The filesystem types which are
00d1cc1d 805currently supported depend on the running kernel. See
e9b6e76a 806.I /proc/filesystems
60a2a323 807and
e9b6e76a 808.I /lib/modules/$(uname -r)/kernel/fs
00d1cc1d 809for a complete list of the filesystems. The most common are ext2, ext3, ext4,
e9b6e76a 810xfs, btrfs, vfat, sysfs, proc, nfs and cifs.
00d1cc1d 811.sp
60a2a323
KZ
812The programs
813.B mount
814and
815.B umount
3711f113
BS
816support filesystem subtypes. The subtype is defined by a '.subtype' suffix. For
817example 'fuse.sshfs'. It's recommended to use subtype notation rather than add
60a2a323 818any prefix to the mount source (for example 'sshfs#example.com' is
ef75bc88 819deprecated).
60a2a323 820
60a2a323
KZ
821If no
822.B \-t
823option is given, or if the
824.B auto
825type is specified, mount will try to guess the desired type.
826Mount uses the blkid library for guessing the filesystem
827type; if that does not turn up anything that looks familiar,
828mount will try to read the file
829.IR /etc/filesystems ,
830or, if that does not exist,
831.IR /proc/filesystems .
832All of the filesystem types listed there will be tried,
81421334 833except for those that are labeled "nodev" (e.g.\&
60a2a323
KZ
834.IR devpts ,
835.I proc
836and
837.IR nfs ).
838If
839.I /etc/filesystems
3711f113 840ends in a line with a single *, mount will read
60a2a323 841.I /proc/filesystems
3711f113
BS
842afterwards. While trying, all filesystem types will be
843mounted with the mount option \fBsilent\fR.
00d1cc1d 844.sp
60a2a323
KZ
845The
846.B auto
847type may be useful for user-mounted floppies.
848Creating a file
849.I /etc/filesystems
850can be useful to change the probe order (e.g., to try vfat before msdos
851or ext3 before ext2) or if you use a kernel module autoloader.
00d1cc1d 852.sp
3711f113 853More than one type may be specified in a comma-separated
00d1cc1d 854list, for option
e9b6e76a 855.B \-t
00d1cc1d 856as well as in an
e9b6e76a 857.I /etc/fstab
00d1cc1d
BS
858entry. The list of filesystem types for option
859.B \-t
e9b6e76a 860can be prefixed with
60a2a323
KZ
861.B no
862to specify the filesystem types on which no action should be taken.
e9b6e76a
KZ
863The prefix
864.B no
00d1cc1d 865has no effect when specified in an
e9b6e76a
KZ
866.I /etc/fstab
867entry.
00d1cc1d 868.sp
e9b6e76a
KZ
869The prefix
870.B no
871can be meaningful with the
60a2a323 872.B \-a
e9b6e76a 873option. For example, the command
60a2a323
KZ
874.RS
875.RS
876.sp
6070a985 877.B "mount \-a \-t nomsdos,smbfs"
60a2a323
KZ
878.sp
879.RE
880mounts all filesystems except those of type
881.I msdos
882and
6070a985
BS
883.IR smbfs .
884.sp
e9b6e76a
KZ
885For most types all the
886.B mount
887program has to do is issue a simple
42632a90 888.BR mount (2)
e9b6e76a
KZ
889system call, and no detailed knowledge of the filesystem type is required.
890For a few types however (like nfs, nfs4, cifs, smbfs, ncpfs) an ad hoc code is
891necessary. The nfs, nfs4, cifs, smbfs, and ncpfs filesystems
892have a separate mount program. In order to make it possible to
893treat all types in a uniform way, \fBmount\fR will execute the program
894.BI /sbin/mount. type
895(if that exists) when called with type
896.IR type .
897Since different versions of the
898.B smbmount
899program have different calling conventions,
900.B /sbin/mount.smbfs
901may have to be a shell script that sets up the desired call.
60a2a323 902.RE
00d1cc1d
BS
903.TP
904.BR \-U , " \-\-uuid " \fIuuid
905Mount the partition that has the specified
906.IR uuid .
907.TP
908.BR \-v , " \-\-verbose"
909Verbose mode.
910.TP
b06c1ca6 911.BR \-w , " \-\-rw" , " \-\-read\-write"
6dede2f2 912Mount the filesystem read/write. The read-write is kernel default. A synonym is
00d1cc1d 913.BR "\-o rw" .
6dede2f2
KZ
914
915Note that specify \fB\-w\fR on command line forces \fBmount\fR command
916to never try read-only mount on write-protected devices. The default is
917try read-only if the previous mount syscall with read-write flags failed.
00d1cc1d
BS
918.TP
919.BR \-V , " \-\-version"
920Display version information and exit.
921.TP
922.BR \-h , " \-\-help"
923Display help text and exit.
60a2a323 924
3711f113 925.SH FILESYSTEM-INDEPENDENT MOUNT OPTIONS
60a2a323
KZ
926Some of these options are only useful when they appear in the
927.I /etc/fstab
928file.
929
930Some of these options could be enabled or disabled by default
3711f113
BS
931in the system kernel. To check the current setting see the options
932in /proc/mounts. Note that filesystems also have per-filesystem
58d1d54d
KZ
933specific default mount options (see for example \fBtune2fs \-l\fP
934output for extN filesystems).
60a2a323
KZ
935
936The following options apply to any filesystem that is being
0d05f161 937mounted (but not every filesystem actually honors them \(en e.g.\&, the
60a2a323 938.B sync
248be5c9 939option today has an effect only for ext2, ext3, ext4, fat, vfat, ufs and xfs):
60a2a323
KZ
940
941.TP
942.B async
3711f113 943All I/O to the filesystem should be done asynchronously. (See also the
60a2a323
KZ
944.B sync
945option.)
946.TP
947.B atime
81421334
BS
948Do not use the \fBnoatime\fR feature, so the inode access time is controlled
949by kernel defaults. See also the descriptions of the \fB\%relatime\fR and
60a2a323 950.B strictatime
60a2a323
KZ
951mount options.
952.TP
953.B noatime
81421334
BS
954Do not update inode access times on this filesystem (e.g.\& for faster
955access on the news spool to speed up news servers). This works for all
956inode types (directories too), so it implies \fB\%nodiratime\fR.
60a2a323
KZ
957.TP
958.B auto
959Can be mounted with the
960.B \-a
961option.
962.TP
963.B noauto
964Can only be mounted explicitly (i.e., the
965.B \-a
966option will not cause the filesystem to be mounted).
967.TP
81421334
BS
968.na
969.BR context=\fIcontext ", " fscontext=\fIcontext ", " defcontext=\fIcontext ", and " \%rootcontext=\fIcontext
970.ad
60a2a323 971The
0d05f161 972.B context=
60a2a323
KZ
973option is useful when mounting filesystems that do not support
974extended attributes, such as a floppy or hard disk formatted with VFAT, or
d901e427
KZ
975systems that are not normally running under SELinux, such as an ext3 or ext4 formatted
976
3711f113 977disk from a non-SELinux workstation. You can also use
0d05f161 978.B context=
3711f113
BS
979on filesystems you do not trust, such as a floppy. It also helps in compatibility with
980xattr-supporting filesystems on earlier 2.4.<x> kernel versions. Even where
60a2a323
KZ
981xattrs are supported, you can save time not having to label every file by
982assigning the entire disk one security context.
983
984A commonly used option for removable media is
81421334 985.BR \%context="system_u:object_r:removable_t" .
60a2a323
KZ
986
987Two other options are
0d05f161 988.B fscontext=
60a2a323
KZ
989and
990.BR defcontext= ,
3711f113 991both of which are mutually exclusive of the context option. This means you
60a2a323
KZ
992can use fscontext and defcontext with each other, but neither can be used with
993context.
994
995The
0d05f161 996.B fscontext=
60a2a323 997option works for all filesystems, regardless of their xattr
3711f113
BS
998support. The fscontext option sets the overarching filesystem label to a
999specific security context. This filesystem label is separate from the
1000individual labels on the files. It represents the entire filesystem for
60a2a323
KZ
1001certain kinds of permission checks, such as during mount or file creation.
1002Individual file labels are still obtained from the xattrs on the files
3711f113 1003themselves. The context option actually sets the aggregate context that
60a2a323
KZ
1004fscontext provides, in addition to supplying the same label for individual
1005files.
1006
1007You can set the default security context for unlabeled files using
0d05f161 1008.B defcontext=
3711f113 1009option. This overrides the value set for unlabeled files in the policy and requires a
60a2a323
KZ
1010filesystem that supports xattr labeling.
1011
1012The
0d05f161 1013.B rootcontext=
60a2a323 1014option allows you to explicitly label the root inode of a FS being mounted
60c02107 1015before that FS or inode becomes visible to userspace. This was found to be
60a2a323
KZ
1016useful for things like stateless linux.
1017
60c02107
BS
1018Note that the kernel rejects any remount request that includes the context
1019option, \fBeven\fP when unchanged from the current context.
60a2a323 1020
60c02107
BS
1021.BR "Warning: the \fIcontext\fP value might contain commas" ,
1022in which case the value has to be properly quoted, otherwise
60a2a323 1023.BR mount (8)
60c02107
BS
1024will interpret the comma as a separator between mount options. Don't forget that
1025the shell strips off quotes and thus
1026.BR "double quoting is required" .
1027For example:
60a2a323
KZ
1028.RS
1029.RS
1030.sp
0d05f161
BIG
1031.nf
1032.B mount \-t tmpfs none /mnt \-o \e
81421334 1033.B \ \ 'context="system_u:object_r:tmp_t:s0:c127,c456",noexec'
0d05f161 1034.fi
60a2a323
KZ
1035.sp
1036.RE
60a2a323 1037For more details, see
60c02107 1038.BR selinux (8).
60a2a323
KZ
1039.RE
1040
1041.TP
1042.B defaults
3711f113
BS
1043Use the default options:
1044.BR rw ", " suid ", " dev ", " exec ", " auto ", " nouser ", and " async .
58d1d54d 1045
3711f113
BS
1046Note that the real set of all default mount options depends on kernel
1047and filesystem type. See the beginning of this section for more details.
60a2a323
KZ
1048.TP
1049.B dev
1050Interpret character or block special devices on the filesystem.
1051.TP
1052.B nodev
1053Do not interpret character or block special devices on the file
1054system.
1055.TP
1056.B diratime
3711f113 1057Update directory inode access times on this filesystem. This is the default.
81421334 1058(This option is ignored when \fBnoatime\fR is set.)
60a2a323
KZ
1059.TP
1060.B nodiratime
81421334
BS
1061Do not update directory inode access times on this filesystem.
1062(This option is implied when \fBnoatime\fR is set.)
60a2a323
KZ
1063.TP
1064.B dirsync
1065All directory updates within the filesystem should be done synchronously.
1066This affects the following system calls: creat, link, unlink, symlink,
1067mkdir, rmdir, mknod and rename.
1068.TP
1069.B exec
1070Permit execution of binaries.
1071.TP
1072.B noexec
3711f113 1073Do not permit direct execution of any binaries on the mounted filesystem.
60a2a323
KZ
1074.TP
1075.B group
00d1cc1d
BS
1076Allow an ordinary user to mount the filesystem if one
1077of that user's groups matches the group of the device.
60a2a323
KZ
1078This option implies the options
1079.BR nosuid " and " nodev
1080(unless overridden by subsequent options, as in the option line
1081.BR group,dev,suid ).
1082.TP
1083.B iversion
1084Every time the inode is modified, the i_version field will be incremented.
1085.TP
1086.B noiversion
1087Do not increment the i_version inode field.
1088.TP
1089.B mand
3711f113 1090Allow mandatory locks on this filesystem. See
60a2a323
KZ
1091.BR fcntl (2).
1092.TP
1093.B nomand
1094Do not allow mandatory locks on this filesystem.
1095.TP
1096.B _netdev
1097The filesystem resides on a device that requires network access
1098(used to prevent the system from attempting to mount these filesystems
1099until the network has been enabled on the system).
1100.TP
1101.B nofail
1102Do not report errors for this device if it does not exist.
1103.TP
1104.B relatime
1105Update inode access times relative to modify or change time. Access
1106time is only updated if the previous access time was earlier than the
81421334 1107current modify or change time. (Similar to \fB\%noatime\fR, but it doesn't
3711f113
BS
1108break \fBmutt\fR or other applications that need to know if a file has been
1109read since the last time it was modified.)
60a2a323
KZ
1110
1111Since Linux 2.6.30, the kernel defaults to the behavior provided by this
1112option (unless
81421334 1113.B \%noatime
3711f113 1114was specified), and the
81421334 1115.B \%strictatime
3711f113
BS
1116option is required to obtain traditional semantics. In addition, since Linux
11172.6.30, the file's last access time is always updated if it is more than 1
60a2a323
KZ
1118day old.
1119.TP
1120.B norelatime
3711f113 1121Do not use the
60a2a323 1122.B relatime
3711f113 1123feature. See also the
60a2a323
KZ
1124.B strictatime
1125mount option.
1126.TP
1127.B strictatime
3711f113
BS
1128Allows to explicitly request full atime updates. This makes it
1129possible for the kernel to default to
81421334 1130.B \%relatime
60a2a323 1131or
81421334 1132.B \%noatime
3711f113 1133but still allow userspace to override it. For more details about the default
60a2a323
KZ
1134system mount options see /proc/mounts.
1135.TP
1136.B nostrictatime
ee312c65 1137Use the kernel's default behavior for inode access time updates.
60a2a323 1138.TP
8c7f073a
KZ
1139.B lazytime
1140Only update times (atime, mtime, ctime) on the in-memory version of the file inode.
1141
1142This mount option significantly reduces writes to the inode table for
1143workloads that perform frequent random writes to preallocated files.
8c7f073a
KZ
1144
1145The on-disk timestamps are updated only when:
1146.sp
1147.RS
1148- the inode needs to be updated for some change unrelated to file timestamps
1149.sp
1150- the application employs
1151.BR fsync (2),
1152.BR syncfs (2),
1153or
1154.BR sync (2)
1155.sp
1156- an undeleted inode is evicted from memory
1157.sp
1158- more than 24 hours have passed since the i-node was written to disk.
1159.RE
1160.sp
1161.TP
1162.B nolazytime
c4417ee9 1163Do not use the lazytime feature.
8c7f073a 1164.TP
60a2a323 1165.B suid
9de7fe4a
PW
1166Honor set-user-ID and set-group-ID bits or file capabilities when
1167executing programs from this filesystem.
60a2a323
KZ
1168.TP
1169.B nosuid
9de7fe4a
PW
1170Do not honor set-user-ID and set-group-ID bits or file capabilities when
1171executing programs from this filesystem.
60a2a323
KZ
1172.TP
1173.B silent
1174Turn on the silent flag.
1175.TP
1176.B loud
1177Turn off the silent flag.
1178.TP
1179.B owner
00d1cc1d
BS
1180Allow an ordinary user to mount the filesystem if that
1181user is the owner of the device.
60a2a323
KZ
1182This option implies the options
1183.BR nosuid " and " nodev
1184(unless overridden by subsequent options, as in the option line
1185.BR owner,dev,suid ).
1186.TP
1187.B remount
1188Attempt to remount an already-mounted filesystem. This is commonly
1189used to change the mount flags for a filesystem, especially to make a
3711f113 1190readonly filesystem writable. It does not change device or mount point.
60a2a323 1191
9b76b0e9
KZ
1192The remount operation together with the
1193.B bind
1194flag has special semantic. See above, the subsection \fBBind mounts\fR.
1195
24983035 1196The remount functionality follows the standard way the mount command works
81421334
BS
1197with options from fstab. This means that \fBmount\fR does not
1198read fstab (or mtab) only when both
0d05f161 1199.I device
60a2a323 1200and
0d05f161 1201.I dir
3711f113 1202are specified.
81421334
BS
1203.sp
1204.in +4
0d05f161 1205.B "mount \-o remount,rw /dev/foo /dir"
81421334
BS
1206.in
1207.sp
60a2a323 1208After this call all old mount options are replaced and arbitrary stuff from
24983035
KZ
1209fstab (or mtab) is ignored, except the loop= option which is internally
1210generated and maintained by the mount command.
81421334
BS
1211.sp
1212.in +4
0d05f161 1213.B "mount \-o remount,rw /dir"
81421334
BS
1214.in
1215.sp
1216After this call, mount reads fstab and merges these options with
1217the options from the command line (\fB\-o\fR).
1218If no mountpoint is found in fstab, then a remount with unspecified source is
24983035 1219allowed.
c22fc041
KZ
1220.sp
1221mount(8) allows to use \fB\-\-all\fR to remount all already mounted filesystems
1222which match a specified filter (\fB\-O\fR and \fB\-t\fR). For example:
1223.sp
1224.in +4
1225.B "mount \-\-all \-o remount,ro -t vfat"
1226.in
1227.sp
1228remounts all already mounted vfat filesystems in read-only mode. The each of the
1229filesystems is remounted by "mount \-o remount,ro /dir" semantic. It means the
1230mount command reads fstab or mtab and merges these options with the options
1231from the command line.
60a2a323
KZ
1232.TP
1233.B ro
1234Mount the filesystem read-only.
1235.TP
1236.B rw
1237Mount the filesystem read-write.
1238.TP
1239.B sync
3711f113
BS
1240All I/O to the filesystem should be done synchronously. In the case of
1241media with a limited number of write cycles
1242(e.g.\& some flash drives), \fBsync\fR may cause life-cycle shortening.
60a2a323
KZ
1243.TP
1244.B user
1245Allow an ordinary user to mount the filesystem.
00d1cc1d
BS
1246The name of the mounting user is written to the mtab file (or to the private
1247libmount file in /run/mount on systems without a regular mtab) so that this
1248same user can unmount the filesystem again.
60a2a323
KZ
1249This option implies the options
1250.BR noexec ", " nosuid ", and " nodev
1251(unless overridden by subsequent options, as in the option line
1252.BR user,exec,dev,suid ).
1253.TP
1254.B nouser
00d1cc1d 1255Forbid an ordinary user to mount the filesystem.
08626e33 1256This is the default; it does not imply any other options.
60a2a323
KZ
1257.TP
1258.B users
00d1cc1d
BS
1259Allow any user to mount and to unmount the filesystem, even
1260when some other ordinary user mounted it.
60a2a323
KZ
1261This option implies the options
1262.BR noexec ", " nosuid ", and " nodev
1263(unless overridden by subsequent options, as in the option line
1264.BR users,exec,dev,suid ).
f3242e06 1265.TP
0a14cc8b
KZ
1266.B X-*
1267All options prefixed with "X-" are interpreted as comments or as userspace
83601b1a 1268application-specific options. These options are not stored in the user space (e.g. mtab file),
00d1cc1d 1269nor sent to the mount.\fItype\fR helpers nor to the
0d05f161 1270.BR mount (2)
0a14cc8b 1271system call. The suggested format is \fBX-\fIappname\fR.\fIoption\fR.
83601b1a 1272.TP
0a14cc8b
KZ
1273.B x-*
1274The same as \fBX-*\fR options, but stored permanently in the user space. It
83601b1a 1275means the options are also available for umount or another operations. Note
0a14cc8b
KZ
1276that maintain mount options in user space is tricky, because it's necessary use
1277libmount based tools and there is no guarantee that the options will be always
1278available (for example after a move mount operation or in unshared namespace).
5c493bd9 1279
0a14cc8b
KZ
1280Note that before util-linux v2.30 the x-* options have not been maintained by
1281libmount and stored in user space (functionality was the same as have X-* now),
1282but due to growing number of use-cases (in initrd, systemd etc.) the
1283functionality have been extended to keep existing fstab configurations usable
1284without a change.
701c6961 1285.TP
0a14cc8b 1286.BR X-mount.mkdir [ = \fImode\fR ]
3711f113
BS
1287Allow to make a target directory (mountpoint). The optional argument
1288.I mode
1289specifies the filesystem access mode used for
0d05f161 1290.BR mkdir (2)
3711f113 1291in octal notation. The default mode is 0755. This functionality is supported
0a14cc8b
KZ
1292only for root users. The option is also supported as x-mount.mkdir, this notation
1293is deprecated for mount.mkdir since v2.30.
60a2a323 1294
3711f113 1295.SH "FILESYSTEM-SPECIFIC MOUNT OPTIONS"
0aade1d3
MF
1296You should consult the respective man page for the filesystem first.
1297If you want to know what options the ext4 filesystem supports, then check the
1298.BR ext4 (5)
1299man page.
1300If that doesn't exist, you can also check the corresponding mount page like
1301.BR mount.cifs (8).
1302Note that you might have to install the respective userland tools.
1303.sp
60a2a323 1304The following options apply only to certain filesystems.
3711f113 1305We sort them by filesystem. They all follow the
60a2a323
KZ
1306.B \-o
1307flag.
00d1cc1d 1308.sp
60a2a323
KZ
1309What options are supported depends a bit on the running kernel.
1310More info may be found in the kernel source subdirectory
1311.IR Documentation/filesystems .
1312
81421334 1313.SS "Mount options for adfs"
60a2a323 1314.TP
0d05f161 1315\fBuid=\fP\,\fIvalue\fP and \fBgid=\fP\,\fIvalue\fP
60a2a323
KZ
1316Set the owner and group of the files in the filesystem (default: uid=gid=0).
1317.TP
0d05f161 1318\fBownmask=\fP\,\fIvalue\fP and \fBothmask=\fP\,\fIvalue\fP
60a2a323
KZ
1319Set the permission mask for ADFS 'owner' permissions and 'other' permissions,
1320respectively (default: 0700 and 0077, respectively).
1321See also
1322.IR /usr/src/linux/Documentation/filesystems/adfs.txt .
81421334
BS
1323
1324.SS "Mount options for affs"
60a2a323 1325.TP
0d05f161 1326\fBuid=\fP\,\fIvalue\fP and \fBgid=\fP\,\fIvalue\fP
60a2a323
KZ
1327Set the owner and group of the root of the filesystem (default: uid=gid=0,
1328but with option
1329.B uid
1330or
1331.B gid
a72fa61a 1332without specified value, the UID and GID of the current process are taken).
60a2a323 1333.TP
0d05f161 1334\fBsetuid=\fP\,\fIvalue\fP and \fBsetgid=\fP\,\fIvalue\fP
60a2a323
KZ
1335Set the owner and group of all files.
1336.TP
1337.BI mode= value
1338Set the mode of all files to
1339.IR value " & 0777"
1340disregarding the original permissions.
1341Add search permission to directories that have read permission.
1342The value is given in octal.
1343.TP
1344.B protect
1345Do not allow any changes to the protection bits on the filesystem.
1346.TP
1347.B usemp
a72fa61a 1348Set UID and GID of the root of the filesystem to the UID and GID
60a2a323 1349of the mount point upon the first sync or umount, and then
3711f113 1350clear this option. Strange...
60a2a323
KZ
1351.TP
1352.B verbose
1353Print an informational message for each successful mount.
1354.TP
1355.BI prefix= string
1356Prefix used before volume name, when following a link.
1357.TP
1358.BI volume= string
1359Prefix (of length at most 30) used before '/' when following a symbolic link.
1360.TP
1361.BI reserved= value
1362(Default: 2.) Number of unused blocks at the start of the device.
1363.TP
1364.BI root= value
1365Give explicitly the location of the root block.
1366.TP
1367.BI bs= value
3711f113 1368Give blocksize. Allowed values are 512, 1024, 2048, 4096.
60a2a323
KZ
1369.TP
1370.BR grpquota | noquota | quota | usrquota
1371These options are accepted but ignored.
1372(However, quota utilities may react to such strings in
1373.IR /etc/fstab .)
81421334 1374
81421334 1375.SS "Mount options for debugfs"
60a2a323
KZ
1376The debugfs filesystem is a pseudo filesystem, traditionally mounted on
1377.IR /sys/kernel/debug .
1378.\" or just /debug
1379.\" present since 2.6.11
88633047
DR
1380As of kernel version 3.4, debugfs has the following options:
1381.TP
1382.BI uid= n ", gid=" n
1383Set the owner and group of the mountpoint.
1384.TP
1385.BI mode= value
1386Sets the mode of the mountpoint.
81421334
BS
1387
1388.SS "Mount options for devpts"
60a2a323
KZ
1389The devpts filesystem is a pseudo filesystem, traditionally mounted on
1390.IR /dev/pts .
1391In order to acquire a pseudo terminal, a process opens
1392.IR /dev/ptmx ;
1393the number of the pseudo terminal is then made available to the process
1394and the pseudo terminal slave can be accessed as
1395.IR /dev/pts/ <number>.
1396.TP
0d05f161 1397\fBuid=\fP\,\fIvalue\fP and \fBgid=\fP\,\fIvalue\fP
60a2a323 1398This sets the owner or the group of newly created PTYs to
3711f113 1399the specified values. When nothing is specified, they will
60a2a323
KZ
1400be set to the UID and GID of the creating process.
1401For example, if there is a tty group with GID 5, then
1402.B gid=5
1403will cause newly created PTYs to belong to the tty group.
1404.TP
1405.BI mode= value
1406Set the mode of newly created PTYs to the specified value.
1407The default is 0600.
1408A value of
1409.B mode=620
1410and
1411.B gid=5
1412makes "mesg y" the default on newly created PTYs.
1413.TP
1414\fBnewinstance
1415Create a private instance of devpts filesystem, such that
1416indices of ptys allocated in this new instance are
1417independent of indices created in other instances of devpts.
1418
1419All mounts of devpts without this
1420.B newinstance
b9c3b903 1421option share the same set of pty indices (i.e. legacy mode).
60a2a323
KZ
1422Each mount of devpts with the
1423.B newinstance
1424option has a private set of pty indices.
1425
1426This option is mainly used to support containers in the
3711f113 1427linux kernel. It is implemented in linux kernel versions
60a2a323
KZ
1428starting with 2.6.29. Further, this mount option is valid
1429only if CONFIG_DEVPTS_MULTIPLE_INSTANCES is enabled in the
1430kernel configuration.
1431
1432To use this option effectively,
0d05f161 1433.I /dev/ptmx
60a2a323 1434must be a symbolic link to
0d05f161 1435.I pts/ptmx.
60a2a323 1436See
0d05f161 1437.I Documentation/filesystems/devpts.txt
60a2a323
KZ
1438in the linux kernel source tree for details.
1439.TP
1440.BI ptmxmode= value
1441
1442Set the mode for the new
0d05f161 1443.I ptmx
60a2a323
KZ
1444device node in the devpts filesystem.
1445
1446With the support for multiple instances of devpts (see
1447.B newinstance
1448option above), each instance has a private
0d05f161 1449.I ptmx
60a2a323 1450node in the root of the devpts filesystem (typically
0d05f161 1451.IR /dev/pts/ptmx ).
60a2a323
KZ
1452
1453For compatibility with older versions of the kernel, the
1454default mode of the new
0d05f161 1455.I ptmx
60a2a323
KZ
1456node is 0000.
1457.BI ptmxmode= value
1458specifies a more useful mode for the
0d05f161 1459.I ptmx
60a2a323
KZ
1460node and is highly recommended when the
1461.B newinstance
1462option is specified.
1463
1464This option is only implemented in linux kernel versions
3711f113 1465starting with 2.6.29. Further, this option is valid only if
60a2a323
KZ
1466CONFIG_DEVPTS_MULTIPLE_INSTANCES is enabled in the kernel
1467configuration.
1468
81421334 1469.SS "Mount options for fat"
60a2a323
KZ
1470(Note:
1471.I fat
1472is not a separate filesystem, but a common part of the
1473.IR msdos ,
1474.I umsdos
1475and
1476.I vfat
1477filesystems.)
1478.TP
1479.BR blocksize= { 512 | 1024 | 2048 }
3711f113 1480Set blocksize (default 512). This option is obsolete.
60a2a323 1481.TP
0d05f161 1482\fBuid=\fP\,\fIvalue\fP and \fBgid=\fP\,\fIvalue\fP
60a2a323 1483Set the owner and group of all files.
a72fa61a 1484(Default: the UID and GID of the current process.)
60a2a323
KZ
1485.TP
1486.BI umask= value
1487Set the umask (the bitmask of the permissions that are
1488.B not
3711f113 1489present). The default is the umask of the current process.
60a2a323
KZ
1490The value is given in octal.
1491.TP
1492.BI dmask= value
1493Set the umask applied to directories only.
1494The default is the umask of the current process.
1495The value is given in octal.
60a2a323
KZ
1496.TP
1497.BI fmask= value
1498Set the umask applied to regular files only.
1499The default is the umask of the current process.
1500The value is given in octal.
60a2a323
KZ
1501.TP
1502.BI allow_utime= value
1503This option controls the permission check of mtime/atime.
1504.RS
1505.TP
1506.B 20
1507If current process is in group of file's group ID, you can change timestamp.
1508.TP
1509.B 2
1510Other users can change timestamp.
1511.PP
1512The default is set from `dmask' option. (If the directory is writable,
8323d9fd 1513.BR utime (2)
3711f113 1514is also allowed. I.e.\& \s+3~\s0dmask & 022)
60a2a323
KZ
1515
1516Normally
8323d9fd 1517.BR utime (2)
60a2a323 1518checks current process is owner of the file, or it has
a72fa61a 1519CAP_FOWNER capability. But FAT filesystem doesn't have UID/GID on disk, so
3711f113 1520normal check is too inflexible. With this option you can relax it.
60a2a323
KZ
1521.RE
1522.TP
1523.BI check= value
b9c3b903 1524Three different levels of pickiness can be chosen:
60a2a323
KZ
1525.RS
1526.TP
1527.BR r [ elaxed ]
1528Upper and lower case are accepted and equivalent, long name parts are
fb724eef 1529truncated (e.g.\&
60a2a323
KZ
1530.I verylongname.foobar
1531becomes
1532.IR verylong.foo ),
1533leading and embedded spaces are accepted in each name part (name and extension).
1534.TP
1535.BR n [ ormal ]
1536Like "relaxed", but many special characters (*, ?, <, spaces, etc.) are
1537rejected. This is the default.
1538.TP
1539.BR s [ trict ]
3711f113
BS
1540Like "normal", but names that contain long parts or special characters
1541that are sometimes used on Linux but are not accepted by MS-DOS
1542(+, =, etc.) are rejected.
60a2a323
KZ
1543.RE
1544.TP
1545.BI codepage= value
1546Sets the codepage for converting to shortname characters on FAT
3711f113 1547and VFAT filesystems. By default, codepage 437 is used.
60a2a323 1548.TP
3711f113 1549.BI conv= mode
9f3d0fce 1550This option is obsolete and may fail or being ignored.
60a2a323
KZ
1551.TP
1552.BI cvf_format= module
1553Forces the driver to use the CVF (Compressed Volume File) module
1554.RI cvf_ module
3711f113 1555instead of auto-detection. If the kernel supports kmod, the
60a2a323
KZ
1556cvf_format=xxx option also controls on-demand CVF module loading.
1557This option is obsolete.
1558.TP
1559.BI cvf_option= option
3711f113 1560Option passed to the CVF module. This option is obsolete.
60a2a323
KZ
1561.TP
1562.B debug
1563Turn on the
1564.I debug
1565flag. A version string and a list of filesystem parameters will be
1566printed (these data are also printed if the parameters appear to be
1567inconsistent).
1568.TP
ec34526a
SM
1569.B discard
1570If set, causes discard/TRIM commands to be issued to the block device
3711f113 1571when blocks are freed. This is useful for SSD devices and
f036b4c7 1572sparse/thinly-provisioned LUNs.
ec34526a 1573.TP
3c1f7603
JK
1574.B dos1xfloppy
1575If set, use a fallback default BIOS Parameter Block configuration, determined
81421334 1576by backing device size. These static parameters match defaults assumed by DOS
3c1f7603
JK
15771.x for 160 kiB, 180 kiB, 320 kiB, and 360 kiB floppies and floppy images.
1578.TP
1579.BR errors= { panic | continue | remount-ro }
1580Specify FAT behavior on critical errors: panic, continue without doing
1581anything, or remount the partition in read-only mode (default behavior).
1582.TP
1583.BR fat= { 12 | 16 | 32 }
60a2a323
KZ
1584Specify a 12, 16 or 32 bit fat. This overrides
1585the automatic FAT type detection routine. Use with caution!
1586.TP
1587.BI iocharset= value
1588Character set to use for converting between 8 bit characters
3711f113 1589and 16 bit Unicode characters. The default is iso8859-1.
60a2a323
KZ
1590Long filenames are stored on disk in Unicode format.
1591.TP
3c1f7603
JK
1592.BR nfs= { stale_rw | nostale_ro }
1593Enable this only if you want to export the FAT filesystem over NFS.
1594
1595.BR stale_rw :
1596This option maintains an index (cache) of directory inodes which is used by the
81421334 1597nfs-related code to improve look-ups. Full file operations (read/write) over
3c1f7603
JK
1598NFS are supported but with cache eviction at NFS server, this could result in
1599spurious
1600.B ESTALE
1601errors.
1602
1603.BR nostale_ro :
d35df4db 1604This option bases the inode number and file handle
3c1f7603
JK
1605on the on-disk location of a file in the FAT directory entry.
1606This ensures that
1607.B ESTALE
1608will not be returned after a file is
81421334 1609evicted from the inode cache. However, it means that operations
d35df4db 1610such as rename, create and unlink could cause file handles that
3c1f7603 1611previously pointed at one file to point at a different file,
81421334 1612potentially causing data corruption. For this reason, this
3c1f7603
JK
1613option also mounts the filesystem readonly.
1614
1615To maintain backward compatibility, '-o nfs' is also accepted,
1616defaulting to
1617.BR stale_rw .
ec34526a 1618.TP
0bb7e904 1619.B tz=UTC
60a2a323
KZ
1620This option disables the conversion of timestamps
1621between local time (as used by Windows on FAT) and UTC
1622(which Linux uses internally). This is particularly
1623useful when mounting devices (like digital cameras)
1624that are set to UTC in order to avoid the pitfalls of
1625local time.
1626.TP
b7b16b0b
JK
1627.BI time_offset= minutes
1628Set offset for conversion of timestamps from local time used by FAT to UTC.
1629I.e.,
1630.I minutes
6627bc79 1631will be subtracted from each timestamp to convert it to UTC used
81421334 1632internally by Linux. This is useful when the time zone set in the kernel via
b7b16b0b 1633.BR settimeofday (2)
81421334 1634is not the time zone used by the filesystem. Note
b7b16b0b
JK
1635that this option still does not provide correct time stamps in all cases in
1636presence of DST - time stamps in a different DST setting will be off by one
1637hour.
1638.TP
60a2a323
KZ
1639.B quiet
1640Turn on the
1641.I quiet
1642flag. Attempts to chown or chmod files do not return errors,
3711f113 1643although they fail. Use with caution!
60a2a323 1644.TP
3c1f7603 1645.B rodir
81421334 1646FAT has the ATTR_RO (read-only) attribute. On Windows, the ATTR_RO of the
3c1f7603 1647directory will just be ignored, and is used only by applications as a flag
81421334 1648(e.g.\& it's set for the customized folder).
3c1f7603
JK
1649
1650If you want to use ATTR_RO as read-only flag even for the directory, set this
1651option.
1652.TP
60a2a323
KZ
1653.B showexec
1654If set, the execute permission bits of the file will be allowed only if
3711f113 1655the extension part of the name is \&.EXE, \&.COM, or \&.BAT. Not set by default.
60a2a323
KZ
1656.TP
1657.B sys_immutable
1658If set, ATTR_SYS attribute on FAT is handled as IMMUTABLE flag on Linux.
1659Not set by default.
1660.TP
1661.B flush
1662If set, the filesystem will try to flush to disk more early than normal.
1663Not set by default.
1664.TP
1665.B usefree
3711f113 1666Use the "free clusters" value stored on FSINFO. It'll
60a2a323 1667be used to determine number of free clusters without
3711f113 1668scanning disk. But it's not used by default, because
60a2a323 1669recent Windows don't update it correctly in some
3711f113 1670case. If you are sure the "free clusters" on FSINFO is
60a2a323
KZ
1671correct, by this option you can avoid scanning disk.
1672.TP
1673.BR dots ", " nodots ", " dotsOK= [ yes | no ]
1674Various misguided attempts to force Unix or DOS conventions
1675onto a FAT filesystem.
1676
81421334 1677.SS "Mount options for hfs"
60a2a323
KZ
1678.TP
1679.BI creator= cccc ", type=" cccc
1680Set the creator/type values as shown by the MacOS finder
1681used for creating new files. Default values: '????'.
1682.TP
1683.BI uid= n ", gid=" n
1684Set the owner and group of all files.
a72fa61a 1685(Default: the UID and GID of the current process.)
60a2a323
KZ
1686.TP
1687.BI dir_umask= n ", file_umask=" n ", umask=" n
1688Set the umask used for all directories, all regular files, or all
1689files and directories. Defaults to the umask of the current process.
1690.TP
1691.BI session= n
1692Select the CDROM session to mount.
1693Defaults to leaving that decision to the CDROM driver.
1694This option will fail with anything but a CDROM as underlying device.
1695.TP
1696.BI part= n
1697Select partition number n from the device.
1698Only makes sense for CDROMs.
1699Defaults to not parsing the partition table at all.
1700.TP
1701.B quiet
1702Don't complain about invalid mount options.
1703
81421334 1704.SS "Mount options for hpfs"
60a2a323 1705.TP
0d05f161 1706\fBuid=\fP\,\fIvalue\fP and \fBgid=\fP\,\fIvalue\fP
a72fa61a 1707Set the owner and group of all files. (Default: the UID and GID
60a2a323
KZ
1708of the current process.)
1709.TP
1710.BI umask= value
1711Set the umask (the bitmask of the permissions that are
1712.B not
3711f113 1713present). The default is the umask of the current process.
60a2a323
KZ
1714The value is given in octal.
1715.TP
1716.BR case= { lower | asis }
1717Convert all files names to lower case, or leave them.
1718(Default:
1719.BR case=lower .)
1720.TP
9f3d0fce
RM
1721.BI conv= mode
1722This option is obsolete and may fail or being ignored.
60a2a323
KZ
1723.TP
1724.B nocheck
1725Do not abort mounting when certain consistency checks fail.
1726
81421334 1727.SS "Mount options for iso9660"
60a2a323 1728ISO 9660 is a standard describing a filesystem structure to be used
3711f113 1729on CD-ROMs. (This filesystem type is also seen on some DVDs. See also the
60a2a323
KZ
1730.I udf
1731filesystem.)
1732
1733Normal
1734.I iso9660
b9c3b903 1735filenames appear in an 8.3 format (i.e., DOS-like restrictions on filename
60a2a323
KZ
1736length), and in addition all characters are in upper case. Also there is
1737no field for file ownership, protection, number of links, provision for
1738block/character devices, etc.
1739
1740Rock Ridge is an extension to iso9660 that provides all of these UNIX-like
1741features. Basically there are extensions to each directory record that
1742supply all of the additional information, and when Rock Ridge is in use,
1743the filesystem is indistinguishable from a normal UNIX filesystem (except
1744that it is read-only, of course).
1745.TP
1746.B norock
3711f113 1747Disable the use of Rock Ridge extensions, even if available. Cf.\&
60a2a323
KZ
1748.BR map .
1749.TP
1750.B nojoliet
3711f113 1751Disable the use of Microsoft Joliet extensions, even if available. Cf.\&
60a2a323
KZ
1752.BR map .
1753.TP
1754.BR check= { r [ elaxed ]| s [ trict ]}
1755With
1756.BR check=relaxed ,
1757a filename is first converted to lower case before doing the lookup.
1758This is probably only meaningful together with
1759.B norock
1760and
1761.BR map=normal .
1762(Default:
1763.BR check=strict .)
1764.TP
0d05f161 1765\fBuid=\fP\,\fIvalue\fP and \fBgid=\fP\,\fIvalue\fP
60a2a323
KZ
1766Give all files in the filesystem the indicated user or group id,
1767possibly overriding the information found in the Rock Ridge extensions.
1768(Default:
1769.BR uid=0,gid=0 .)
1770.TP
1771.BR map= { n [ ormal ]| o [ ff ]| a [ corn ]}
1772For non-Rock Ridge volumes, normal name translation maps upper
1773to lower case ASCII, drops a trailing `;1', and converts `;' to `.'.
1774With
1775.B map=off
3711f113 1776no name translation is done. See
60a2a323
KZ
1777.BR norock .
1778(Default:
1779.BR map=normal .)
1780.B map=acorn
1781is like
0d05f161 1782.B map=normal
60a2a323
KZ
1783but also apply Acorn extensions if present.
1784.TP
1785.BI mode= value
1786For non-Rock Ridge volumes, give all files the indicated mode.
9167f4c2 1787(Default: read and execute permission for everybody.)
9f3d0fce 1788Octal mode values require a leading 0.
60a2a323
KZ
1789.TP
1790.B unhide
1791Also show hidden and associated files.
1792(If the ordinary files and the associated or hidden files have
1793the same filenames, this may make the ordinary files inaccessible.)
1794.TP
1795.BR block= { 512 | 1024 | 2048 }
1796Set the block size to the indicated value.
1797(Default:
1798.BR block=1024 .)
1799.TP
9f3d0fce
RM
1800.BI conv= mode
1801This option is obsolete and may fail or being ignored.
60a2a323
KZ
1802.TP
1803.B cruft
1804If the high byte of the file length contains other garbage,
1805set this mount option to ignore the high order bits of the file length.
fb724eef 1806This implies that a file cannot be larger than 16\ MB.
60a2a323
KZ
1807.TP
1808.BI session= x
9f3d0fce 1809Select number of session on multisession CD.
60a2a323
KZ
1810.TP
1811.BI sbsector= xxx
9f3d0fce 1812Session begins from sector xxx.
60a2a323
KZ
1813.LP
1814The following options are the same as for vfat and specifying them only makes
1815sense when using discs encoded using Microsoft's Joliet extensions.
1816.TP
1817.BI iocharset= value
1818Character set to use for converting 16 bit Unicode characters on CD
3711f113 1819to 8 bit characters. The default is iso8859-1.
60a2a323
KZ
1820.TP
1821.B utf8
1822Convert 16 bit Unicode characters on CD to UTF-8.
1823
81421334 1824.SS "Mount options for jfs"
60a2a323
KZ
1825.TP
1826.BI iocharset= name
1827Character set to use for converting from Unicode to ASCII. The default is
1828to do no conversion. Use
1829.B iocharset=utf8
1830for UTF8 translations. This requires CONFIG_NLS_UTF8 to be set in
1831the kernel
1832.I ".config"
1833file.
1834.TP
1835.BI resize= value
1836Resize the volume to
1837.I value
3711f113
BS
1838blocks. JFS only supports growing a volume, not shrinking it. This option
1839is only valid during a remount, when the volume is mounted read-write. The
60a2a323
KZ
1840.B resize
1841keyword with no value will grow the volume to the full size of the partition.
1842.TP
1843.B nointegrity
1844Do not write to the journal. The primary use of this option is to allow
3711f113 1845for higher performance when restoring a volume from backup media. The
f036b4c7 1846integrity of the volume is not guaranteed if the system abnormally ends.
60a2a323
KZ
1847.TP
1848.B integrity
1849Default. Commit metadata changes to the journal. Use this option to remount
1850a volume where the
1851.B nointegrity
1852option was previously specified in order to restore normal behavior.
1853.TP
1854.BR errors= { continue | remount-ro | panic }
ee312c65 1855Define the behavior when an error is encountered.
60a2a323
KZ
1856(Either ignore errors and just mark the filesystem erroneous and continue,
1857or remount the filesystem read-only, or panic and halt the system.)
1858.TP
1859.BR noquota | quota | usrquota | grpquota
1860These options are accepted but ignored.
1861
81421334 1862.SS "Mount options for msdos"
60a2a323
KZ
1863See mount options for fat.
1864If the
1865.I msdos
1866filesystem detects an inconsistency, it reports an error and sets the file
3711f113 1867system read-only. The filesystem can be made writable again by remounting
60a2a323
KZ
1868it.
1869
81421334 1870.SS "Mount options for ncpfs"
60a2a323
KZ
1871Just like
1872.IR nfs ", the " ncpfs
1873implementation expects a binary argument (a
1874.IR "struct ncp_mount_data" )
3711f113 1875to the mount system call. This argument is constructed by
60a2a323
KZ
1876.BR ncpmount (8)
1877and the current version of
1878.B mount
1879(2.12) does not know anything about ncpfs.
1880
81421334 1881.SS "Mount options for ntfs"
60a2a323
KZ
1882.TP
1883.BI iocharset= name
1884Character set to use when returning file names.
1885Unlike VFAT, NTFS suppresses names that contain
3711f113 1886nonconvertible characters. Deprecated.
60a2a323
KZ
1887.TP
1888.BI nls= name
1889New name for the option earlier called
1890.IR iocharset .
60a2a323 1891.TP
0d05f161 1892.B utf8
60a2a323
KZ
1893Use UTF-8 for converting file names.
1894.TP
1895.BR uni_xlate= { 0 | 1 | 2 }
1896For 0 (or `no' or `false'), do not use escape sequences
1897for unknown Unicode characters.
1898For 1 (or `yes' or `true') or 2, use vfat-style 4-byte escape sequences
3711f113 1899starting with ":". Here 2 give a little-endian encoding
60a2a323
KZ
1900and 1 a byteswapped bigendian encoding.
1901.TP
1902.B posix=[0|1]
1903If enabled (posix=1), the filesystem distinguishes between
3711f113
BS
1904upper and lower case. The 8.3 alias names are presented as
1905hard links instead of being suppressed. This option is obsolete.
60a2a323 1906.TP
0d05f161 1907\fBuid=\fP\,\fIvalue\fP, \fBgid=\fP\,\fIvalue\fP and \fBumask=\fP\,\fIvalue\fP
60a2a323
KZ
1908Set the file permission on the filesystem.
1909The umask value is given in octal.
1910By default, the files are owned by root and not readable by somebody else.
1911
81421334 1912.SS "Mount options for overlay"
7054d8a6 1913Since Linux 3.18 the overlay pseudo filesystem implements a union mount for
49b7f95e 1914other filesystems.
7054d8a6
OA
1915
1916An overlay filesystem combines two filesystems - an \fBupper\fR filesystem and
1917a \fBlower\fR filesystem. When a name exists in both filesystems, the object
1918in the upper filesystem is visible while the object in the lower filesystem is
1919either hidden or, in the case of directories, merged with the upper object.
1920
1921The lower filesystem can be any filesystem supported by Linux and does not need
1922to be writable. The lower filesystem can even be another overlayfs. The upper
1923filesystem will normally be writable and if it is it must support the creation
49b7f95e 1924of trusted.* extended attributes, and must provide a valid d_type in readdir
7054d8a6 1925responses, so NFS is not suitable.
49b7f95e 1926
7054d8a6
OA
1927A read-only overlay of two read-only filesystems may use any filesystem type.
1928The options \fBlowerdir\fR and \fBupperdir\fR are combined into a merged
1929directory by using:
1930
1931.RS
1932.br
bed9c1f5
BS
1933.nf
1934.B "mount \-t overlay overlay \e"
1935.B " \-olowerdir=/lower,upperdir=/upper,workdir=/work /merged"
1936.fi
7054d8a6
OA
1937.br
1938.RE
1939
1940.TP
1941.BI lowerdir= directory
1942Any filesystem, does not need to be on a writable filesystem.
1943.TP
1944.BI upperdir= directory
1945The upperdir is normally on a writable filesystem.
1946.TP
1947.BI workdir= directory
1948The workdir needs to be an empty directory on the same filesystem as upperdir.
1949
81421334 1950.SS "Mount options for reiserfs"
60a2a323
KZ
1951Reiserfs is a journaling filesystem.
1952.TP
0d05f161 1953.B conv
60a2a323 1954Instructs version 3.6 reiserfs software to mount a version 3.5 filesystem,
3711f113 1955using the 3.6 format for newly created objects. This filesystem will no
60a2a323
KZ
1956longer be compatible with reiserfs 3.5 tools.
1957.TP
1958.BR hash= { rupasov | tea | r5 | detect }
1959Choose which hash function reiserfs will use to find files within directories.
1960.RS
1961.TP
1962.B rupasov
81421334 1963A hash invented by Yury Yu.\& Rupasov. It is fast and preserves locality,
60a2a323
KZ
1964mapping lexicographically close file names to close hash values.
1965This option should not be used, as it causes a high probability of hash
1966collisions.
1967.TP
1968.B tea
1969A Davis-Meyer function implemented by Jeremy Fitzhardinge.
1970It uses hash permuting bits in the name. It gets high randomness
1971and, therefore, low probability of hash collisions at some CPU cost.
1972This may be used if EHASHCOLLISION errors are experienced with the r5 hash.
1973.TP
1974.B r5
3711f113 1975A modified version of the rupasov hash. It is used by default and is
60a2a323
KZ
1976the best choice unless the filesystem has huge directories and
1977unusual file-name patterns.
1978.TP
1979.B detect
1980Instructs
0d05f161 1981.I mount
60a2a323 1982to detect which hash function is in use by examining
fb724eef 1983the filesystem being mounted, and to write this information into
3711f113 1984the reiserfs superblock. This is only useful on the first mount of
60a2a323
KZ
1985an old format filesystem.
1986.RE
1987.TP
0d05f161 1988.B hashed_relocation
3711f113 1989Tunes the block allocator. This may provide performance improvements
60a2a323
KZ
1990in some situations.
1991.TP
0d05f161 1992.B no_unhashed_relocation
3711f113 1993Tunes the block allocator. This may provide performance improvements
60a2a323
KZ
1994in some situations.
1995.TP
0d05f161 1996.B noborder
81421334 1997Disable the border allocator algorithm invented by Yury Yu.\& Rupasov.
60a2a323
KZ
1998This may provide performance improvements in some situations.
1999.TP
0d05f161 2000.B nolog
3711f113 2001Disable journaling. This will provide slight performance improvements in
60a2a323 2002some situations at the cost of losing reiserfs's fast recovery from crashes.
f036b4c7
MF
2003Even with this option turned on, reiserfs still performs all journaling
2004operations, save for actual writes into its journaling area. Implementation
60a2a323 2005of
0d05f161 2006.I nolog
60a2a323
KZ
2007is a work in progress.
2008.TP
0d05f161 2009.B notail
60a2a323 2010By default, reiserfs stores small files and `file tails' directly into its
3711f113 2011tree. This confuses some utilities such as
60a2a323
KZ
2012.BR LILO (8).
2013This option is used to disable packing of files into the tree.
2014.TP
0d05f161 2015.B replayonly
60a2a323 2016Replay the transactions which are in the journal, but do not actually
3711f113 2017mount the filesystem. Mainly used by
60a2a323
KZ
2018.IR reiserfsck .
2019.TP
2020.BI resize= number
2021A remount option which permits online expansion of reiserfs partitions.
2022Instructs reiserfs to assume that the device has
2023.I number
2024blocks.
2025This option is designed for use with devices which are under logical
2026volume management (LVM).
2027There is a special
2028.I resizer
2029utility which can be obtained from
2030.IR ftp://ftp.namesys.com/pub/reiserfsprogs .
2031.TP
0d05f161 2032.B user_xattr
3711f113 2033Enable Extended User Attributes. See the
dbeb1d73 2034.BR attr (1)
60a2a323
KZ
2035manual page.
2036.TP
0d05f161 2037.B acl
3711f113 2038Enable POSIX Access Control Lists. See the
60a2a323
KZ
2039.BR acl (5)
2040manual page.
2041.TP
fb724eef 2042.BR barrier=none " / " barrier=flush "
94b559e0 2043This disables / enables the use of write barriers in the journaling code.
3711f113 2044barrier=none disables, barrier=flush enables (default). This also requires an
94b559e0
RM
2045IO stack which can support barriers, and if reiserfs gets an error on a barrier
2046write, it will disable barriers again with a warning. Write barriers enforce
60a2a323 2047proper on-disk ordering of journal commits, making volatile disk write caches
94b559e0
RM
2048safe to use, at some performance penalty. If your disks are battery-backed in
2049one way or another, disabling barriers may safely improve performance.
60a2a323 2050
81421334 2051.SS "Mount options for ubifs"
49b7f95e
BS
2052UBIFS is a flash filesystem which works on top of UBI volumes. Note that
2053\fBatime\fR is not supported and is always turned off.
60a2a323
KZ
2054.TP
2055The device name may be specified as
2056.RS
2057.B ubiX_Y
2058UBI device number
2059.BR X ,
2060volume number
2061.B Y
2062.TP
2063.B ubiY
2064UBI device number
2065.BR 0 ,
2066volume number
2067.B Y
2068.TP
2069.B ubiX:NAME
2070UBI device number
2071.BR X ,
2072volume with name
2073.B NAME
2074.TP
2075.B ubi:NAME
2076UBI device number
2077.BR 0 ,
2078volume with name
2079.B NAME
2080.RE
2081Alternative
2082.B !
2083separator may be used instead of
2084.BR : .
2085.TP
2086The following mount options are available:
2087.TP
0d05f161 2088.B bulk_read
3711f113
BS
2089Enable bulk-read. VFS read-ahead is disabled because it slows down the file
2090system. Bulk-Read is an internal optimization. Some flashes may read faster if
2091the data are read at one go, rather than at several read requests. For
60a2a323
KZ
2092example, OneNAND can do "read-while-load" if it reads more than one NAND page.
2093.TP
0d05f161 2094.B no_bulk_read
3711f113 2095Do not bulk-read. This is the default.
60a2a323 2096.TP
0d05f161 2097.B chk_data_crc
3711f113 2098Check data CRC-32 checksums. This is the default.
60a2a323 2099.TP
0d05f161 2100.BR no_chk_data_crc .
3711f113 2101Do not check data CRC-32 checksums. With this option, the filesystem does not
60a2a323 2102check CRC-32 checksum for data, but it does check it for the internal indexing
3711f113 2103information. This option only affects reading, not writing. CRC-32 is always
60a2a323
KZ
2104calculated when writing the data.
2105.TP
2106.BR compr= { none | lzo | zlib }
3711f113 2107Select the default compressor which is used when new files are written. It is
60a2a323
KZ
2108still possible to read compressed files if mounted with the
2109.B none
2110option.
2111
81421334 2112.SS "Mount options for udf"
bde5d1aa
SK
2113UDF is the "Universal Disk Format" filesystem defined by OSTA, the Optical
2114Storage Technology Association, and is often used for DVD-ROM, frequently
2115in the form of a hybrid UDF/ISO-9660 filesystem. It is, however,
2116perfectly usable by itself on disk drives, flash drives and other block devices.
60a2a323
KZ
2117See also
2118.IR iso9660 .
2119.TP
bde5d1aa
SK
2120.B uid=
2121Make all files in the filesystem belong to the given user.
2122uid=forget can be specified independently of (or usually in
2123addition to) uid=<user> and results in UDF
2124not storing uids to the media. In fact the recorded uid
2125is the 32-bit overflow uid -1 as defined by the UDF standard.
2126The value is given as either <user> which is a valid user name or the corresponding
2127decimal user id, or the special string "forget".
2128.TP
60a2a323 2129.B gid=
bde5d1aa
SK
2130Make all files in the filesystem belong to the given group.
2131gid=forget can be specified independently of (or usually in
2132addition to) gid=<group> and results in UDF
2133not storing gids to the media. In fact the recorded gid
2134is the 32-bit overflow gid -1 as defined by the UDF standard.
2135The value is given as either <group> which is a valid group name or the corresponding
2136decimal group id, or the special string "forget".
60a2a323
KZ
2137.TP
2138.B umask=
bde5d1aa 2139Mask out the given permissions from all inodes read from the filesystem.
60a2a323
KZ
2140The value is given in octal.
2141.TP
bde5d1aa
SK
2142.B mode=
2143If mode= is set the permissions of all non-directory inodes read from the
2144filesystem will be set to the given mode. The value is given in octal.
2145.TP
2146.B dmode=
2147If dmode= is set the permissions of all directory inodes read from the
2148filesystem will be set to the given dmode. The value is given in octal.
2149.TP
2150.B bs=
2151Set the block size. Default value prior to kernel version 2.6.30 was
21522048. Since 2.6.30 and prior to 4.11 it was logical device block size with
2153fallback to 2048. Since 4.11 it is logical block size with fallback to
2154any valid block size between logical device block size and 4096.
2155
5b95d7b6
PR
2156For other details see the \fBmkudffs\fP(8) 2.0+ manpage, sections
2157\fBCOMPATIBILITY\fP and \fBBLOCK SIZE\fP.
60a2a323
KZ
2158.TP
2159.B unhide
2160Show otherwise hidden files.
2161.TP
2162.B undelete
2163Show deleted files in lists.
2164.TP
bde5d1aa
SK
2165.B adinicb
2166Embed data in the inode. (default)
2167.TP
2168.B noadinicb
2169Don't embed data in the inode.
2170.TP
2171.B shortad
2172Use short UDF address descriptors.
2173.TP
2174.B longad
2175Use long UDF address descriptors. (default)
2176.TP
60a2a323
KZ
2177.B nostrict
2178Unset strict conformance.
60a2a323 2179.TP
5b95d7b6
PR
2180.B iocharset=
2181Set the NLS character set. This requires kernel compiled with CONFIG_UDF_NLS option.
2182.TP
2183.B utf8
2184Set the UTF-8 character set.
bde5d1aa 2185.SS Mount options for debugging and disaster recovery
60a2a323
KZ
2186.TP
2187.B novrs
bde5d1aa 2188Ignore the Volume Recognition Sequence and attempt to mount anyway.
60a2a323
KZ
2189.TP
2190.B session=
bde5d1aa 2191Select the session number for multi-session recorded optical media. (default= last session)
60a2a323
KZ
2192.TP
2193.B anchor=
bde5d1aa
SK
2194Override standard anchor location. (default= 256)
2195.TP
2196.B lastblock=
2197Set the last block of the filesystem.
2198.SS Unused historical mount options that may be encountered and should be removed
2199.TP
2200.B uid=ignore
5b95d7b6 2201Ignored, use uid=<user> instead.
bde5d1aa
SK
2202.TP
2203.B gid=ignore
5b95d7b6 2204Ignored, use gid=<group> instead.
60a2a323
KZ
2205.TP
2206.B volume=
5b95d7b6 2207Unimplemented and ignored.
60a2a323
KZ
2208.TP
2209.B partition=
5b95d7b6 2210Unimplemented and ignored.
60a2a323
KZ
2211.TP
2212.B fileset=
5b95d7b6 2213Unimplemented and ignored.
60a2a323
KZ
2214.TP
2215.B rootdir=
5b95d7b6 2216Unimplemented and ignored.
60a2a323 2217
81421334 2218.SS "Mount options for ufs"
60a2a323
KZ
2219.TP
2220.BI ufstype= value
2221UFS is a filesystem widely used in different operating systems.
3711f113 2222The problem are differences among implementations. Features of some
60a2a323
KZ
2223implementations are undocumented, so its hard to recognize the
2224type of ufs automatically.
2225That's why the user must specify the type of ufs by mount option.
2226Possible values are:
2227.RS
2228.TP
2229.B old
2230Old format of ufs, this is the default, read only.
2231(Don't forget to give the \-r option.)
2232.TP
2233.B 44bsd
0d05f161 2234For filesystems created by a BSD-like system (NetBSD, FreeBSD, OpenBSD).
60a2a323
KZ
2235.TP
2236.B ufs2
2237Used in FreeBSD 5.x supported as read-write.
2238.TP
2239.B 5xbsd
2240Synonym for ufs2.
2241.TP
2242.B sun
2243For filesystems created by SunOS or Solaris on Sparc.
2244.TP
2245.B sunx86
2246For filesystems created by Solaris on x86.
2247.TP
2248.B hp
2249For filesystems created by HP-UX, read-only.
2250.TP
2251.B nextstep
2252For filesystems created by NeXTStep (on NeXT station) (currently read only).
2253.TP
2254.B nextstep-cd
2255For NextStep CDROMs (block_size == 2048), read-only.
2256.TP
2257.B openstep
2258For filesystems created by OpenStep (currently read only).
2259The same filesystem type is also used by Mac OS X.
2260.RE
2261
2262.TP
2263.BI onerror= value
ee312c65 2264Set behavior on error:
60a2a323
KZ
2265.RS
2266.TP
2267.B panic
2268If an error is encountered, cause a kernel panic.
2269.TP
2270.RB [ lock | umount | repair ]
2271These mount options don't do anything at present;
2272when an error is encountered only a console message is printed.
2273.RE
2274
81421334 2275.SS "Mount options for umsdos"
60a2a323
KZ
2276See mount options for msdos.
2277The
2278.B dotsOK
2279option is explicitly killed by
2280.IR umsdos .
2281
81421334 2282.SS "Mount options for vfat"
60a2a323
KZ
2283First of all, the mount options for
2284.I fat
2285are recognized.
2286The
2287.B dotsOK
2288option is explicitly killed by
2289.IR vfat .
2290Furthermore, there are
2291.TP
2292.B uni_xlate
2293Translate unhandled Unicode characters to special escaped sequences.
2294This lets you backup and restore filenames that are created with any
3711f113
BS
2295Unicode characters. Without this option, a '?' is used when no
2296translation is possible. The escape character is ':' because it is
2297otherwise invalid on the vfat filesystem. The escape sequence
2298that gets used, where u is the Unicode character,
60a2a323
KZ
2299is: ':', (u & 0x3f), ((u>>6) & 0x3f), (u>>12).
2300.TP
2301.B posix
2302Allow two files with names that only differ in case.
2303This option is obsolete.
2304.TP
2305.B nonumtail
2306First try to make a short name without sequence number,
2307before trying
0d05f161 2308.IR name\s+3~\s0num.ext .
60a2a323
KZ
2309.TP
2310.B utf8
2311UTF8 is the filesystem safe 8-bit encoding of Unicode that is used by the
3711f113
BS
2312console. It can be enabled for the filesystem with this option or disabled
2313with utf8=0, utf8=no or utf8=false. If `uni_xlate' gets set, UTF8 gets
60a2a323
KZ
2314disabled.
2315.TP
3711f113 2316.BI shortname= mode
ee312c65 2317Defines the behavior for creation and display of filenames which fit into
3711f113
BS
23188.3 characters. If a long name for a file exists, it will always be the
2319preferred one for display. There are four \fImode\fRs:
60a2a323
KZ
2320.RS
2321.TP
3711f113 2322.B lower
60a2a323
KZ
2323Force the short name to lower case upon display; store a long name when
2324the short name is not all upper case.
2325.TP
3711f113 2326.B win95
60a2a323
KZ
2327Force the short name to upper case upon display; store a long name when
2328the short name is not all upper case.
2329.TP
3711f113
BS
2330.B winnt
2331Display the short name as is; store a long name when the short name is
60a2a323
KZ
2332not all lower case or all upper case.
2333.TP
3711f113 2334.B mixed
60a2a323 2335Display the short name as is; store a long name when the short name is not
3711f113 2336all upper case. This mode is the default since Linux 2.6.32.
60a2a323
KZ
2337.RE
2338
81421334 2339.SS "Mount options for usbfs"
60a2a323 2340.TP
0d05f161 2341\fBdevuid=\fP\,\fIuid\fP and \fBdevgid=\fP\,\fIgid\fP and \fBdevmode=\fP\,\fImode\fP
60a2a323 2342Set the owner and group and mode of the device files in the usbfs filesystem
3711f113 2343(default: uid=gid=0, mode=0644). The mode is given in octal.
60a2a323 2344.TP
0d05f161 2345\fBbusuid=\fP\,\fIuid\fP and \fBbusgid=\fP\,\fIgid\fP and \fBbusmode=\fP\,\fImode\fP
60a2a323 2346Set the owner and group and mode of the bus directories in the usbfs
3711f113 2347filesystem (default: uid=gid=0, mode=0555). The mode is given in octal.
60a2a323 2348.TP
0d05f161 2349\fBlistuid=\fP\,\fIuid\fP and \fBlistgid=\fP\,\fIgid\fP and \fBlistmode=\fP\,\fImode\fP
60a2a323
KZ
2350Set the owner and group and mode of the file
2351.I devices
3711f113 2352(default: uid=gid=0, mode=0444). The mode is given in octal.
60a2a323 2353
60a2a323 2354.SH "THE LOOP DEVICE"
3711f113 2355One further possible type is a mount via the loop device. For example,
60a2a323
KZ
2356the command
2357.RS
2358.sp
4b8f8336 2359.B "mount /tmp/disk.img /mnt \-t vfat \-o loop=/dev/loop3"
60a2a323
KZ
2360.sp
2361.RE
2362will set up the loop device
2363.I /dev/loop3
2364to correspond to the file
2365.IR /tmp/disk.img ,
2366and then mount this device on
2367.IR /mnt .
2368
2369If no explicit loop device is mentioned
2370(but just an option `\fB\-o loop\fP' is given), then
2371.B mount
2372will try to find some unused loop device and use that, for example
2373.RS
2374.sp
0d05f161 2375.B "mount /tmp/disk.img /mnt \-o loop"
60a2a323
KZ
2376.sp
2377.RE
2378The mount command
2379.B automatically
2380creates a loop device from a regular file if a filesystem type is
2381not specified or the filesystem is known for libblkid, for example:
2382.RS
2383.sp
2384.B "mount /tmp/disk.img /mnt"
2385.sp
d901e427 2386.B "mount \-t ext4 /tmp/disk.img /mnt"
60a2a323
KZ
2387.sp
2388.RE
3711f113
BS
2389This type of mount knows about three options, namely
2390.BR loop ", " offset " and " sizelimit ,
60a2a323
KZ
2391that are really options to
2392.BR \%losetup (8).
2393(These options can be used in addition to those specific
2394to the filesystem type.)
2395
3711f113
BS
2396Since Linux 2.6.25 auto-destruction of loop devices is supported,
2397meaning that any loop device allocated by
60a2a323
KZ
2398.B mount
2399will be freed by
2400.B umount
3711f113 2401independently of
60a2a323
KZ
2402.IR /etc/mtab .
2403
3711f113
BS
2404You can also free a loop device by hand, using
2405.BR "losetup \-d " or " umount \-d" .
60a2a323 2406
d08b58c4 2407Since util-linux v2.29 mount command re-uses the loop device rather than
03b4519b
KZ
2408initialize a new device if the same backing file is already used for some loop
2409device with the same offset and sizelimit. This is necessary to avoid
2410a filesystem corruption.
d08b58c4 2411
60a2a323
KZ
2412.SH RETURN CODES
2413.B mount
2414has the following return codes (the bits can be ORed):
2415.TP
0d05f161 2416.B 0
60a2a323
KZ
2417success
2418.TP
0d05f161 2419.B 1
60a2a323
KZ
2420incorrect invocation or permissions
2421.TP
0d05f161 2422.B 2
60a2a323
KZ
2423system error (out of memory, cannot fork, no more loop devices)
2424.TP
0d05f161 2425.B 4
60a2a323
KZ
2426internal
2427.B mount
2428bug
2429.TP
0d05f161 2430.B 8
60a2a323
KZ
2431user interrupt
2432.TP
0d05f161 2433.B 16
60a2a323
KZ
2434problems writing or locking /etc/mtab
2435.TP
0d05f161 2436.B 32
60a2a323
KZ
2437mount failure
2438.TP
0d05f161 2439.B 64
60a2a323 2440some mount succeeded
16b73aae 2441
3711f113
BS
2442The command \fBmount \-a\fR returns 0 (all succeeded), 32 (all failed), or 64 (some
2443failed, some succeeded).
60a2a323 2444
00963eac 2445.SH "EXTERNAL HELPERS"
60a2a323 2446The syntax of external mount helpers is:
81421334
BS
2447.sp
2448.in +4
3711f113 2449.BI /sbin/mount. suffix
60a2a323
KZ
2450.I spec dir
2451.RB [ \-sfnv ]
c5b63d28
KZ
2452.RB [ \-N
2453.IR namespace ]
60a2a323
KZ
2454.RB [ \-o
2455.IR options ]
2456.RB [ \-t
3711f113 2457.IR type \fB. subtype ]
81421334
BS
2458.in
2459.sp
c5b63d28 2460where the \fIsuffix\fR is the filesystem type and the \fB\-sfnvoN\fR options have
3711f113
BS
2461the same meaning as the normal mount options. The \fB\-t\fR option is used for
2462filesystems with subtypes support (for example
2463.BR "/sbin/mount.fuse \-t fuse.sshfs" ).
60a2a323 2464
3711f113 2465The command \fBmount\fR does not pass the mount options
00963eac
KZ
2466.BR unbindable ,
2467.BR runbindable ,
2468.BR private ,
2469.BR rprivate ,
2470.BR slave ,
2471.BR rslave ,
2472.BR shared ,
2473.BR rshared ,
2474.BR auto ,
2475.BR noauto ,
2476.BR comment ,
0d05f161 2477.BR x-* ,
00963eac 2478.BR loop ,
0d05f161 2479.B offset
00963eac 2480and
0d05f161 2481.B sizelimit
3711f113
BS
2482to the mount.<suffix> helpers. All other options are used in a
2483comma-separated list as argument to the \fB\-o\fR option.
00963eac 2484
60a2a323 2485.SH FILES
b6cc1210 2486See also "\fBThe files /etc/fstab, /etc/mtab and /proc/mounts\fR" section above.
60a2a323
KZ
2487.TP 18n
2488.I /etc/fstab
2489filesystem table
2490.TP
b6cc1210
KZ
2491.I /run/mount
2492libmount private runtime directory
2493.TP
60a2a323 2494.I /etc/mtab
b6cc1210 2495table of mounted filesystems or symlink to /proc/mounts
60a2a323 2496.TP
0d05f161 2497.I /etc/mtab\s+3~\s0
b6cc1210 2498lock file (unused on systems with mtab symlink)
60a2a323
KZ
2499.TP
2500.I /etc/mtab.tmp
b6cc1210 2501temporary file (unused on systems with mtab symlink)
60a2a323
KZ
2502.TP
2503.I /etc/filesystems
2504a list of filesystem types to try
2505.SH ENVIRONMENT
2506.IP LIBMOUNT_FSTAB=<path>
68e422ec 2507overrides the default location of the fstab file (ignored for suid)
60a2a323 2508.IP LIBMOUNT_MTAB=<path>
68e422ec
KZ
2509overrides the default location of the mtab file (ignored for suid)
2510.IP LIBMOUNT_DEBUG=all
2511enables libmount debug output
2512.IP LIBBLKID_DEBUG=all
2513enables libblkid debug output
0bf03740
KZ
2514.IP LOOPDEV_DEBUG=all
2515enables loop device setup debug output
60a2a323 2516.SH "SEE ALSO"
81421334 2517.na
60a2a323
KZ
2518.BR mount (2),
2519.BR umount (2),
60a2a323 2520.BR umount (8),
81421334 2521.BR fstab (5),
60a2a323
KZ
2522.BR nfs (5),
2523.BR xfs (5),
81421334 2524.BR e2label (8),
f053ff1e
MK
2525.BR findmnt (8),
2526.BR losetup (8),
2527.BR mke2fs (8),
2528.BR mountd (8),
2529.BR nfsd (8),
81421334 2530.BR swapon (8),
f053ff1e
MK
2531.BR tune2fs (8),
2532.BR xfs_admin (8)
81421334 2533.ad
60a2a323
KZ
2534.SH BUGS
2535It is possible for a corrupted filesystem to cause a crash.
2536.PP
2537Some Linux filesystems don't support
81421334 2538.BR "\-o sync " nor " \-o dirsync"
d901e427 2539(the ext2, ext3, ext4, fat and vfat filesystems
60a2a323
KZ
2540.I do
2541support synchronous updates (a la BSD) when mounted with the
2542.B sync
2543option).
2544.PP
2545The
2546.B "\-o remount"
2547may not be able to change mount parameters (all
2548.IR ext2fs -specific
2549parameters, except
fb724eef 2550.BR sb ,
60a2a323
KZ
2551are changeable with a remount, for example, but you can't change
2552.B gid
2553or
2554.B umask
2555for the
2556.IR fatfs ).
2557.PP
81421334 2558It is possible that the files
0d05f161 2559.I /etc/mtab
60a2a323 2560and
0d05f161 2561.I /proc/mounts
81421334 2562don't match on systems with a regular mtab file. The first file is based only on
06716dff 2563the mount command options, but the content of the second file also depends on
81421334
BS
2564the kernel and others settings (e.g.\& on a remote NFS server -- in certain cases
2565the mount command may report unreliable information about an NFS mount point
2566and the /proc/mounts file usually contains more reliable information.) This is
2567another reason to replace the mtab file with a symlink to the
06716dff
KZ
2568.I /proc/mounts
2569file.
60a2a323 2570.PP
81421334 2571Checking files on NFS filesystems referenced by file descriptors (i.e.\& the
0d05f161 2572.B fcntl
60a2a323 2573and
0d05f161 2574.B ioctl
81421334
BS
2575families of functions) may lead to inconsistent results due to the lack of
2576a consistency check in the kernel even if noac is used.
293714c0
JM
2577.PP
2578The
2579.B loop
2580option with the
2581.B offset
2582or
2583.B sizelimit
2584options used may fail when using older kernels if the
2585.B mount
2586command can't confirm that the size of the block device has been configured
3711f113 2587as requested. This situation can be worked around by using
293714c0
JM
2588the
2589.B losetup
2590command manually before calling
2591.B mount
2592with the configured loop device.
60a2a323
KZ
2593.SH HISTORY
2594A
2595.B mount
2596command existed in Version 5 AT&T UNIX.
2597.SH AUTHORS
2598.nf
2599Karel Zak <kzak@redhat.com>
2600.fi
2601.SH AVAILABILITY
2602The mount command is part of the util-linux package and is available from
d673b74e 2603https://www.kernel.org/pub/linux/utils/util-linux/.