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