to the big file tree. Conversely, the
.BR umount (8)
command will detach it again. The filesystem is used to control how data is
-stored on the device or provided in a virtual way by network or another services.
+stored on the device or provided in a virtual way by network or other services.
The standard form of the
.B mount
.B \-\-target
or
.B \-\-source
-options to avoid ambivalent interpretation of the given argument. For example:
+options to avoid ambiguous interpretation of the given argument.
+For example:
.RS
.sp
.B mount \-\-target /mountpoint
.sp
.RE
-The same filesystem may be mounted more than once, and in some cases (e.g.
+The same filesystem may be mounted more than once, and in some cases (e.g.,
network filesystems) the same filesystem may be mounted on the same
-mountpoint more times. The mount command does not implement any policy to
+mountpoint multiple times. The
+.B mount
+command does not implement any policy to
control this behavior. All behavior is controlled by the kernel and it is usually
specific to the filesystem driver. The exception is \fB\-\-all\fR, in this case
already mounted filesystems are ignored (see \fB\-\-all\fR below for more details).
.I device
may look like
.IR knuth.cwi.nl:/dir .
-It is also possible to indicate a block special device using its filesystem label
-or UUID (see the \fB\-L\fR and \fB\-U\fR options below), or its partition label
-or UUID. Partition identifiers are supported for example for GUID Partition
-Tables (GPT).
-
+.PP
The device names of disk partitions are unstable; hardware reconfiguration,
-adding or removing a device can cause changes in names. This is the reason why it's
+and adding or removing a device can cause changes in names.
+This is the reason why it's
strongly recommended to use filesystem or partition identifiers like UUID or
-LABEL.
-
-The command \fBlsblk --fs\fR provides an overview of filesystems, LABELs and UUIDs
-on available block devices. The command \fBblkid -p <device>\fR provides details about
+LABEL. Currently supported identifiers (tags):
+.TP
+LABEL=\fIlabel\fR
+Human readable filesystem identifier. See also \fB\-L\fR.
+.TP
+UUID=\fIuuid\fR
+Filesystem universally unique identifier. The format of the UUID is usually a
+series of hex digits separated by hyphens. See also \fB\-U\fR.
+.sp
+Note that
+.BR mount (8)
+uses UUIDs as strings. The UUIDs from the command line or from
+.BR fstab (5)
+are not converted to internal binary representation. The string representation
+of the UUID should be based on lower case characters.
+.TP
+PARTLABEL=\fIlabel\fR
+Human readable partition identifier. This identifier is independent on
+filesystem and does not change by mkfs or mkswap operations It's supported
+for example for GUID Partition Tables (GPT).
+.TP
+PARTUUID=\fIuuid\fR
+Partition universally unique identifier. This identifier is independent on
+filesystem and does not change by mkfs or mkswap operations It's supported
+for example for GUID Partition Tables (GPT).
+.TP
+ID=\fIid\fR
+Hardware block device ID as generated by udevd. This identifier is usually
+based on WWN (unique storage identifier) and assigned by the hardware
+manufacturer. See \fBls /dev/disk/by-id\fR for more details, this directory
+and running udevd is required. This identifier is not recommended for generic
+use as the identifier is not strictly defined and it depends on udev, udev rules
+and hardware.
+.RE
+.sp
+The command \fBlsblk \-\-fs\fR provides an overview of filesystems, LABELs and UUIDs
+on available block devices. The command \fBblkid \-p <device>\fR provides details about
a filesystem on the specified device.
Don't forget that there is no guarantee that UUIDs and labels are really
to verify that the UUIDs are really unique in your system.
The recommended setup is to use tags (e.g.\& \fBUUID=\fIuuid\fR) rather than
-.I /dev/disk/by-{label,uuid,partuuid,partlabel}
+.I /dev/disk/by-{label,uuid,id,partuuid,partlabel}
udev symlinks in the
.I /etc/fstab
file. Tags are
more readable, robust and portable. The
.BR mount (8)
command internally uses udev
-symlinks, so the use of symlinks in /etc/fstab has no advantage over tags.
+symlinks, so the use of symlinks in
+.I /etc/fstab
+has no advantage over tags.
For more details see
.BR libblkid (3).
-Note that
-.BR mount (8)
-uses UUIDs as strings. The UUIDs from the command line or from
-.BR fstab (5)
-are not converted to internal binary representation. The string representation
-of the UUID should be based on lower case characters.
-
The
.I proc
filesystem is not associated with a special device, and when
-mounting it, an arbitrary keyword, such as
-.I proc
-can be used instead of a device specification.
+mounting it, an arbitrary keyword\(emfor example,
+.IR proc \(emcan
+be used instead of a device specification.
(The customary choice
.I none
is less fortunate: the error message `none already mounted' from
keyword. Adding the
.B \-F
option will make \fBmount\fR fork, so that the
-filesystems are mounted simultaneously.
+filesystems are mounted in parallel.
.LP
When mounting a filesystem mentioned in
.I fstab
.IR /etc/mtab .
The support for regular classic
.I /etc/mtab
-is completely disabled in compile time by default, because on current Linux
-systems it is better to make it a symlink to
+is completely disabled at compile time by default, because on current Linux
+systems it is better to make
+.I /etc/mtab
+a symlink to
.I /proc/mounts
-instead. The regular mtab file maintained in userspace cannot reliably
+instead. The regular
+.I mtab
+file maintained in userspace cannot reliably
work with namespaces, containers and other advanced Linux features.
-If the regular mtab support is enabled than it's possible to
+If the regular
+.I mtab
+support is enabled, then it's possible to
use the file as well as the symlink.
.sp
If no arguments are given to
the list of mounted filesystems is printed.
.sp
If you want to override mount options from
-.I /etc/fstab
+.IR /etc/fstab ,
you have to use the \fB\-o\fR option:
.RS
.sp
and then the mount options from the command line will be appended to
the list of options from
.IR /etc/fstab .
-This default behaviour is possible to change by command line
-option \fB\-\-options\-mode\fR.
+This default behaviour can be changed using the
+\fB\-\-options\-mode\fR
+command-line option.
The usual behavior is that the last option wins if there are conflicting
ones.
.sp
.I /etc/fstab
file if both
.I device
-(or LABEL, UUID, PARTUUID or PARTLABEL) and
+(or LABEL, UUID, ID, PARTUUID or PARTLABEL) and
.I dir
are specified. For example, to mount device
.BR foo " at " /dir :
.B "mount /dev/foo /dir"
.sp
.RE
-This default behaviour is possible to change by command line option
-\fB\-\-options\-source\-force\fR to always read configuration from fstab. For
-non-root users
+This default behaviour can be changed by using the
+\fB\-\-options\-source\-force\fR command-line option
+to always read configuration from
+.IR fstab .
+For non-root users
.B mount
-always read fstab configuration.
+always reads the
+.I fstab
+configuration.
.SS Non-superuser mounts
Normally, only the superuser can mount filesystems.
.RE
any user can mount the iso9660 filesystem found on an inserted CDROM
using the command:
+.PP
.RS
.B "mount /cd"
.sp
.RE
Note that \fBmount\fR is very strict about non-root users and all paths
-specified on command line are verified before fstab is parsed or a helper
+specified on command line are verified before
+.I fstab
+is parsed or a helper
program is executed. It's strongly recommended to use a valid mountpoint to
-specify filesystem, otherwise \fBmount\fR may fail. For example it's bad idea
+specify filesystem, otherwise \fBmount\fR may fail. For example it's a bad idea
to use NFS or CIFS source on command line.
.PP
-Since version 2.35 \fBmount\fR command does not exit when user permissions are
-inadequate by internal libmount security rules. It drops suid permissions
-and continue as regular non-root user. It allows to support use-cases where
-root permissions are not necessary (e.g. fuse filesystems, user namespaces,
+Since util-linux 2.35, \fBmount\fR does not exit when user permissions are
+inadequate according to libmount's internal security rules.
+Instead, it drops suid permissions
+and continues as regular non-root user. This behavior supports use-cases where
+root permissions are not necessary (e.g., fuse filesystems, user namespaces,
etc).
.PP
For more details, see
if a login script makes the console user owner of this device.
The
.B group
-option is similar, with the restriction that the user must be
+option is similar, with the restriction that the user must be a
member of the group of the special file.
.SS Bind mount operation
.I olddir newdir
.RE
-or by using this fstab entry:
+or by using this
+.I fstab
+entry:
.RS
.br
After this call the same contents are accessible in two places.
-It is important to understand that "bind" does not to create any second-class
+It is important to understand that "bind" does not create any second-class
or special node in the kernel VFS. The "bind" is just another operation to
attach a filesystem. There is nowhere stored information that the filesystem
-has been attached by "bind" operation. The \fIolddir\fR and \fInewdir\fR are
-independent and the \fIolddir\fR may be umounted.
+has been attached by a "bind" operation. The \fIolddir\fR and \fInewdir\fR are
+independent and the \fIolddir\fR may be unmounted.
One can also remount a single file (on a single file). It's also
-possible to use the bind mount to create a mountpoint from a regular
+possible to use a bind mount to create a mountpoint from a regular
directory, for example:
.RS
.RE
The bind mount call attaches only (part of) a single filesystem, not possible
-submounts. The entire file hierarchy including submounts is attached
+submounts. The entire file hierarchy including submounts can be attached
a second place by using:
.RS
.I olddir newdir
.RE
-Note that the filesystem mount options maintained by kernel will remain the same as those
-on the original mount point. The userspace mount options (e.g. _netdev) will not be copied
+Note that the filesystem mount options maintained by the kernel will remain the same as those
+on the original mount point. The userspace mount options (e.g., _netdev) will not be copied
by
-.BR mount (8)
-and it's necessary explicitly specify the options on mount command line.
+.BR mount
+and it's necessary to explicitly specify the options on the
+.B mount
+command line.
+Since util-linux 2.27
.BR mount (8)
-since v2.27 allows to change the mount options by passing the
+permits changing the mount options by passing the
relevant options along with
.BR \-\-bind .
For example:
.RS
.br
-.B mount -o bind,ro foo foo
+.B mount \-o bind,ro foo foo
.RE
This feature is not supported by the Linux kernel; it is implemented in userspace
will be read-only.
It's also possible to change nosuid, nodev, noexec, noatime, nodiratime and
-relatime VFS entry flags by "remount,bind" operation. The another (for example
-filesystem specific flags) are silently ignored. It's impossible to change mount
-options recursively (for example with \fB-o rbind,ro\fR).
-
-.BR mount (8)
-since v2.31 ignores the \fBbind\fR flag from
+relatime VFS entry flags via a "remount,bind" operation.
+The other flags (for example
+filesystem-specific flags) are silently ignored. It's impossible to change mount
+options recursively (for example with \fB\-o rbind,ro\fR).
+
+Since util-linux 2.31,
+.BR mount
+ignores the \fBbind\fR flag from
.I /etc/fstab
-on
-.B remount operation
-(if "-o remount" specified on command line). This is necessary to fully control
-mount options on remount by command line. In the previous versions the bind
+on a
+.B remount
+operation
+(if "\-o remount" is specified on command line).
+This is necessary to fully control
+mount options on remount by command line. In previous versions the bind
flag has been always applied and it was impossible to re-define mount options
without interaction with the bind semantic. This
.BR mount (8)
unbindable mount is a private mount which cannot be cloned through a bind
operation. The detailed semantics are documented in
.I Documentation/filesystems/sharedsubtree.txt
-file in the kernel source tree.
+file in the kernel source tree; see also
+.BR mount_namespaces (7).
Supported operations are:
when a \fB\-\-make-\fR* operation is requested. All necessary information has to be
specified on the command line.
-Note that the Linux kernel does not allow to change multiple propagation flags
+Note that the Linux kernel does not allow changing multiple propagation flags
with a single
.BR mount (2)
system call, and the flags cannot be mixed with other mount options and operations.
.RS
.nf
-.B mount /dev/sda1 /foox
+.B mount /dev/sda1 /foo
.B mount \-\-make\-private /foo
.B mount \-\-make\-unbindable /foo
.fi
.BR \-r " or " \-w
option, when present.
-The command \fBmount\fR does not pass all command-line options to the
+The \fBmount\fR command does not pass all command-line options to the
\fB/sbin/mount.\fIsuffix\fR mount helpers. The interface between \fBmount\fR
and the mount helpers is described below in the section \fBEXTERNAL HELPERS\fR.
.sp
.B noauto
keyword). The filesystems are mounted following their order in
.IR fstab .
-The mount command compares filesystem source, target (and fs root for bind
+The
+.B mount
+command compares filesystem source, target (and fs root for bind
mount or btrfs) to detect already mounted filesystems. The kernel table with
-already mounted filesystems is cached during \fBmount \-\-all\fR. It means
-that all duplicated fstab entries will be mounted.
+already mounted filesystems is cached during \fBmount \-\-all\fR. This means
+that all duplicated
+.I fstab
+entries will be mounted.
.sp
The option \fB\-\-all\fR is possible to use for remount operation too. In this
case all filters (\fB\-t\fR and \fB\-O\fR) are applied to the table of already
mounted filesystems.
.sp
Since version 2.35 is possible to use the command line option \fB\-o\fR to
-alter mount options from fstab (see also \fB\-\-options\-mode\fR).
+alter mount options from
+.I fstab
+(see also \fB\-\-options\-mode\fR).
.sp
Note that it is a bad practice to use \fBmount \-a\fR for
.I fstab
in both places). See above, under \fBBind mounts\fR.
.TP
.BR \-c , " \-\-no\-canonicalize"
-Don't canonicalize paths. The mount command canonicalizes all paths
-(from command line or fstab) by default. This option can be used
+Don't canonicalize paths. The
+.B mount
+command canonicalizes all paths
+(from the command line or
+.IR fstab )
+by default. This option can be used
together with the
.B \-f
flag for already canonicalized absolute paths. The option is designed for mount
-helpers which call \fBmount -i\fR. It is strongly recommended to not use this
+helpers which call \fBmount \-i\fR. It is strongly recommended to not use this
command-line option for normal mount operations.
.sp
Note that \fBmount\fR(8) does not pass this option to the
Fork off a new incarnation of \fBmount\fR for each device.
This will do the mounts on different devices or different NFS servers
in parallel.
-This has the advantage that it is faster; also NFS timeouts go in
-parallel. A disadvantage is that the mounts are done in undefined order.
+This has the advantage that it is faster; also NFS timeouts proceed in
+parallel.
+A disadvantage is that the order of the mount operations is undefined.
Thus, you cannot use this option if you want to mount both
.I /usr
and
.B mount
command is trying to do. It can also be used to add entries for devices
that were mounted earlier with the \fB\-n\fR option. The \fB\-f\fR option
-checks for an existing record in /etc/mtab and fails when the record already
+checks for an existing record in
+.I /etc/mtab
+and fails when the record already
exists (with a regular non-fake mount, this check is done by the kernel).
.IP "\fB\-i, \-\-internal\-only\fP"
Don't call the \fB/sbin/mount.\fIfilesystem\fR helper even if it exists.
is on a read-only filesystem.
.TP
.BR \-N , " \-\-namespace " \fIns
-Perform mount in namespace specified by \fIns\fR.
+Perform the mount operation in the mount namespace specified by \fIns\fR.
\fIns\fR is either PID of process running in that namespace
or special file representing that namespace.
.sp
.BR mount (8)
-switches to the namespace when it reads /etc/fstab, writes /etc/mtab (or writes to /run/mount) and calls
+switches to the mount namespace when it reads
+.IR /etc/fstab ,
+writes
+.I /etc/mtab
+(or writes to
+.IR /run/mount )
+and calls the
.BR mount (2)
-system call, otherwise it runs in the original namespace. It means that the target namespace does not have
-to contain any libraries or another requirements necessary to execute
+system call, otherwise it runs in the original mount namespace.
+This means that the target namespace does not have
+to contain any libraries or other requirements necessary to execute the
.BR mount (2)
-command.
+call.
.sp
-See \fBnamespaces\fR(7) for more information.
+See \fBmount_namespaces\fR(7) for more information.
.TP
.BR \-O , " \-\-test\-opts " \fIopts
Limit the set of filesystems to which the
.TP
.BR "\-\-options\-mode " \fImode
-Controls how to combine options from fstab/mtab with options from command line.
+Controls how to combine options from
+.IR fstab / mtab
+with options from the command line.
\fImode\fR can be one of
.BR ignore ", " append ", " prepend " or " replace .
-For example \fBappend\fR means that options from fstab are appended to options from command line.
-Default value is \fBprepend\fR -- it means command line options are evaluated after fstab options.
+For example, \fBappend\fR means that options from
+.I fstab
+are appended to options from the command line.
+The default value is \fBprepend\fR -- it means command line options are evaluated after
+.I fstab
+options.
Note that the last option wins if there are conflicting ones.
.TP
.BR "\-\-options\-source " \fIsource
Source of default options.
-\fIsource\fR is comma separated list of
+\fIsource\fR is a comma-separated list of
.BR fstab ", " mtab " and " disable .
\fBdisable\fR disables
.BR fstab " and " mtab
and disables \fB\-\-options\-source\-force\fR.
-Default value is \fBfstab,mtab\fR.
+The default value is \fBfstab,mtab\fR.
.TP
.B \-\-options\-source\-force
-Use options from fstab/mtab even if both \fIdevice\fR and \fIdir\fR are specified.
+Use options from
+.IR fstab / mtab
+even if both \fIdevice\fR and \fIdir\fR are specified.
.TP
.BR \-R , " \-\-rbind"
option. Currently it's supported by the \fBmount.nfs\fR mount helper only.
.TP
.BI \-\-source " device"
-If only one argument for the mount command is given then the argument might be
-interpreted as target (mountpoint) or source (device). This option allows to
+If only one argument for the mount command is given, then the argument might be
+interpreted as the target (mountpoint) or source (device).
+This option allows you to
explicitly define that the argument is the mount source.
.TP
.BI \-\-target " directory"
-If only one argument for the mount command is given then the argument might be
-interpreted as target (mountpoint) or source (device). This option allows to
+If only one argument for the mount command is given, then the argument might be
+interpreted as the target (mountpoint) or source (device).
+This option allows you to
explicitly define that the argument is the mount target.
.TP
.BI \-\-target\-prefix " directory"
-Prepend specified directory to all mount targets. This option allows to follow
-fstab, but mount operations is done on another place, for example:
+Prepend the specified directory to all mount targets.
+This option allows to follow
+.IR fstab ,
+but mount operations is done on another place, for example:
.RS
.RS
.sp
.B "mount \-\-all \-\-target\-prefix /chroot \-o X\-mount.mkdir
.sp
.RE
-mounts all from system fstab to /chroot, all missing muontpoint are created
-(due to X-mount.mkdir). See also \fB\-\-fstab\fP to use an alternative fstab.
+mounts all from system
+.I fstab
+to
+.IR /chroot ,
+all missing mountpoint are created
+(due to X-mount.mkdir). See also \fB\-\-fstab\fP to use an alternative
+.IR fstab .
.RE
.TP
.BR \-T , " \-\-fstab " \fIpath
-Specifies an alternative fstab file. If \fIpath\fP is a directory then the files
+Specifies an alternative
+.I fstab
+file.
+If \fIpath\fP is a directory, then the files
in the directory are sorted by
.BR strverscmp (3);
-files that start with "."\& or without an \&.fstab extension are ignored. The option
+files that start with "."\& or without an
+.I \&.fstab
+extension are ignored. The option
can be specified more than once. This option is mostly designed for initramfs
or chroot scripts where additional configuration is specified beyond standard
system configuration.
.sp
Note that \fBmount\fR(8) does not pass the option \fB\-\-fstab\fP to the
-\fB/sbin/mount.\fItype\fR helpers, meaning that the alternative fstab files will be
+\fB/sbin/mount.\fItype\fR helpers, meaning that the alternative
+.I fstab
+files will be
invisible for the helpers. This is no problem for normal mounts, but user
-(non-root) mounts always require fstab to verify the user's rights.
+(non-root) mounts always require
+.I fstab
+to verify the user's rights.
.TP
.BR \-t , " \-\-types " \fIfstype
The argument following the
currently supported depend on the running kernel. See
.I /proc/filesystems
and
-.I /lib/modules/$(uname -r)/kernel/fs
+.I /lib/modules/$(uname \-r)/kernel/fs
for a complete list of the filesystems. The most common are ext2, ext3, ext4,
xfs, btrfs, vfat, sysfs, proc, nfs and cifs.
.sp
.B \-t
option is given, or if the
.B auto
-type is specified, mount will try to guess the desired type.
+type is specified,
+.B mount
+will try to guess the desired type.
Mount uses the blkid library for guessing the filesystem
type; if that does not turn up anything that looks familiar,
-mount will try to read the file
+.B mount
+will try to read the file
.IR /etc/filesystems ,
or, if that does not exist,
.IR /proc/filesystems .
or ext3 before ext2) or if you use a kernel module autoloader.
.sp
More than one type may be specified in a comma-separated
-list, for option
+list, for the
.B \-t
-as well as in an
+option as well as in an
.I /etc/fstab
-entry. The list of filesystem types for option
+entry. The list of filesystem types for the
.B \-t
-can be prefixed with
+option can be prefixed with
.B no
to specify the filesystem types on which no action should be taken.
The prefix
Verbose mode.
.TP
.BR \-w , " \-\-rw" , " \-\-read\-write"
-Mount the filesystem read/write. The read-write is kernel default. A synonym is
+Mount the filesystem read/write. Read-write is the kernel default and the
+.BR mount
+default is to try read-only if the previous mount syscall with read-write flags
+on write-protected devices of filesystems failed.
+.sp
+A synonym is
.BR "\-o rw" .
-Note that specify \fB\-w\fR on command line forces \fBmount\fR command
-to never try read-only mount on write-protected devices. The default is
-try read-only if the previous mount syscall with read-write flags failed.
+Note that specifying \fB\-w\fR on the command line forces \fBmount\fR to never
+try read-only mount on write-protected devices or already mounted read-only
+filesystems.
.TP
.BR \-V , " \-\-version"
Display version information and exit.
Some of these options could be enabled or disabled by default
in the system kernel. To check the current setting see the options
-in /proc/mounts. Note that filesystems also have per-filesystem
+in
+.IR /proc/mounts .
+Note that filesystems also have per-filesystem
specific default mount options (see for example \fBtune2fs \-l\fP
output for extN filesystems).
option is useful when mounting filesystems that do not support
extended attributes, such as a floppy or hard disk formatted with VFAT, or
systems that are not normally running under SELinux, such as an ext3 or ext4 formatted
-
disk from a non-SELinux workstation. You can also use
.B context=
on filesystems you do not trust, such as a floppy. It also helps in compatibility with
.B fscontext=
and
.BR defcontext= ,
-both of which are mutually exclusive of the context option. This means you
+both of which are mutually exclusive of the
+.B context=
+option. This means you
can use fscontext and defcontext with each other, but neither can be used with
context.
.B rootcontext=
option allows you to explicitly label the root inode of a FS being mounted
before that FS or inode becomes visible to userspace. This was found to be
-useful for things like stateless linux.
+useful for things like stateless Linux.
Note that the kernel rejects any remount request that includes the context
option, \fBeven\fP when unchanged from the current context.
Use the default options:
.BR rw ", " suid ", " dev ", " exec ", " auto ", " nouser ", and " async .
-Note that the real set of all default mount options depends on kernel
+Note that the real set of all default mount options depends on the kernel
and filesystem type. See the beginning of this section for more details.
.TP
.B dev
Interpret character or block special devices on the filesystem.
.TP
.B nodev
-Do not interpret character or block special devices on the file
-system.
+Do not interpret character or block special devices on the filesystem.
.TP
.B diratime
Update directory inode access times on this filesystem. This is the default.
or
.B \%noatime
but still allow userspace to override it. For more details about the default
-system mount options see /proc/mounts.
+system mount options see
+.IR /proc/mounts .
.TP
.B nostrictatime
Use the kernel's default behavior for inode access time updates.
workloads that perform frequent random writes to preallocated files.
The on-disk timestamps are updated only when:
-.sp
.RS
-- the inode needs to be updated for some change unrelated to file timestamps
-.sp
-- the application employs
+.IP - 2
+the inode needs to be updated for some change unrelated to file timestamps
+.IP -
+the application employs
.BR fsync (2),
.BR syncfs (2),
or
.BR sync (2)
-.sp
-- an undeleted inode is evicted from memory
-.sp
-- more than 24 hours have passed since the i-node was written to disk.
+.IP -
+an undeleted inode is evicted from memory
+.IP -
+more than 24 hours have passed since the i-node was written to disk.
.RE
.sp
.TP
The remount operation together with the
.B bind
-flag has special semantic. See above, the subsection \fBBind mounts\fR.
+flag has special semantics. See above, the subsection \fBBind mounts\fR.
-The remount functionality follows the standard way the mount command works
-with options from fstab. This means that \fBmount\fR does not
-read fstab (or mtab) only when both
+The remount functionality follows the standard way the
+.B mount
+command works
+with options from
+.IR fstab .
+This means that \fBmount\fR does not read
+.I fstab
+(or
+.IR mtab )
+only when both
.I device
and
.I dir
.in
.sp
After this call all old mount options are replaced and arbitrary stuff from
-fstab (or mtab) is ignored, except the loop= option which is internally
+.I fstab
+(or
+.IR mtab )
+is ignored, except the loop= option which is internally
generated and maintained by the mount command.
.sp
.in +4
.B "mount \-o remount,rw /dir"
.in
.sp
-After this call, mount reads fstab and merges these options with
+After this call, mount reads
+.I fstab
+and merges these options with
the options from the command line (\fB\-o\fR).
-If no mountpoint is found in fstab, then a remount with unspecified source is
+If no mountpoint is found in
+.IR fstab ,
+then a remount with unspecified source is
allowed.
.sp
-mount(8) allows to use \fB\-\-all\fR to remount all already mounted filesystems
+.B mount
+allows the use of \fB\-\-all\fR to remount all already mounted filesystems
which match a specified filter (\fB\-O\fR and \fB\-t\fR). For example:
.sp
.in +4
-.B "mount \-\-all \-o remount,ro -t vfat"
+.B "mount \-\-all \-o remount,ro \-t vfat"
.in
.sp
-remounts all already mounted vfat filesystems in read-only mode. The each of the
-filesystems is remounted by "mount \-o remount,ro /dir" semantic. It means the
-mount command reads fstab or mtab and merges these options with the options
+remounts all already mounted vfat filesystems in read-only mode. Each of the
+filesystems is remounted by "mount \-o remount,ro /dir" semantic.
+This means the
+.B mount
+command reads
+.I fstab
+or
+.I mtab
+and merges these options with the options
from the command line.
.TP
.B ro
.TP
.B user
Allow an ordinary user to mount the filesystem.
-The name of the mounting user is written to the mtab file (or to the private
-libmount file in /run/mount on systems without a regular mtab) so that this
+The name of the mounting user is written to the
+.I mtab
+file (or to the private
+libmount file in
+.I /run/mount
+on systems without a regular
+.IR mtab )
+so that this
same user can unmount the filesystem again.
This option implies the options
.BR noexec ", " nosuid ", and " nodev
.TP
.B X-*
All options prefixed with "X-" are interpreted as comments or as userspace
-application-specific options. These options are not stored in the user space (e.g. mtab file),
+application-specific options.
+These options are not stored in user space (e.g.,
+.I mtab
+file),
nor sent to the mount.\fItype\fR helpers nor to the
.BR mount (2)
system call. The suggested format is \fBX-\fIappname\fR.\fIoption\fR.
.TP
.B x-*
-The same as \fBX-*\fR options, but stored permanently in the user space. It
-means the options are also available for umount or another operations. Note
-that maintain mount options in user space is tricky, because it's necessary use
-libmount based tools and there is no guarantee that the options will be always
+The same as \fBX-*\fR options, but stored permanently in user space.
+This means the options are also available for
+.B umount
+or other operations. Note
+that maintaining mount options in user space is tricky,
+because it's necessary use
+libmount-based tools and there is no guarantee that the options will be always
available (for example after a move mount operation or in unshared namespace).
Note that before util-linux v2.30 the x-* options have not been maintained by
-libmount and stored in user space (functionality was the same as have X-* now),
-but due to growing number of use-cases (in initrd, systemd etc.) the
-functionality have been extended to keep existing fstab configurations usable
+libmount and stored in user space (functionality was the same as for X-* now),
+but due to the growing number of use-cases (in initrd, systemd etc.) the
+functionality has been extended to keep existing
+.I fstab
+configurations usable
without a change.
.TP
.BR X-mount.mkdir [ = \fImode\fR ]
-Allow to make a target directory (mountpoint). The optional argument
+Allow to make a target directory (mountpoint) if it does not exit yet.
+The optional argument
.I mode
specifies the filesystem access mode used for
.BR mkdir (2)
in octal notation. The default mode is 0755. This functionality is supported
-only for root users. The option is also supported as x-mount.mkdir, this notation
-is deprecated for mount.mkdir since v2.30.
-
-.SH "FILESYSTEM-SPECIFIC MOUNT OPTIONS"
-You should consult the respective man page for the filesystem first.
-If you want to know what options the ext4 filesystem supports, then check the
-.BR ext4 (5)
-man page.
-If that doesn't exist, you can also check the corresponding mount page like
-.BR mount.cifs (8).
-Note that you might have to install the respective userland tools.
-.sp
+only for root users or when mount executed without suid permissions. The option
+is also supported as x-mount.mkdir, this notation is deprecated since v2.30.
+
+.SH FILESYSTEM-SPECIFIC MOUNT OPTIONS
+This section lists options that are specific to particular filesystems.
+Where possible, you should first consult filesystem-specific manual pages
+for details.
+Some of those pages are listed in the following table.
+.TS
+lb lb
+l l.
+Filesystem(s) Manual page
+btrfs \fBbtrfs\fP(5)
+cifs \fBmount.cifs\fP(8)
+ext2, ext3, ext4 \fBext4\fP(5)
+fuse \fBfuse\fP(8)
+nfs \fBnfs\fP(5)
+tmpfs \fBtmpfs\fP(5)
+xfs \fBxfs\fP(5)
+.TE
+.PP
+Note that some of the pages listed above might be available only
+after you install the respective userland tools.
+.PP
The following options apply only to certain filesystems.
-We sort them by filesystem. They all follow the
+We sort them by filesystem.
+All options follow the
.B \-o
flag.
-.sp
+.PP
What options are supported depends a bit on the running kernel.
-More info may be found in the kernel source subdirectory
+Further information may be available in fileystem-specific
+files in the kernel source subdirectory
.IR Documentation/filesystems .
-
+.\"
.SS "Mount options for adfs"
.TP
\fBuid=\fP\,\fIvalue\fP and \fBgid=\fP\,\fIvalue\fP
Set the permission mask for ADFS 'owner' permissions and 'other' permissions,
respectively (default: 0700 and 0077, respectively).
See also
-.IR /usr/src/linux/Documentation/filesystems/adfs.txt .
+.IR /usr/src/linux/Documentation/filesystems/adfs.rst .
.SS "Mount options for affs"
.TP
.IR /dev/pts/ <number>.
.TP
\fBuid=\fP\,\fIvalue\fP and \fBgid=\fP\,\fIvalue\fP
-This sets the owner or the group of newly created PTYs to
+This sets the owner or the group of newly created pseudo terminals to
the specified values. When nothing is specified, they will
be set to the UID and GID of the creating process.
For example, if there is a tty group with GID 5, then
.B gid=5
-will cause newly created PTYs to belong to the tty group.
+will cause newly created pseudo terminals to belong to the tty group.
.TP
.BI mode= value
-Set the mode of newly created PTYs to the specified value.
+Set the mode of newly created pseudo terminals to the specified value.
The default is 0600.
A value of
.B mode=620
and
.B gid=5
-makes "mesg y" the default on newly created PTYs.
+makes "mesg y" the default on newly created pseudo terminals.
.TP
\fBnewinstance
-Create a private instance of devpts filesystem, such that
-indices of ptys allocated in this new instance are
+Create a private instance of the devpts filesystem, such that
+indices of pseudo terminals allocated in this new instance are
independent of indices created in other instances of devpts.
All mounts of devpts without this
.B newinstance
-option share the same set of pty indices (i.e. legacy mode).
+option share the same set of pseudo terminal indices (i.e., legacy mode).
Each mount of devpts with the
.B newinstance
-option has a private set of pty indices.
+option has a private set of pseudo terminal indices.
This option is mainly used to support containers in the
-linux kernel. It is implemented in linux kernel versions
+Linux kernel. It is implemented in Linux kernel versions
starting with 2.6.29. Further, this mount option is valid
only if CONFIG_DEVPTS_MULTIPLE_INSTANCES is enabled in the
kernel configuration.
To use this option effectively,
.I /dev/ptmx
must be a symbolic link to
-.I pts/ptmx.
+.IR pts/ptmx .
See
.I Documentation/filesystems/devpts.txt
-in the linux kernel source tree for details.
+in the Linux kernel source tree for details.
.TP
.BI ptmxmode= value
.B newinstance
option is specified.
-This option is only implemented in linux kernel versions
+This option is only implemented in Linux kernel versions
starting with 2.6.29. Further, this option is valid only if
CONFIG_DEVPTS_MULTIPLE_INSTANCES is enabled in the kernel
configuration.
Normally
.BR utime (2)
-checks current process is owner of the file, or it has
-CAP_FOWNER capability. But FAT filesystem doesn't have UID/GID on disk, so
+checks that the current process is owner of the file, or that it has the
+.B CAP_FOWNER
+capability. But FAT filesystems don't have UID/GID on disk, so the
normal check is too inflexible. With this option you can relax it.
.RE
.TP
and VFAT filesystems. By default, codepage 437 is used.
.TP
.BI conv= mode
-This option is obsolete and may fail or being ignored.
+This option is obsolete and may fail or be ignored.
.TP
.BI cvf_format= module
Forces the driver to use the CVF (Compressed Volume File) module
potentially causing data corruption. For this reason, this
option also mounts the filesystem readonly.
-To maintain backward compatibility, '-o nfs' is also accepted,
+To maintain backward compatibility, '\-o nfs' is also accepted,
defaulting to
.BR stale_rw .
.TP
\fBatime\fR is not supported and is always turned off.
.TP
The device name may be specified as
+.PP
.RS
.B ubiX_Y
UBI device number
volume with name
.B NAME
.RE
+.PP
Alternative
.B !
separator may be used instead of
The following mount options are available:
.TP
.B bulk_read
-Enable bulk-read. VFS read-ahead is disabled because it slows down the file
-system. Bulk-Read is an internal optimization. Some flashes may read faster if
+Enable bulk-read. VFS read-ahead is disabled because it slows down the filesystem. Bulk-Read is an internal optimization. Some flashes may read faster if
the data are read at one go, rather than at several read requests. For
example, OneNAND can do "read-while-load" if it reads more than one NAND page.
.TP
uid=forget can be specified independently of (or usually in
addition to) uid=<user> and results in UDF
not storing uids to the media. In fact the recorded uid
-is the 32-bit overflow uid -1 as defined by the UDF standard.
+is the 32-bit overflow uid \-1 as defined by the UDF standard.
The value is given as either <user> which is a valid user name or the corresponding
decimal user id, or the special string "forget".
.TP
gid=forget can be specified independently of (or usually in
addition to) gid=<group> and results in UDF
not storing gids to the media. In fact the recorded gid
-is the 32-bit overflow gid -1 as defined by the UDF standard.
+is the 32-bit overflow gid \-1 as defined by the UDF standard.
The value is given as either <group> which is a valid group name or the corresponding
decimal group id, or the special string "forget".
.TP
.I devices
(default: uid=gid=0, mode=0444). The mode is given in octal.
-.SH "THE LOOP DEVICE"
+.SH DM-VERITY SUPPORT (experimental)
+The device-mapper verity target provides read-only transparent integrity
+checking of block devices using kernel crypto API. The
+.B mount
+command can open
+the dm-verity device and do the integrity verification before on the device
+filesystem is mounted. Requires libcryptsetup with in libmount. If
+libcryptsetup supports extracting the root hash of an already mounted device,
+existing devices will be automatically reused in case of a match.
+Mount options for dm-verity:
+.TP
+\fBverity.hashdevice=\fP\,\fIpath\fP
+Path to the hash tree device associated with the source volume to pass to dm-verity.
+.TP
+\fBverity.roothash=\fP\,\fIhex\fP
+Hex-encoded hash of the root of
+.I verity.hashdevice
+Mutually exclusive with
+.I verity.roothashfile.
+.TP
+\fBverity.roothashfile=\fP\,\fIpath\fP
+Path to file containing the hex-encoded hash of the root of
+.I verity.hashdevice.
+Mutually exclusive with
+.I verity.roothash.
+.TP
+\fBverity.hashoffset=\fP\,\fIoffset\fP
+If the hash tree device is embedded in the source volume,
+.I offset
+(default: 0) is used by dm-verity to get to the tree.
+.TP
+\fBverity.fecdevice=\fP\,\fIpath\fP
+Path to the Forward Error Correction (FEC) device associated with the source volume to pass to dm-verity.
+Optional. Requires kernel built with CONFIG_DM_VERITY_FEC.
+.TP
+\fBverity.fecoffset=\fP\,\fIoffset\fP
+If the FEC device is embedded in the source volume,
+.I offset
+(default: 0) is used by dm-verity to get to the FEC area. Optional.
+.TP
+\fBverity.fecroots=\fP\,\fIvalue\fP
+Parity bytes for FEC (default: 2). Optional.
+.TP
+\fBverity.roothashsig=\fP\,\fIpath\fP
+Path to pkcs7 signature of root hash hex string. Requires crypt_activate_by_signed_key() from cryptsetup and
+kernel built with CONFIG_DM_VERITY_VERIFY_ROOTHASH_SIG. For device reuse, signatures have to be either used by all
+mounts of a device or by none. Optional.
+.PP
+Supported since util-linux v2.35.
+.PP
+For example commands:
+.sp
+.RS
+.nf
+.B mksquashfs /etc /tmp/etc.squashfs
+.B dd if=/dev/zero of=/tmp/etc.hash bs=1M count=10
+.B veritysetup format /tmp/etc.squashfs /tmp/etc.hash
+.B openssl smime \-sign \-in <hash> \-nocerts \-inkey private.key \-signer private.crt \-noattr \-binary \-outform der \-out /tmp/etc.p7
+.B mount \-o verity.hashdevice=/tmp/etc.hash,verity.roothash=<hash>,verity.roothashsig=/tmp/etc.p7 /tmp/etc.squashfs /mnt
+.fi
+.RE
+.sp
+create squashfs image from /etc directory, verity hash device
+and mount verified filesystem image to /mnt.
+The kernel will verify that the root hash is signed by a key from the kernel keyring if roothashsig is used.
+
+.SH LOOP-DEVICE SUPPORT
One further possible type is a mount via the loop device. For example,
the command
.RS
.B "mount /tmp/disk.img /mnt \-o loop"
.sp
.RE
-The mount command
+The
+.B mount
+command
.B automatically
creates a loop device from a regular file if a filesystem type is
not specified or the filesystem is known for libblkid, for example:
You can also free a loop device by hand, using
.BR "losetup \-d " or " umount \-d" .
-Since util-linux v2.29 mount command re-uses the loop device rather than
-initialize a new device if the same backing file is already used for some loop
+Since util-linux v2.29,
+.B mount
+re-uses the loop device rather than
+initializing a new device if the same backing file is already used for some loop
device with the same offset and sizelimit. This is necessary to avoid
a filesystem corruption.
-.SH RETURN CODES
+.SH EXIT STATUS
.B mount
-has the following return codes (the bits can be ORed):
+has the following exit status values (the bits can be ORed):
.TP
.B 0
success
The command \fBmount \-a\fR returns 0 (all succeeded), 32 (all failed), or 64 (some
failed, some succeeded).
-.SH "EXTERNAL HELPERS"
+.SH EXTERNAL HELPERS
The syntax of external mount helpers is:
.sp
.in +4
and
.B sizelimit
to the mount.<suffix> helpers. All other options are used in a
-comma-separated list as argument to the \fB\-o\fR option.
+comma-separated list as an argument to the \fB\-o\fR option.
+.SH ENVIRONMENT
+.IP LIBMOUNT_FSTAB=<path>
+overrides the default location of the
+.I fstab
+file (ignored for suid)
+.IP LIBMOUNT_MTAB=<path>
+overrides the default location of the
+.I mtab
+file (ignored for suid)
+.IP LIBMOUNT_DEBUG=all
+enables libmount debug output
+.IP LIBBLKID_DEBUG=all
+enables libblkid debug output
+.IP LOOPDEV_DEBUG=all
+enables loop device setup debug output
.SH FILES
See also "\fBThe files /etc/fstab, /etc/mtab and /proc/mounts\fR" section above.
.TP 18n
libmount private runtime directory
.TP
.I /etc/mtab
-table of mounted filesystems or symlink to /proc/mounts
+table of mounted filesystems or symlink to
+.I /proc/mounts
.TP
.I /etc/mtab\s+3~\s0
-lock file (unused on systems with mtab symlink)
+lock file (unused on systems with
+.I mtab
+symlink)
.TP
.I /etc/mtab.tmp
-temporary file (unused on systems with mtab symlink)
+temporary file (unused on systems with
+.I mtab
+symlink)
.TP
.I /etc/filesystems
a list of filesystem types to try
-.SH ENVIRONMENT
-.IP LIBMOUNT_FSTAB=<path>
-overrides the default location of the fstab file (ignored for suid)
-.IP LIBMOUNT_MTAB=<path>
-overrides the default location of the mtab file (ignored for suid)
-.IP LIBMOUNT_DEBUG=all
-enables libmount debug output
-.IP LIBBLKID_DEBUG=all
-enables libblkid debug output
-.IP LOOPDEV_DEBUG=all
-enables loop device setup debug output
-.SH "SEE ALSO"
-.na
-.BR mount (2),
-.BR umount (2),
-.BR umount (8),
-.BR fstab (5),
-.BR nfs (5),
-.BR xfs (5),
-.BR e2label (8),
-.BR findmnt (8),
-.BR losetup (8),
-.BR mke2fs (8),
-.BR mountd (8),
-.BR nfsd (8),
-.BR swapon (8),
-.BR tune2fs (8),
-.BR xfs_admin (8)
-.ad
+.SH HISTORY
+A
+.B mount
+command existed in Version 5 AT&T UNIX.
.SH BUGS
It is possible for a corrupted filesystem to cause a crash.
.PP
Some Linux filesystems don't support
-.BR "\-o sync " nor " \-o dirsync"
+.BR "\-o sync " and " \-o dirsync"
(the ext2, ext3, ext4, fat and vfat filesystems
.I do
support synchronous updates (a la BSD) when mounted with the
.I /etc/mtab
and
.I /proc/mounts
-don't match on systems with a regular mtab file. The first file is based only on
+don't match on systems with a regular
+.I mtab
+file. The first file is based only on
the mount command options, but the content of the second file also depends on
the kernel and others settings (e.g.\& on a remote NFS server -- in certain cases
the mount command may report unreliable information about an NFS mount point
-and the /proc/mounts file usually contains more reliable information.) This is
-another reason to replace the mtab file with a symlink to the
+and the
+.I /proc/mount
+file usually contains more reliable information.) This is
+another reason to replace the
+.I mtab
+file with a symlink to the
.I /proc/mounts
file.
.PP
and
.B ioctl
families of functions) may lead to inconsistent results due to the lack of
-a consistency check in the kernel even if noac is used.
+a consistency check in the kernel even if the
+.B noac
+mount option is used.
.PP
The
.B loop
command manually before calling
.B mount
with the configured loop device.
-.SH HISTORY
-A
-.B mount
-command existed in Version 5 AT&T UNIX.
.SH AUTHORS
.nf
Karel Zak <kzak@redhat.com>
.fi
+.SH SEE ALSO
+.na
+.BR lsblk (1),
+.BR mount (2),
+.BR umount (2),
+.BR fileystems (5),
+.BR fstab (5),
+.BR nfs (5),
+.BR xfs (5),
+.BR mount_namespaces (7)
+.BR xattr (7)
+.BR e2label (8),
+.BR findmnt (8),
+.BR losetup (8),
+.BR mke2fs (8),
+.BR mountd (8),
+.BR nfsd (8),
+.BR swapon (8),
+.BR tune2fs (8),
+.BR umount (8),
+.BR xfs_admin (8)
+.ad
.SH AVAILABILITY
The mount command is part of the util-linux package and is available from
https://www.kernel.org/pub/linux/utils/util-linux/.