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