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).
.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
+\fB\-\-options\-source\-force\fR to always read configuration from
+.IR fstab .
+For non-root users
.B mount
-always read fstab configuration.
+always read
+.I fstab
+configuration.
.SS Non-superuser mounts
Normally, only the superuser can mount filesystems.
.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
to use NFS or CIFS source on command line.
.I olddir newdir
.RE
-or by using this fstab entry:
+or by using this
+.I fstab
+entry:
.RS
.br
The 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.
+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
.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
+(from 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
.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.
or special file representing that namespace.
.sp
.BR mount (8)
-switches to the mount 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
.BR mount (2)
system call, otherwise it runs in the original mount namespace.
It means that the target namespace does not have
.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 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 command line.
+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
.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"
.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:
+.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 muontpoint 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
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).
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.
flag has special semantic. 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
+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
.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
+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 the 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.
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
+functionality have been extended to keep existing
+.I fstab
+configurations usable
without a change.
.TP
.BR X-mount.mkdir [ = \fImode\fR ]
.SH ENVIRONMENT
.IP LIBMOUNT_FSTAB=<path>
-overrides the default location of the fstab file (ignored for suid)
+overrides the default location of the
+.I fstab
+file (ignored for suid)
.IP LIBMOUNT_MTAB=<path>
-overrides the default location of the mtab file (ignored for suid)
+overrides the default location of the
+.I mtab
+file (ignored for suid)
.IP LIBMOUNT_DEBUG=all
enables libmount debug output
.IP LIBBLKID_DEBUG=all
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)
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
.BR \-a , " \-\-all"
All of the filesystems described in
.I /proc/self/mountinfo
-(or in deprecated /etc/mtab)
+(or in deprecated
+.IR /etc/mtab )
are unmounted, except the proc, devfs, devpts, sysfs, rpc_pipefs and nfsd
filesystems. This list of the filesystems may be replaced by \fB\-\-types\fR
umount option.
The filesystem can be specified by one of the mountpoints or the device name (or
UUID, etc.). When this option is used together with \fB\-\-recursive\fR, then
all nested mounts within the filesystem are recursively unmounted.
-This option is only supported on systems where /etc/mtab is a symlink
-to /proc/mounts.
+This option is only supported on systems where
+.I /etc/mtab
+is a symlink
+to
+.IR /proc/mounts .
.TP
.BR \-c , " \-\-no\-canonicalize"
Do not canonicalize paths. The paths canonicalization is based on
or special file representing that namespace.
.sp
.BR umount (8)
-switches to the namespace when it reads /etc/fstab, writes /etc/mtab (or writes to /run/mount) and calls
+switches to the namespace when it reads
+.IR /etc/fstab ,
+writes
+.IR /etc/mtab
+(or writes to
+.IR /run/mount )
+and calls
.BR umount (2)
system call, otherwise it runs in the original namespace.
It means that the target mount namespace does not have
.BR \-R , " \-\-recursive"
Recursively unmount each specified directory. Recursion for each directory will
stop if any unmount operation in the chain fails for any reason. The relationship
-between mountpoints is determined by /proc/self/mountinfo entries. The filesystem
+between mountpoints is determined by
+.I /proc/self/mountinfo
+entries. The filesystem
must be specified by mountpoint path; a recursive unmount by device name (or UUID)
is unsupported.
.TP
Note that
.B umount
reads information about mounted filesystems from kernel (/proc/mounts) and
-filesystem names may be different than filesystem names used in the /etc/fstab
+filesystem names may be different than filesystem names used in the
+.I /etc/fstab
(e.g., "nfs4" vs. "nfs").
.TP
.BR \-v , " \-\-verbose"
.B umount
command will automatically detach loop device previously initialized by
.BR mount (8)
-command independently of /etc/mtab.
+command independently of
+.IR /etc/mtab .
In this case the device is initialized with "autoclear" flag (see
.BR losetup (8)
.TP
.I /etc/mtab
table of mounted filesystems (deprecated and usually replaced by
-symlink to /proc/mounts)
+symlink to
+.IR /proc/mounts )
.TP
.I /etc/fstab
table of known filesystems