NAME¶mount - mount a filesystem
SYNOPSIS¶mount [-l|-h|-V]
mount -a [-fFnrsvw] [-t fstype] [-O optlist]
mount [-fnrsvw] [-o options] device|dir
mount [-fnrsvw] [-t fstype] [-o options] device dir
DESCRIPTION¶ filesystem is used to control how data is stored on the device or provided in a virtual way by network or another to filesystem driver. The exception is --all, in this case already mounted filesystems are ignored (see --all below for more details).
Listing the mounts¶The]
Indicating the device and filesystem¶Most).
The device name of disk partitions are unstable; hardware reconfiguration, adding or removing a device can cause change in names. This is reason why it's strongly recommended to use filesystem or partition identificators like UUID or LABEL.
The command lsblk --fs provides overview of filesystems, LABELs and UUIDs on available block devices. The command blkid -p <device> provides details about a filesystem on the specified device.
Don't forget that there is no guarantee that UUIDs and labels are really unique, especially if you move, share or copy the device. Use lsblk -o +UUID,PARTUUID to verify that the UUIDs are really unique in your system.
The recommended setup is to use tags (e.g. UUID=uuid) already mounted' from mount can be confusing.)
The files /etc/fstab, /etc/mtab and /proc/mounts¶The], PARTUUID or PARTLABEL) and dir are specified. For example, to mount device foo at /dir:
mount /dev/foo /dir
Non-superuser mounts¶Normally, only the superuser can mount filesystems. However, when fstab contains the user option on a line, anybody can mount the corresponding filesystem.
Thus, given a line
/dev/cdrom /cd iso9660 ro,user,noauto,unhide.
Bind mount operation¶.
mount(8) since v2.27 allows to change 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 -o rbind,ro).
mount(8) since v2.31 ignores the bind flag from /etc/fstab on 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 flag has been always applied and it was impossible to re-define mount options without interaction with the bind semantic. This mount(8) behavior does not affect situations when "remount,bind" is specified in the /etc/fstab file.
The move operation¶Move a mounted tree to another place (atomically)..
Shared subtree operations¶Since) system call, and the flags cannot be mixed with other mount options and operations.
Since util-linux 2.23 the mount command allows to do more propagation (topology) changes by one mount(8) call and do it also together with other mount operations. This feature is EXPERIMENTAL. The propagation flags are applied by additional mount(2) system calls /foox mount --make-private /foo mount --make-unbindable /foo
COMMAND-LINE OPTIONS¶The. 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 mount --all. It means that all duplicated fstab entries will be mounted.
Note that it is a bad practice to use mount -a for fstab checking. The recommended solution is findmnt --verify.
- -B, --bind
- Remount a subtree somewhere else (so that its contents are available in both places). See above, under Bind mounts.
-  set-user-ID, the subsection The move operation.
- -n, --no-mtab
- Mount without writing in /etc/mtab. This is necessary for example when /etc is on a read-only filesystem.
- -N, --namespace ns
- Perform mount in namespace specified by ns. ns is either PID of process running in that namespace or special file representing that namespace.
mount(8) switches to the namespace when it reads /etc/fstab, writes /etc/mtab (or writes to /run/mount) and calls 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 mount(2) command.
See namespaces(7) for more information.
- -O, --test-opts opts
- command line. mode can be one of ignore, append, prepend or replace. For example append means that options from fstab are appended to options from command line. Default value is prepend -- it means command line options are evaluated after fstab options. Note that the last option wins if there are conflicting ones.
- --options-source source
- Source of default options. source is comma separated list of fstab, mtab and disable. disable disables fstab and mtab and disables --options-source-force.¶Some, ext relatime and strictatime mount options.
- noatime
- Do not update inode access times on this filesystem (e.g. for faster access on the news spool to speed up news servers). This works for all inode types (directories too), so it or ext.  operation together with the bind flag has special semantic. See above, the subsection Bind mounts.
The remount functionality follows the standard way the mount command works with options from fstab. This means that mount does not read fstab (or mtab) only when both is found in fstab, then 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 without a change.
- OPTIONS¶.¶
-¶
- debugfs¶The¶The fat¶
- This option is obsolete and may fail or being ignored.
-¶
-=mode
- This option is obsolete and may fail or being ignored.
- nocheck
- Do not abort mounting when certain consistency checks fail.
Mount options for iso9660¶ISO 9660 is a standard describing a filesystem structure to be used on CD-ROMs. (This filesystem type is also seen on some DVDs. See also the udf filesystem.)
Normal iso9660 filenames appear in.) Octal mode values require=mode
- This option is obsolete and may fail or being ignored.
-.
- sbsector=xxx
- Session begins from sector xxx.¶
- msdos¶See mount options for fat. If the msdos filesystem detects an inconsistency, it reports an error and sets the file system read-only. The filesystem can be made writable again by remounting it.
Mount options for ncpfs¶tfs¶
- overlay¶Since Linux 3.18 the overlay pseudo filesystem implements a union mount for other filesystems. a valid d_type in readdir responses, so NFS is not suitable.
A read-only overlay of two read-only filesystems may use any filesystem type. The options lowerdir and upperdir are combined into a merged directory by using: reiserfs¶ ubifs¶UBIFS is a flash filesystem which works on top of UBI volumes. Note that atime is not supported and is always turned off.
- The device name may be specified as
- ubiY
- UBI device number 0, volume number Y
- ubiX:NAME
- UBI device number X, volume with name NAME
- ubi:NAME
- UBI device number 0, volume with name NAME
-.
Mount options for udf¶UDF is the "Universal Disk Format" filesystem defined by¶
-¶
- uid=ignore
- Ignored, use uid=<user> instead.
- gid=ignore
- Ignored, use gid=<group> instead.
- volume=
- Unimplemented and ignored.
- partition=
- Unimplemented and ignored.
- fileset=
- Unimplemented and ignored.
- rootdir=
- Unimplemented and ignored.
Mount options for ufs¶
-¶See mount options for msdos. The dotsOK option is explicitly killed by umsdos.
Mount options for vfat¶¶
-.
THE LOOP DEVICE¶ command re-uses the loop device rather than initialize 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.
RETURN CODES¶¶The syntax of external mount helpers is:
/sbin/mount.suffix spec dir [-sfnv] [-N namespace] [-o options] [-t type.subtype]
where the suffix is the filesystem type and the -sfnvoN -o option.
FILES¶
ENVIRONMENT¶
-
SEE ALSO¶mount¶It is possible for a corrupted filesystem to cause a crash.
Some Linux filesystems don't support -o sync nor -o dirsync (the ext2, ext3, ext the files /etc/mtab and /proc/mounts don't match on systems with a regular 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 /proc/mounts file.
Checking files on NFS filesystems referenced by file descriptors (i.e. the fcntl and ioctl families of functions) may lead to inconsistent results due to the lack of a consistency check in¶A mount command existed in Version 5 AT&T UNIX.
AUTHORS¶
Karel Zak <kzak@redhat.com>