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