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