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