MOUNT(8)

๐ŸŽ€ mount(8) ๐ŸŽ€

okay bestie, so this is the manual page for mount, and it lives in the System Administration corner of the man pages. it is long. it is iconic. and we're gonna get through all of it together, no skipping, no summarising, because every single detail here is load-bearing. ๐Ÿซถ


โœจ NAME โœจ

mount โ€” mount a filesystem


๐ŸŒธ SYNOPSIS ๐ŸŒธ

mount [-h|-V]

mount [-l] [-t fstype]

mount -a [-F] [-fnrsvw] [-t fstype] [-O optlist]

mount [-fnrsvw] [-o options] device|mountpoint

mount [-fnrsvw] [-o options] [-t fstype] device mountpoint

mount --bind|--rbind|--move olddir newdir

mount --make-[r]{shared|slave|private|unbindable} mountpoint

๐Ÿ’… DESCRIPTION ๐Ÿ’…

so like, every single file you can touch on a Unix system is arranged into one giant tree, the file hierarchy, and the root of that tree is /. but plot twist: those files can actually be spread out across a bunch of different devices. that's where mount comes in โ€” its whole job is to attach the filesystem sitting on some device onto that big tree. ๐Ÿ’–

and then, conversely, umount(8) is the one that detaches it again. rude but necessary. the filesystem is what controls how data is stored on the device, or how it's provided in a virtual way by network or other services. ๐ŸŒ

the standard form of the mount command is:

mount -t type device dir

this tells the kernel to attach the filesystem it finds on device (which is of type type) at the directory dir. the -t type option is optional โ€” mount is usually able to detect a filesystem all by itself, main character energy. by default you need root permissions to mount a filesystem. see the section "Non-superuser mounts" below for the deets. the previous contents (if any) plus the owner and mode of dir become invisible, and as long as this filesystem stays mounted, the pathname dir refers to the root of the filesystem on device. โœจ

if you only give the directory or the device, like this:

mount /dir

then mount goes looking for a mountpoint (and if it can't find one, then it looks for a device) in the /etc/fstab file. you can use the --target or --source options to avoid ambiguous interpretation of the argument you passed. for example:

mount --target /mountpoint

the same filesystem can be mounted more than once, and in some cases (e.g., network filesystems) the same filesystem can be mounted on the same mountpoint multiple times. mount does not implement any policy to control this behavior. all of it is controlled by the kernel, and it's usually specific to the filesystem driver. the one exception is --all โ€” in that case already-mounted filesystems are ignored (see --all below for more details). ๐Ÿ’€


๐Ÿฆ‹ Listing the mounts ๐Ÿฆ‹

the listing mode is maintained for backward compatibility only, bestie. for more robust and customizable output use findmnt(8), especially in your scripts. also note that control characters in the mountpoint name get replaced with '?'.

the following command lists all mounted filesystems (of type type):

mount [-l] [-t type]

the -l option adds labels to this listing. see below. ๐Ÿท๏ธ


๐ŸŒˆ Indicating the device and filesystem ๐ŸŒˆ

most devices are indicated by a filename (of a block special device), like /dev/sda1, but there are other possibilities. for example, in the case of an NFS mount, device may look like knuth.cwi.nl:/dir. ๐Ÿ‘‘

the device names of disk partitions are unstable โ€” hardware reconfiguration, and adding or removing a device, can cause changes in names. which is exactly why it's strongly recommended to use filesystem or partition identifiers like UUID or LABEL. currently supported identifiers (tags):

  • LABEL=label โ€” human readable filesystem identifier. see also -L. ๐Ÿ’–
  • UUID=uuid โ€” filesystem universally unique identifier. the format of the UUID is usually a series of hex digits separated by hyphens. see also -U.
    • note that mount uses UUIDs as strings. the UUIDs from the command line or from fstab(5) are not converted to internal binary representation. the string representation of the UUID should be based on lower case characters.
  • PARTLABEL=label โ€” 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). ๐ŸŽ€
  • PARTUUID=uuid โ€” 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). ๐ŸŽ€
  • ID=id โ€” 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 ls /dev/disk/by-id for more details โ€” this directory and running udevd is required. this identifier is not recommended for generic use, because the identifier is not strictly defined and it depends on udev, udev rules and hardware. ๐Ÿ™ˆ

the command lsblk --fs gives you an overview of filesystems, LABELs and UUIDs on available block devices. the command blkid -p <device> gives you details about a filesystem on the specified device. ๐Ÿ”

don't forget: 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. verify, bestie, always verify. โœ…

the recommended setup is to use tags (e.g. UUID=uuid) rather than /dev/disk/by-{label,uuid,id,partuuid,partlabel} udev symlinks in the /etc/fstab file. tags are more readable, robust and portable. mount(8) internally uses udev symlinks anyway, so using symlinks in /etc/fstab has no advantage over tags. for more details see libblkid(3).

the proc filesystem is not associated with a special device, and when you mount it, an arbitrary keyword โ€” for example, proc โ€” can be used instead of a device specification. (the customary choice none is less fortunate: the error message 'none already mounted' from mount can be confusing.) ๐Ÿ˜ญ


๐ŸŒธ The files /etc/fstab, /etc/mtab and /proc/mounts ๐ŸŒธ

the file /etc/fstab (see fstab(5)) may contain lines describing what devices are usually mounted where, using which options. the default location of the fstab(5) file can be overridden with the --fstab path command-line option (see below for more details).

the command

mount -a [-t type] [-O optlist]

(usually given in a bootscript) causes all filesystems mentioned in fstab (of the proper type and/or having or not having the proper options) to be mounted as indicated โ€” except for those whose line contains the noauto keyword. adding the -F option will make mount fork, so that the filesystems get mounted in parallel. โšก

when mounting a filesystem mentioned in fstab or mtab, it suffices to specify on the command line only the device, or only the mount point.

the programs mount and umount(8) traditionally maintained a list of currently mounted filesystems in the file /etc/mtab. the support for regular classic /etc/mtab is completely disabled at compile time by default, because on current Linux systems it's better to make /etc/mtab a symlink to /proc/mounts instead. the regular mtab file maintained in userspace cannot reliably work with namespaces, containers and other advanced Linux features. if the regular mtab support is enabled, then it's possible to use the file as well as the symlink.

if no arguments are given to mount, the list of mounted filesystems is printed. ๐Ÿ“‹

if you want to override mount options from /etc/fstab, you have to use the -o option:

mount device|dir -o options

and then the mount options from the command line will be appended to the list of options from /etc/fstab. this default behaviour can be changed using the --options-mode command-line option. the usual behavior is that the last option wins if there are conflicting ones. ๐Ÿ‘‘

the mount program does not read the /etc/fstab file if both device (or LABEL, UUID, ID, PARTUUID or PARTLABEL) and dir are specified. for example, to mount device foo at /dir:

mount /dev/foo /dir

this default behaviour can be changed by using the --options-source-force command-line option to always read configuration from fstab. for non-root users, mount always reads the fstab configuration.


๐Ÿ’œ 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. ๐Ÿ™Œ

so, given a line like

/dev/cdrom /cd iso9660 ro,user,noauto,unhide

any user can mount the iso9660 filesystem found on an inserted CDROM using the command:

mount /cd

note that mount is very strict about non-root users, and all paths specified on the command line are verified before fstab is parsed or a helper program is executed. it's strongly recommended to use a valid mountpoint to specify filesystem, otherwise mount may fail. for example, it's a bad idea to use NFS or CIFS source on the command line. ๐Ÿšซ

since util-linux 2.35, mount does not exit when user permissions are inadequate according to libmount's internal security rules. instead, it drops suid permissions and continues as a regular non-root user. this behavior supports use-cases where root permissions are not necessary (e.g., fuse filesystems, user namespaces, etc). โœจ

for more details, see fstab(5). only the user that mounted a filesystem can unmount it again. if any user should be able to unmount it, then use users instead of user in the fstab line. the owner option is similar to the user option, with the restriction that the user must be the owner of the special file. this may be useful e.g. for /dev/fd if a login script makes the console user owner of this device. the group option is similar, with the restriction that the user must be a member of the group of the special file.

the user mount option is accepted if no username is specified. if used in the format user=someone, the option is silently ignored and visible only for external mount helpers (/sbin/mount.<type>) for compatibility with some network filesystems.

for unprivileged users the mount target from fstab is opened before the filesystem is attached, and the mount operation uses this file descriptor rather than the path, so the path is not resolved for the second time by the kernel. symbolic links are not followed in the target path at all โ€” a fstab entry with a symbolic link in the mount point path is unusable for unprivileged users and the mount fails. ๐Ÿ’€


โš ๏ธ Warning

When the new mount API isn't available (that's Linux before 5.2, or mount(8) compiled without the support for it) ๐Ÿ’€, we're back on the legacy mount(2) syscall. And then the pinned target gets referenced by a /proc/self/fd/ path โ€” which requires a mounted /proc filesystem, bestie, no /proc no dice. Without /proc the target path gets resolved by the kernel again, and that inherent time-of-check-to-time-of-use (TOCTOU) window between the verification and the mount operation justโ€ฆ stays open ๐Ÿ˜ญ. And if an ancestor directory of the mount target is writable by the unprivileged user? A path component could be swapped to redirect the mount to an unintended location ๐Ÿ™ˆ. So admins: please make sure that mount target paths for user mounts do not traverse directories writable by unprivileged users. Periodt.

For mount source paths, mount(8) only canonicalizes (resolves symlinks) paths starting with /dev/ for unprivileged users, and then it verifies the result stays within /dev/ โœจ. Source paths outside /dev/ (e.g. disk images chillin' in user-writable directories) are kept as-is from fstab. Not touching them, nope.

Filesystem type auto-detection for unprivileged users relies exclusively on udev metadata rather than direct device probing ๐Ÿซถ. Which means file images that are not registered with udev require an explicit filesystem type in fstab. That's the whole rule, iykyk.


Bind mount operation ๐ŸŽ€

Remount part of the file hierarchy somewhere else. The call is:

mount --bind olddir newdir

or by using this fstab entry:

/olddir /newdir none bind

After this call the same contents are accessible in two places. Two places, same contents, slay ๐Ÿ’….

Okay but lowkey important: you have 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 a "bind" operation. The olddir and newdir are independent and the olddir may be unmounted. Independent. No strings attached. ๐Ÿฆ‹

One can also remount a single file (on a single file). It's also possible to use a bind mount to create a mountpoint from a regular directory, for example:

mount --bind foo foo

The bind mount call attaches only (part of) a single filesystem, not possible submounts. The entire file hierarchy including submounts can be attached a second place by using:

mount --rbind olddir newdir

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 mount, and it's necessary to explicitly specify the options on the mount command line. Do not assume, bestie, specify.

Since util-linux 2.27, mount permits changing the mount options by passing the relevant options along with --bind. For example:

mount -o bind,ro foo foo

This feature is not supported by the Linux kernel โ€” it is implemented in userspace by an additional mount(2) remounting system call. This solution is not atomic ๐Ÿ˜ญ. Just so you know.

The alternative (classic) way to create a read-only bind mount is to use the remount operation, for example:

mount --bind olddir newdir

mount -o remount,bind,ro olddir newdir

Note that a read-only bind will create a read-only mountpoint (VFS entry), but the original filesystem superblock will still be writable โ€” meaning that the olddir will be writable, but the newdir will be read-only. Sneaky but that's literally how it works ๐Ÿ™ˆ.

It's also possible to change nosuid, nodev, noexec, noatime, nodiratime, relatime and nosymfollow VFS entry flags via a "remount,bind" operation. The other flags (for example filesystem-specific flags) are silently ignored ๐Ÿ’€. The classic mount(2) system call does not allow to change mount options recursively (for example with -o rbind,ro). The recursive semantic is possible with a new mount_setattr(2) kernel system call, and it's supported since libmount from util-linux v2.39 by a new experimental "recursive" option argument (e.g. -o rbind,ro=recursive). For more details see the FILESYSTEM-INDEPENDENT MOUNT OPTIONS section โœจ.

Since util-linux 2.31, mount ignores the bind flag from /etc/fstab on a 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 mount behavior does not affect situations when "remount,bind" is specified in the /etc/fstab file. K? K. ๐Ÿ’œ

Since util-linux 2.39, mount may use the new kernel mount API if it is available. This new kernel interface provides a more precise way to work with mountpoint attributes ๐Ÿ”ฅ. For example, the -o bind,rw operation will create a read-write node even if the original node was read-only. This was impossible with the old classic mount(2) syscall, where the read-only VFS flag was inherited from the original node. Glow up fr fr.


The move operation ๐Ÿงš

Move a mounted tree to another place (atomically). The call is:

mount --move olddir newdir

This will cause the contents which previously appeared under olddir to now be accessible under newdir. The physical location of the files is not changed. Note that olddir has to be a mountpoint. Like, has to.

Note also that moving a mount residing under a shared mount is invalid and unsupported ๐Ÿšซ. Use findmnt -o TARGET,PROPAGATION to see the current propagation flags.


Shared subtree operations ๐ŸŒˆ

Since Linux 2.6.15 it is possible to mark a mount and its submounts as shared, private, slave or unbindable. A shared mount provides the ability to create mirrors of that mount such that mounts and unmounts within any of the mirrors propagate to the other mirror. A slave mount receives propagation from its master, but not vice versa. A private mount carries no propagation abilities. An unbindable mount is a private mount which cannot be cloned through a bind operation. The detailed semantics are documented in Documentation/filesystems/sharedsubtree.txt file in the kernel source tree; see also mount_namespaces(7).

Supported operations are:

mount --make-shared mountpoint
mount --make-slave mountpoint
mount --make-private mountpoint
mount --make-unbindable mountpoint

The following commands allow one to recursively change the type of all the mounts under a given mountpoint.

mount --make-rshared mountpoint
mount --make-rslave mountpoint
mount --make-rprivate mountpoint
mount --make-runbindable mountpoint

mount does not read fstab(5) when a --make-* operation is requested. All necessary information has to be specified on the command line. No shortcuts, bestie โœ‹.

Note that the Linux kernel does not allow changing multiple propagation flags with a single mount(2) system call, and the flags cannot be mixed with other mount options and operations. That's just the rules ๐Ÿ˜ค.

Since util-linux 2.23 the mount command can be used to do more propagation (topology) changes by one mount(8) call and do it also together with other mount operations. The propagation flags are applied by additional mount(2) system calls when the preceding mount operations were successful. Note that this use case is not atomic ๐Ÿ’€. It is possible to specify the propagation flags in fstab(5) as mount options (private, slave, shared, unbindable, rprivate, rslave, rshared, runbindable).

For example:

mount --make-private --make-unbindable /dev/sda1 /foo

is the same as:

mount /dev/sda1 /foo
mount --make-private /foo
mount --make-unbindable /foo

โœจ COMMAND-LINE OPTIONS โœจ

The full set of mount options used by an invocation of mount is determined by first extracting the mount options for the filesystem from the fstab table, then applying any options specified by the -o argument, and finally applying a -r or -w option, when present. That's the order. In that order. ๐ŸŽ€

The mount command does not pass all command-line options to the /sbin/mount.suffix mount helpers. The interface between mount and the mount helpers is described below in the EXTERNAL HELPERS section.

Command-line options available for the mount command are:

  • -a, --all โ€” Mount all filesystems (of the given types) mentioned in fstab (except for those whose line contains the noauto keyword). This option was originally designed for use in init scripts. Note that many modern systemd-based distributions do not use mount -a on boot and instead mount filesystems in a more sophisticated way using systemd units.

The filesystems are mounted following their order in fstab. 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. This means that all duplicated fstab entries will be mounted. ๐Ÿ‘ฏ

The correct functionality depends on /proc (to detect already mounted filesystems) and on /sys (to evaluate filesystem tags like UUID= or LABEL=). It's strongly recommended to mount /proc and /sys filesystems before mount -a is executed, or keep /proc and /sys at the beginning of fstab. Do it, bestie, it'll save you ๐Ÿ˜ญ.

The option --all is possible to use for remount operation too. In this case all filters (-t and -O) are applied to the table of already mounted filesystems.

Since version 2.35 it is possible to use the command line option -o to alter mount options from fstab (see also --options-mode).

Note that swap entries in fstab are silently ignored by mount -a. Use swapon -a to enable swap devices and files. See swapon(8).

Note that it is a bad practice to use mount -a for fstab checking ๐Ÿ™…. The recommended solution is findmnt --verify. Use that one instead.

  • --beneath โ€” Mount the filesystem beneath the top mount of the specified target (mountpoint), allowing the top mount to be unmounted. This option replaces the filesystem at the mountpoint in an atomic manner, ensuring there is no moment when the filesystem is absent. No gap, no glitch, iconic โœจ.

For example update from a Btrfs filesystem to an XFS filesystem without ever revealing the underlying mountpoint:

mount           -t btrfs /dev/sdA /mnt
mount --beneath -t xfs   /dev/sdB /mnt
umount /mnt
  • -B, --bind โ€” Remount a subtree somewhere else (so that its contents are available in both places). See above, under Bind mount operation.
  • -c, --no-canonicalize โ€” Do not canonicalize any paths or tags during the mount process. The mount command automatically canonicalizes all paths (from the command line or fstab). This option can be used in conjunction with the -f flag for paths that are already canonicalized. This option is intended for mount helpers that call mount -i. It is highly recommended to not use this command-line option for regular mount operations ๐Ÿšฉ. See also the X-mount.nocanonicalize mount options.

Note that mount does not pass this option to the /sbin/mount.type helpers.

  • --exclusive โ€” okay so this one makes your filesystem mount as a unique instance, and the kernel is not allowed to reuse the filesystem superblock. If you later mount it without this option, the filesystem can totally get reused again, no hard feelings. It only affects this one mount, and โ€” good news โ€” non-root users are allowed to use it too. ๐Ÿซถ

Peep --onlyonce for comparison, because they are lowkey different in a way that matters: onlyonce means the same source can't be mounted on the same mount point โ€” so mounting twice on /A is a no, but /A and /B is fine. exclusive is stricter in a different direction: the filesystem itself won't be reused, no matter what mount point you pick. ๐Ÿ’…

  • -F, --fork โ€” (this one only makes sense with -a.) It forks a whole new incarnation of mount for every single device. So the mounts on different devices or different NFS servers happen in parallel. The glow-up: it's faster, and NFS timeouts also run in parallel. The not-so-glowy part: the order of the mount operations becomes undefined. So do not use this if you want to mount both /usr and /usr/spool. ๐Ÿ™ˆ
  • -f, --fake โ€” does literally everything except the mount-related system calls. Bestie, the tea: --fake was originally designed to write an entry to /etc/mtab without actually mounting anything.

But /etc/mtab is no longer maintained in userspace, and starting from version 2.39, the mount operation can be a complex chain of operations with dependencies between the syscalls. So --fake now forces libmount to skip all mount source preparation, mount option analysis, and the actual mounting process.

The difference between fake and non-fake execution is huge. Which is exactly why --fake has minimal significance for the current mount(8) implementation and is maintained mostly for backward compatibility. ๐Ÿซ 

  • -i, --internal-only โ€” don't call the /sbin/mount.filesystem helper, even if it exists. Not even a little. โœ‹
  • -L, --label label โ€” mounts the partition that has the specified label. ๐Ÿท๏ธ
  • -l, --show-labels โ€” adds the labels into the mount output. For this to work, mount needs permission to read the disk device (like, be set-user-ID root, iykyk). You can set a label for ext2, ext3 or ext4 with the e2label(8) utility, or for XFS with xfs_admin(8), or for reiserfs with reiserfstune(8). โœจ
  • -M, --move โ€” moves a subtree to some other place. See the subsection The move operation above. ๐Ÿšš
  • -m, --mkdir[=mode] โ€” lets you make a target directory (the mountpoint) if it doesn't exist yet. It's an alias to -o X-mount.mkdir[=mode], and the default mode is 0755. More details down at X-mount.mkdir. ๐Ÿ“
  • --map-groups, --map-users inner:outer:count โ€” adds the specified user/group mapping to an X-mount.idmap map. The inner ID is the starting ID as stored in the filesystem, and the outer ID is the starting ID as it appears in the new mount. You can pass these options multiple times to build up complete mappings for users and groups. More deets at X-mount.idmap below. ๐Ÿ—บ๏ธ
  • --map-users /proc/PID/ns/user โ€” uses the specified user namespace for user and group mapping in an id-mapped mount. This is an alias for -o X-mount.idmap=/proc/PID/ns/user, and heads up: it cannot be used twice, and cannot be used together with the inner:outer:count option format above. More at X-mount.idmap. ๐ŸŒˆ
  • -n, --no-mtab โ€” mounts without writing to /etc/mtab. This is necessary, for example, when /etc is on a read-only filesystem. ๐Ÿšซ๐Ÿ“
  • -N, --namespace ns โ€” performs the mount operation inside the mount namespace specified by ns. ns is either the PID of the process running in that namespace, or a special file representing that namespace.

Here's the cute part: mount switches into the mount namespace when it reads /etc/fstab, writes /etc/mtab (or writes to /run/mount) and calls mount(2) โ€” otherwise it runs in the original mount namespace. Which means the target namespace does not have to contain any libraries or other requirements necessary to execute the mount(2) call. Iconic, honestly. ๐Ÿ‘‘

See mount_namespaces(7) for more info.

  • -O, --test-opts opts โ€” limits the set of filesystems that -a applies to. In that regard it's like -t, except -O is useless without -a. For example, this command:
mount -a -O no_netdev

mounts all filesystems except those that have the option netdev specified in the options field in the /etc/fstab file.

It's different from -t because each option is matched exactly โ€” a leading no at the beginning of one option does not negate the rest. ๐Ÿง

And -t and -O are cumulative in effect. So this command:

mount -a -t ext2 -O  _netdev

mounts all ext2 filesystems with the _netdev option โ€” not all filesystems that are either ext2 or have _netdev specified. Two filters, both gotta pass. ๐Ÿ’ฏ

  • -o, --options opts โ€” uses the specified mount options. The opts argument is a comma-separated list. Like, for example:
mount LABEL=mydisk -o noatime,nodev,nosuid

Note that the order of the options matters, because the last option wins if there are conflicting ones. Also, options on the command line override options from fstab. Periodt. ๐Ÿ’…

For more details, see the FILESYSTEM-INDEPENDENT MOUNT OPTIONS and FILESYSTEM-SPECIFIC MOUNT OPTIONS sections.

  • --onlyonce โ€” forces the mount command to check if the filesystem is already mounted on the specified mountpoint. This behavior is the default for --all; otherwise, it depends on the kernel filesystem driver. Some filesystems may be mounted more than once on the same mount point (e.g. tmpfs, hi ๐Ÿ‘‹). See also --exclusive.
  • --options-mode mode โ€” controls how options from fstab/mtab get combined with options from the command line. mode can be one of ignore, append, prepend or replace. For example, append means options from fstab are appended to options from the command line. The default value is prepend โ€” meaning command line options are evaluated after fstab options. And remember: the last option wins if there are conflicting ones. โš”๏ธ
  • --options-source source โ€” the source of default options. source is a comma-separated list of fstab, mtab and disable. disable disables fstab and mtab and enables --options-source-force. The default value is fstab,mtab. ๐Ÿ“š
  • --options-source-force โ€” uses options from fstab/mtab even if both device and dir are specified. No take-backs. ๐Ÿ’ช
  • -R, --rbind โ€” remounts a subtree and all possible submounts somewhere else (so its contents are available in both places). See the subsection Bind mount operation above. ๐Ÿชž
  • -r, --ro, --read-only โ€” mounts the filesystem read-only. A synonym is -o ro.

โš ๏ธ Note that, depending on the filesystem type, state and kernel behavior, the system may still write to the device. For example, ext3 and ext4 will replay the journal if the filesystem is dirty. To prevent this kind of write access, you may want to mount an ext3 or ext4 filesystem with the ro,noload mount options, or set the block device itself to read-only mode โ€” see the blockdev(8) command. Don't get caught out bestie. ๐Ÿ˜ญ

  • -s โ€” tolerates sloppy mount options rather than failing. It'll ignore mount options not supported by a filesystem type. Not all filesystems support this option โ€” currently it's supported by the mount.nfs mount helper only. ๐Ÿคทโ™€๏ธ
  • --source device โ€” if only one argument for the mount command is given, then that argument might be interpreted as the target (mountpoint) or the source (device). This option lets you explicitly define that the argument is the mount source. ๐Ÿ“
  • --target directory โ€” same situation: one argument, could be target or source. This option lets you explicitly define that the argument is the mount target. ๐ŸŽฏ
  • --target-prefix directory โ€” prepends the specified directory to all mount targets. This is for when you want to follow fstab, but the mount operations happen in another place. For example:
mount --all --target-prefix /chroot -o X-mount.mkdir

mounts everything from the system fstab to /chroot, and all the missing mountpoints get created (thanks to X-mount.mkdir). See also --fstab if you wanna use an alternative fstab. ๐Ÿ—๏ธ

  • -T, --fstab path โ€” specifies an alternative fstab file. If path is a directory, then the files in the directory are sorted by strverscmp(3); files that start with . or don't have an .fstab extension are ignored. This option can be specified more than once. It's mostly designed for initramfs or chroot scripts, where additional configuration is specified beyond the standard system configuration. ๐Ÿงš

โš ๏ธ Note that mount does not pass the --fstab option to the /sbin/mount.type helpers, meaning the alternative fstab files will be invisible to those helpers. This is no problem for normal mounts, but user (non-root) mounts always require fstab to verify the user's rights. So, y'know, keep that in mind.

  • -t, --types fstype โ€” the argument after -t tells it the filesystem type. Which filesystem types are currently supported depends on the running kernel. See /proc/filesystems and /lib/modules/$(uname -r)/kernel/fs for a complete list of the filesystems. The most common ones are ext2, ext3, ext4, xfs, btrfs, vfat, sysfs, proc, nfs and cifs. ๐Ÿ‘‘

The programs mount and umount(8) support filesystem subtypes. The subtype is defined by a .subtype suffix โ€” for example fuse.sshfs. It's recommended to use the subtype notation rather than adding any prefix to the mount source (for example, sshfs#example.com is deprecated). ๐Ÿšซ

If no -t option is given, or if the auto type is specified, mount will try to guess the desired type. The filesystem type is determined using udev metadata first, then by direct device probing via libblkid(3) for root users. If neither method identifies the type, mount falls back to trying all types listed in /etc/filesystems, or if that file does not exist, /proc/filesystems. Types labeled nodev (e.g. devpts, proc and nfs) are skipped. If /etc/filesystems ends in a line with a single *, mount will read /proc/filesystems afterwards. While it's trying all this, every filesystem type gets mounted with the mount option silent. ๐Ÿคซ

And for unprivileged (non-root) users: direct device probing via libblkid(3) is disabled, and filesystem type detection relies exclusively on udev metadata. Which means file images that aren't registered with udev require an explicit filesystem type in fstab. No guessing for you, sorry bestie. ๐Ÿ’€

Okay so making a file called /etc/filesystems is genuinely a vibe โ€” it lets you flip the probe order around (like trying vfat before msdos, or ext3 before ext2), or it's the move if you're running a kernel module autoloader. ๐Ÿ’…

You can also drop more than one type in a comma-separated list โ€” works for the -t option and for an /etc/fstab entry. And the list of filesystem types you hand to -t can be prefixed with no to say "not these ones, bestie, skip them." Just know that the no prefix does absolutely nothing when you use it in an /etc/fstab entry. ๐Ÿ™ˆ

That no prefix is highkey meaningful with -a though. Like, check this:

mount -a -t nomsdos,smbfs

That mounts everything except the msdos and smbfs types. Slay.

For most types, all mount has to do is fire off a simple mount(2) system call โ€” no deep lore about the filesystem type required. But for a few types (looking at you nfs, nfs4, cifs, smbfs, ncpfs) some ad hoc code is necessary. Those five โ€” nfs, nfs4, cifs, smbfs, and ncpfs โ€” each have their own separate mount program. So that everything can be treated uniformly, mount will run the program /sbin/mount.type (if it exists) when you call it with type type. And since different versions of the smbmount program have different calling conventions, /sbin/mount.smbfs might have to be a shell script that sets up the call you actually want. ๐Ÿซถ

  • -U, --uuid uuid โ€” mount the partition that has the specified uuid.
  • -v, --verbose โ€” turns on verbose mode. Starting from version 2.41, if the new kernel mount API is available, it will also print kernel info messages. ๐Ÿ‘‘
  • -w, --rw, --read-write โ€” mount the filesystem read/write. Read-write is the kernel default, and the mount default is to try read-only if the previous mount(2) syscall with read-write flags on write-protected devices failed.

A synonym is -o rw.

Note that specifying -w on the command line forces mount to never try read-only mount on write-protected devices or on filesystems that are already mounted read-only.
  • -h, --help โ€” display help text and exit.
  • -V, --version โ€” display version and exit.

๐ŸŒˆ FILESYSTEM-INDEPENDENT MOUNT OPTIONS ๐ŸŒˆ

Some of these options are only useful when they show up in the /etc/fstab file. ๐Ÿ’–

Some of them might be enabled or disabled by default in your system kernel. Wanna check the current setting? Peep the options in /proc/mounts. And heads up โ€” filesystems also have their own per-filesystem specific default mount options (see for example tune2fs -l output for extN filesystems). ๐Ÿฆ‹

๐Ÿงš Virtual Filesystem Notes

The Virtual File System (VFS) is the abstract layer in the kernel that hands the filesystem interface to userspace programs. It also gives the kernel an abstraction so different filesystem implementations can coexist in peace. Some mount options apply only to this layer.

The options nosuid, noexec, nodiratime, relatime, noatime, strictatime, and nosymfollow are interpreted only by the virtual-filesystem kernel layer, and they get applied to the mountpoint node rather than to the filesystem itself. Want the full picture of filesystems and VFS options? Try:

findmnt -o TARGET,VFS-OPTIONS,FS-OPTIONS

Since v2.39, libmount can use a new kernel mount interface to set the VFS attributes recursively. But for backward compatibility, this feature is not enabled by default, even if a recursive operation (like rbind) has been requested. You can specify the new option argument "recursive", like this:

mount -orbind,ro=recursive,noexec=recursive,nosuid /foo /bar

That recursively binds filesystems from /foo to /bar, making /bar and all submounts read-only and noexec โ€” but only /bar itself will be "nosuid". And bestie, the "recursive" optional argument for VFS mount options is an EXPERIMENTAL feature. Be careful out there. ๐Ÿ˜ญ

๐ŸŽ€ Read-only Setting Notes

The read-only setting (ro or rw) is interpreted by the virtual-filesystem and the filesystem, and it all depends on how you specify the option on the mount(8) command line. For backward compatibility, the default is to use it for both layers during standard mount operations.

The operation "-o bind,remount,ro" is applied only to the VFS mountpoint, while "-o remount,ro" is applied to both the VFS and the filesystem superblock. This semantic lets you create a read-only mountpoint while keeping the filesystem writable from another mountpoint. Iconic behaviour, honestly. โœจ

Since version 2.41, libmount can use optional arguments vfs and fs (e.g. ro=fs) to say exactly where the read-only setting should land. For example, using this command:

mount -o ro=vfs /dev/sdc1 /A

will mount the filesystem as read-write on the superblock level, but the /A node gets set as read-only. In previous versions, this required an extra "-o bind,remount,ro" operation to get the same result. The way that upgrade ate. ๐Ÿ’…

๐ŸŒธ Generic Mount Options

These next ones apply to any filesystem being mounted โ€” but not every filesystem actually honors them. For example, the sync option only has an effect on ext2, ext3, ext4, fat, vfat, ufs, and xfs filesystems. Vibe check your fs first.

  • async โ€” all I/O to the filesystem should be done asynchronously. (See also the sync option.)
  • atime โ€” do not use the noatime feature, so the inode access time is controlled by kernel defaults. See also the descriptions of the 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 implies nodiratime.
  • auto โ€” can be mounted with the -a option.
  • noauto โ€” can only be mounted explicitly (i.e., the -a option will not cause the filesystem to be mounted).
  • context=context, fscontext=context, defcontext=context, and rootcontext=context โ€” the context= option is useful when mounting filesystems that don't support extended attributes, like a floppy or a hard disk formatted with VFAT, or systems that aren't normally running under SELinux, like an ext3 or ext4 formatted disk from a non-SELinux workstation. You can also use context= on filesystems you don't trust, such as a floppy. It also helps with compatibility with xattr-supporting filesystems on earlier 2.4.<x> kernel versions. Even where xattrs are supported, you can save time by not having to label every single file โ€” just assign the entire disk one security context.

A commonly used option for removable media is context="system_u:object_r:removable_t.

The fscontext= option works for all filesystems, regardless of their xattr support. The fscontext option sets the overarching filesystem label to a specific security context. This filesystem label is separate from the individual labels on the files. It represents the entire filesystem for certain kinds of permission checks, such as during mount or file creation. Individual file labels are still obtained from the xattrs on the files themselves. The context option actually sets the aggregate context that fscontext provides, in addition to supplying the same label for individual files.

You can set the default security context for unlabeled files using the defcontext= option. This overrides the value set for unlabeled files in the policy and requires a filesystem that supports xattr labeling.

The rootcontext= option lets you 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. The special value @target can be used to assign the current context of the target mountpoint location. ๐Ÿ‘‘

Note that the kernel rejects any remount request that includes the context option โ€” even when it's unchanged from the current context.
Warning: the context value might contain commas, in which case the value has to be properly quoted, otherwise mount will read that comma as a separator between mount options. Don't forget that the shell strips off quotes, so double quoting is required. For example:
mount -t tmpfs none /mnt -o \
'context="system_u:object_r:tmp_t:s0:c127,c456",noexec'

For more details, see selinux(8).

  • defaults โ€” use the default options: rw, suid, dev, exec, auto, nouser, and async.

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.

  • dev โ€” interpret character or block special devices on the filesystem.
  • nodev โ€” do not interpret character or block special devices on the filesystem.
  • diratime โ€” update directory inode access times on this filesystem. This is the default. (This option is ignored when noatime is set.)
  • nodiratime โ€” do not update directory inode access times on this filesystem. (This option is implied when noatime is set.)
  • dirsync โ€” all directory updates within the filesystem should be done synchronously. This affects the following system calls: creat(2), link(2), unlink(2), symlink(2), mkdir(2), rmdir(2), mknod(2) and rename(2).
  • exec โ€” permit execution of binaries and other executable files.
  • noexec โ€” do not permit direct execution of any binaries on the mounted filesystem.
  • group โ€” allow an ordinary user to mount the filesystem if one of that user's groups matches the group of the device. This option implies the options nosuid and nodev (unless overridden by subsequent options, as in the option line group,dev,suid).
  • iversion โ€” every time the inode is modified, the i_version field will be incremented.
  • noiversion โ€” do not increment the i_version inode field.
  • mand โ€” allow mandatory locks on this filesystem. See fcntl(2). This option was deprecated in Linux 5.15. ๐Ÿ’€
  • nomand โ€” do not allow mandatory locks on this filesystem.
  • _netdev โ€” the filesystem resides on a device that requires network access (used to prevent the system from attempting to mount these filesystems until the network has been enabled on the system).
  • nofail โ€” do not report errors for this device if it does not exist.
  • relatime โ€” update inode access times relative to modify or change time. Access time is only updated if the previous access time was earlier than or equal to the current modify or change time. (Similar to noatime, but it doesn't break mutt(1) or other applications that need to know if a file has been read since the last time it was modified.) ๐Ÿ“

okay so since Linux 2.6.30 the kernel just... defaults to the behavior this option gives you (unless you said noatime, obviously ๐Ÿ’…), and if you want the old-school traditional semantics you gotta go ask for strictatime. Also since Linux 2.6.30, the file's last access time is always updated if it's more than 1 day old. periodt.

  • norelatime โ€” Do not use the relatime feature, bestie. See also the strictatime mount option.
  • strictatime โ€” Lets you explicitly request full atime updates โœจ. This makes it possible for the kernel to default to relatime or noatime but still let userspace override it. Want more deets on the default system mount options? Go read /proc/mounts.
  • nostrictatime โ€” Just use the kernel's default behavior for inode access time updates. let the kernel cook ๐Ÿ“
  • lazytime โ€” Only update times (atime, mtime, ctime) on the in-memory version of the file inode.

This mount option significantly reduces writes to the inode table for workloads that perform frequent random writes to preallocated files. it's giving efficiency, honestly ๐Ÿ”ฅ

The on-disk timestamps are updated only when:

  • the inode needs to be updated for some change unrelated to file timestamps
  • the application employs fsync(2), syncfs(2), or sync(2)
  • an undeleted inode is evicted from memory
  • more than 24 hours have passed since the inode was written to disk.
  • nolazytime โ€” Do not use the lazytime feature. simple as that ๐ŸŽ€
  • suid โ€” Honor set-user-ID and set-group-ID bits or file capabilities when executing programs from this filesystem. respect the bits ๐Ÿ‘‘
  • nosuid โ€” Do not honor set-user-ID and set-group-ID bits or file capabilities when executing programs from this filesystem. In addition, SELinux domain transitions require permission nosuid_transition, which in turn needs also policy capability nnp_nosuid_transition. no cap, that's just how it is ๐Ÿซถ
  • silent โ€” Turn on the silent flag. ๐Ÿคซ
  • loud โ€” Turn off the silent flag. not me being loud ๐Ÿ“ข
  • owner โ€” Allow an ordinary user to mount the filesystem if that user is the owner of the device. This option implies the options nosuid and nodev (unless overridden by subsequent options, as in the option line owner,dev,suid). so you can undo it, just gotta say so later in the line โœจ
  • remount โ€” Attempt to remount an already-mounted filesystem. This is commonly used to change the mount flags for a filesystem, especially to make a readonly filesystem writable. It does not change device or mount point.

The remount operation together with the bind flag has special semantics. See above, the subsection Bind mount operation.

The default kernel behavior for VFS mount flags (nodev,nosuid,noexec,ro) is to reset all unspecified flags on remount. That's why mount(8) tries to keep the current setting according to fstab or /proc/self/mountinfo. This default behavior is possible to change by --options-mode. The recursive change of the mount flags (supported since v2.39 on systems with mount_setattr(2) syscall), for example, mount -o remount,ro=recursive, do not use "reset-unspecified" behavior, and it works as a simple add/remove operation and unspecified flags are not modified. ๐Ÿ’…

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 device and dir are specified.

mount -o remount,rw /dev/foo /dir

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 generated and maintained by the mount command. so watch out, bestie ๐Ÿ˜ญ

mount -o remount,rw /dir

After this call, mount reads fstab and merges these options with the options from the command line (-o). If no mountpoint is found in fstab, then it defaults to mount options from /proc/self/mountinfo.

mount allows the use of --all to remount all already mounted filesystems which match a specified filter (-O and -t). For example:

mount --all -o remount,ro -t vfat

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 mount command reads fstab or mtab and merges these options with the options from the command line.

  • ro[=(recursive|vfs|fs)] โ€” Mount the filesystem read-only. The optional argument is an experimental feature supported only by the file-descriptor based kernel mount API and it is silently ignored for the old mount(2) syscall. ๐Ÿ™ˆ

The recursive argument forces the VFS attribute to be applied recursively.

The vfs and fs arguments specify the layer where the read-only flag should be applied. The fs specifies the filesystem superblock (unique filesystem instance in the kernel), and vfs specifies the mount node. If no attribute is specified, then both layers are set to read-only.

For more details, please refer to the Read-only Setting Notes section.

  • rw[=(recursive|vfs|fs)] โ€” Mount the filesystem read-write. we love a writable era ๐Ÿ’–
  • sync โ€” All I/O to the filesystem should be done synchronously. In the case of media with a limited number of write cycles (e.g. some flash drives), sync may cause life-cycle shortening. โš ๏ธ like it works but it's lowkey burning through your drive's lifespan, no cap
  • 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 same user can unmount the filesystem again. This option implies the options noexec, nosuid, and nodev (unless overridden by subsequent options, as in the option line user,exec,dev,suid). ๐Ÿซถ
  • nouser โ€” Forbid an ordinary user to mount the filesystem. This is the default; it does not imply any other options. sorry bestie, not your turn ๐Ÿ’€
  • users โ€” Allow any user to mount and to unmount the filesystem, even when some other ordinary user mounted it. This option implies the options noexec, nosuid, and nodev (unless overridden by subsequent options, as in the option line users,exec,dev,suid). it's giving communal property โœจ
  • X-* โ€” All options prefixed with "X-" are interpreted as comments or as userspace application-specific options. These options are not stored in user space (e.g., mtab file), nor sent to the mount.type helpers nor to the mount(2) system call. The suggested format is X-appname.option. so they just vibe and vanish ๐Ÿ’จ
  • x-* โ€” The same as X-* options, but stored permanently in user space. This means the options are also available for umount(8) or other operations. Note that maintaining mount options in user space is tricky, because it's necessary to 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 for X-* now), but due to the growing number of use-cases (in initrd, systemd etc.) the functionality has been extended to keep existing fstab configurations usable without a change.

  • X-mount.auto-fstypes=list โ€” Specifies allowed or forbidden filesystem types for automatic filesystem detection.

The list is a comma-separated list of the filesystem names. The automatic filesystem detection is triggered by the "auto" filesystem type or when the filesystem type is not specified.

The list follows how mount evaluates type patterns (see -t for more details). Only specified filesystem types are allowed, or all specified types are forbidden if the list is prefixed by "no".

For example, X-mount.auto-fstypes="ext4,btrfs" accepts only ext4 and btrfs, and X-mount.auto-fstypes="novfat,xfs" accepts all filesystems except vfat and xfs.

Note that comma is used as a separator between mount options, it means that auto-fstypes values have to be properly quoted, don't forget that the shell strips off quotes and thus double quoting is required. For example:
mount -t auto -oโ€™X-mount.auto-fstypes="noext2,ext3"โ€™
/dev/sdc1 /mnt/test
  • X-mount.mkdir[=mode] โ€” Allow to make a target directory (mountpoint) if it does not exist yet. The optional argument mode specifies the filesystem access mode used for mkdir(2) in octal notation. The default mode is 0755. This functionality is supported only for root users or when mount is executed without suid permissions. The option is also supported as x-mount.mkdir, but this notation is deprecated since v2.30. See also --mkdir command line option. ๐Ÿ’…
  • X-mount.nocanonicalize[=type] โ€” Allows disabling of canonicalization for mount source and target paths. By default, the mount command resolves all paths to their absolute paths without symlinks. However, this behavior may not be desired in certain situations, such as when binding a mount over a symlink, or a symlink over a directory or another symlink. The optional argument type can be either "source" or "target" (mountpoint). If no type is specified, then canonicalization is disabled for both types. This mount option does not affect the conversion of source tags (e.g. LABEL= or UUID=) and fstab processing.

The command-line option --no-canonicalize overrides this mount option and affects all path and tag conversions in all situations, but for backward compatibility, it does not modify open_tree(2) syscall flags and does not allow the bind-mount over a symlink use case.

Note that mount(8) ignores this option for unprivileged (non-root) users. In restricted mode symbolic links are not followed in the target path at all, so a mount with a symbolic link in the target fails. Source paths are only canonicalized when starting with /dev/. See section "Non-superuser mounts" above for more details. ๐Ÿ™ˆ
  • X-mount.noloop โ€” Do not create and mount a loop device, even if the source of the mount is a regular file. no loop for you ๐Ÿšซ
  • X-mount.subdir=directory โ€” Allow mounting a subdirectory of a filesystem instead of the root directory. This is effective only when a new instance of a filesystem is attached to the system. The option is silently ignored for operations like remount, bind mount, or move. โœจ

okay so like... how does X-mount.subdir even do that?? Bestie, for now this feature is implemented by a temporary filesystem root-directory mount in an unshared namespace, and then binding the sub-directory to the final mount point and unmounting the root of the filesystem. The sub-directory mount shows up atomically for the rest of the system, even though it's actually implemented by multiple mount(2) syscalls. Sneaky. Iconic. ๐Ÿ’…

โš ๏ธ Heads up though: this feature will not work in a session with an unshared private mount namespace (after unshare --mount) on old kernels, or with mount(8) without support for the file-descriptors-based mount kernel API. In that case, you need unshare --mount --propagation shared. No cap.

For unprivileged (non-root) users, this feature requires Linux >= 6.15, where the subdirectory is opened directly on the detached mount tree.

๐Ÿšจ This feature is EXPERIMENTAL. Like, proceed with the vibe of someone reading the label. ๐Ÿซถ

  • X-mount.owner=username|UID, X-mount.group=group|GID โ€” sets the mountpoint's ownership after mounting. Names get resolved in the target mount namespace, so go peek at -N. โœจ
  • X-mount.mode=mode โ€” sets the mountpoint's mode after mounting. Cute, simple, done.
  • X-mount.idmap=type:inner:outer:range [type:inner:outer:range], X-mount.idmap=file โ€” use this one to create an idmapped mount. This feature requires the new file-descriptor-based mount API (available since Linux 5.2). An idmapped mount allows the ownership of all files located under a mount to be changed according to the ID-mapping associated with a user namespace. The ownership change is tied to the lifetime of, and localized to, the relevant mount. You can specify that relevant ID-mapping in two ways:
    • A user can specify the ID-mapping directly. The ID-mapping must be specified using the syntax type:inner:outer:range. Specifying u as the type prefix creates a UID-mapping, g creates a GID-mapping, and omitting type or specifying b creates both a UID- and GID-mapping. The inner and outer IDs are given in the same order as in /proc/[pid]/uid_map (see user_namespaces(7)) and for --map-users above. For an idmapped mount this means that inner is the starting ID as stored in the filesystem, and outer is the starting ID as it appears in the new mount. The range parameter indicates how many IDs are to be mapped. It is possible to specify multiple ID-mappings.

The individual ID mappings must be separated by spaces. Please note that in the /etc/fstab file, spaces are interpreted as separators between fields. To avoid this, you must escape them using \040. For example, X-mount.idmap=0:0:1\040500:1000:1.

For example, the ID-mapping X-mount.idmap=u:1000:0:1 g:1001:1:2 5000:1000:2 creates an idmapped mount where a file owned by UID 1000 in the filesystem appears as owned by UID 0 in the mount, GID 1001 appears as GID 1, GID 1002 appears as GID 2, UID and GID 5000 appear as 1000, and UID and GID 5001 appear as 1001. ๐Ÿง โœจ

When an ID-mapping is specified directly, a new user namespace will be allocated with the requested ID-mapping. The newly created user namespace will be attached to the mount.

  • A user can specify a user namespace file. The user namespace will then be attached to the mount, and the ID-mapping of the user namespace will become the ID-mapping of the mount.

For example, X-mount.idmap=/proc/PID/ns/user will attach the user namespace of the process PID to the mount.

  • nosymfollow โ€” do not follow symlinks when resolving paths. Symlinks can still be created, and readlink(1), readlink(2), realpath(1), and realpath(3) all still work properly. So like, symlinks aren't gone, they're just not being chased. ๐Ÿฆ‹

๐ŸŒˆ 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. ๐Ÿ‘‘

Note that some of the pages listed above might be available only after you install the respective userland tools. (so if a page is missing, it's not you, it's the install)

The following options apply only to certain filesystems. We sort them by filesystem. All options follow the -o flag.

What options are supported depends a bit on the running kernel. Further information may be available in filesystem-specific files in the kernel source subdirectory Documentation/filesystems.


๐Ÿ“ Mount options for adfs

  • uid=value and gid=value โ€” set the owner and group of the files in the filesystem (default: uid=gid=0).
  • ownmask=value and othmask=value โ€” set the permission mask for ADFS 'owner' permissions and 'other' permissions, respectively (default: 0700 and 0077, respectively). See also /usr/src/linux/Documentation/filesystems/adfs.rst.

๐ŸŽ€ Mount options for affs

  • uid=value and gid=value โ€” set the owner and group of the root of the filesystem (default: uid=gid=0, but with option uid or gid without specified value, the UID and GID of the current process are taken).
  • setuid=value and setgid=value โ€” set the owner and group of all files.
  • mode=value โ€” set the mode of all files to value & 0777 disregarding the original permissions. Add search permission to directories that have read permission. The value is given in octal.
  • protect โ€” do not allow any changes to the protection bits on the filesystem. Hands off, periodt. ๐Ÿ™…โ€โ™€๏ธ
  • usemp โ€” set UID and GID of the root of the filesystem to the UID and GID of the mount point upon the first sync or umount, and then clear this option. Strange... (and yes, the manpage literally says "Strange..." bestie, we don't make the rules)
  • verbose โ€” print an informational message for each successful mount.
  • prefix=string โ€” prefix used before volume name, when following a link.
  • volume=string โ€” prefix (of length at most 30) used before '/' when following a symbolic link.
  • reserved=value โ€” (Default: 2.) Number of unused blocks at the start of the device.
  • root=value โ€” give explicitly the location of the root block.
  • bs=value โ€” give blocksize. Allowed values are 512, 1024, 2048, 4096.
  • grpquota|noquota|quota|usrquota โ€” these options are accepted but ignored. (However, quota utilities may react to such strings in /etc/fstab.) So they're just... there. Vibing. ๐Ÿ’€

๐Ÿงš Mount options for debugfs

The debugfs filesystem is a pseudo filesystem, traditionally mounted on /sys/kernel/debug. As of kernel version 3.4, debugfs has the following options:

  • uid=n, gid=n โ€” set the owner and group of the mountpoint.
  • mode=value โ€” sets the mode of the mountpoint.

๐Ÿ’œ Mount options for devpts

The devpts filesystem is a pseudo filesystem, traditionally mounted on /dev/pts. In order to acquire a pseudo terminal, a process opens /dev/ptmx; the number of the pseudo terminal is then made available to the process and the pseudo terminal slave can be accessed as /dev/pts/<number>.

  • uid=value and gid=value โ€” 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 gid=5 will cause newly created pseudo terminals to belong to the tty group.
  • mode=value โ€” set the mode of newly created pseudo terminals to the specified value. The default is 0600. A value of mode=620 and gid=5 makes "mesg y" the default on newly created pseudo terminals.
  • newinstance โ€” 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 newinstance option share the same set of pseudo terminal indices (i.e., legacy mode). Each mount of devpts with the newinstance 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 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, /dev/ptmx must be a symbolic link to pts/ptmx. See Documentation/filesystems/devpts.txt in the Linux kernel source tree for details.

  • ptmxmode=value โ€” set the mode for the new ptmx device node in the devpts filesystem.

With the support for multiple instances of devpts (see newinstance option above), each instance has a private ptmx node in the root of the devpts filesystem (typically /dev/pts/ptmx).

For compatibility with older versions of the kernel, the default mode of the new ptmx node is 0000. ptmxmode=value specifies a more useful mode for the ptmx node and is highly recommended when the newinstance option is specified. ๐Ÿ”ฅ

This option is only implemented in Linux kernel versions starting with 2.6.29. Also? It's only valid if CONFIG_DEVPTS_MULTIPLE_INSTANCES is enabled in the kernel config. That's the whole vibe check, bestie. โœจ


๐Ÿฉ Mount options for fat ๐Ÿ’–

Real talk: fat is not a separate filesystem, it's just a common part shared by the msdos, umsdos and vfat filesystems. Same DNA, different lewks.
  • blocksize={512|1024|2048} โ€” sets the blocksize (default is 512). Ngl this option is obsolete ๐Ÿ’€
  • uid=value and gid=value โ€” sets the owner and group of all the files. (Default: the UID and GID of the current process, i.e. whoever's running this.)
  • umask=value โ€” sets the umask, which is the bitmask of the permissions that are not present. Default is the umask of the current process. Value goes in octal, no cap.
  • dmask=value โ€” same idea but the umask applies to directories only. Default is the current process's umask, value in octal.
  • fmask=value โ€” umask for regular files only. Default is the current process's umask, value in octal.
  • allow_utime=value โ€” this one controls the permission check for mtime/atime. Possible values are giving:
    • 20 โ€” if the current process is in the group of the file's group ID, you can change the timestamp.
    • 2 โ€” other users can change the timestamp.

The default is set from the above dmask option. (If the directory is writable, utime(2) is also allowed. That is: ~dmask & 022.)

So normally utime(2) checks that the current process owns the file, or that it has the CAP_FOWNER capability. But FAT filesystems don't have UID/GID on disk, so the normal check is too inflexible โ€” this option lets you relax it. ๐Ÿซถ

  • check=value โ€” three different levels of pickiness, choose your fighter:
    • r[elaxed] โ€” upper and lower case are accepted and equivalent, long name parts get truncated (e.g. verylongname.foobar becomes verylong.foo), and leading and embedded spaces are accepted in each name part (name and extension).
    • n[ormal] โ€” like "relaxed", but many special characters (*, ?, <, spaces, etc.) are rejected. This is the default.
    • s[trict] โ€” like "normal", but names that contain long parts or special characters that are sometimes used on Linux but are not accepted by MS-DOS (+, =, etc.) are rejected.
  • codepage=value โ€” sets the codepage for converting to shortname characters on FAT and VFAT filesystems. By default, codepage 437 is used.
  • conv=mode โ€” obsolete and may fail or just be ignored ๐Ÿ™ˆ
  • cvf_format=module โ€” forces the driver to use the CVF (Compressed Volume File) module cvf_module instead of auto-detection. If the kernel supports kmod, the cvf_format=xxx option also controls on-demand CVF module loading. Obsolete.
  • cvf_option=option โ€” an option passed to the CVF module. Also obsolete.
  • debug โ€” turns on the debug flag. A version string and a list of filesystem parameters will be printed. (These data are also printed if the parameters appear to be inconsistent.) ๐Ÿ‘€
  • discard โ€” if set, causes discard/TRIM commands to be issued to the block device when blocks are freed. Lowkey iconic for SSD devices and sparse/thinly-provisioned LUNs. โœจ
  • dos1xfloppy โ€” if set, use a fallback default BIOS Parameter Block configuration, determined by backing device size. These static parameters match defaults assumed by DOS 1.x for 160 kiB, 180 kiB, 320 kiB, and 360 kiB floppies and floppy images. Throwback fr fr ๐ŸŽ€
  • errors={panic|continue|remount-ro} โ€” specify FAT behavior on critical errors: panic ๐Ÿ˜ญ, continue without doing anything, or remount the partition in read-only mode (default behavior).
  • fat={12|16|32} โ€” specify a 12, 16 or 32 bit fat. This overrides the automatic FAT type detection routine. Use with caution! โš ๏ธ
  • iocharset=value โ€” the character set used for converting between 8 bit characters and 16 bit Unicode characters. Default is iso8859-1. Long filenames are stored on disk in Unicode format, periodt.
  • nfs={stale_rw|nostale_ro} โ€” only enable this if you actually want to export the FAT filesystem over NFS.
    • stale_rw: this option maintains an index (cache) of directory inodes which is used by the nfs-related code to improve look-ups. Full file operations (read/write) over NFS are supported but with cache eviction at the NFS server, this could result in spurious ESTALE errors.
    • nostale_ro: this option bases the inode number and file handle on the on-disk location of a file in the FAT directory entry. This ensures that ESTALE will not be returned after a file is evicted from the inode cache. However, it means that operations such as rename, create and unlink could cause file handles that previously pointed at one file to point at a different file, potentially causing data corruption. For this reason, this option also mounts the filesystem readonly.

To maintain backward compatibility, -o nfs is also accepted, defaulting to stale_rw.

  • tz=UTC โ€” this option disables the conversion of timestamps between local time (as used by Windows on FAT) and UTC (which Linux uses internally). Super useful when mounting devices like digital cameras that are set to UTC, so you dodge the pitfalls of local time. ๐Ÿ“ธ
  • time_offset=minutes โ€” sets the offset for conversion of timestamps from local time used by FAT to UTC. I.e., minutes will be subtracted from each timestamp to convert it to UTC used internally by Linux. Handy when the time zone set in the kernel via settimeofday(2) isn't the time zone used by the filesystem. Note that this option still does not provide correct time stamps in all cases in presence of DST โ€” time stamps in a different DST setting will be off by one hour. ๐Ÿ•ฐ๏ธ
  • quiet โ€” turns on the quiet flag. Attempts to chown or chmod files do not return errors, although they fail. Use with caution!
  • rodir โ€” FAT has the ATTR_RO (read-only) attribute. On Windows, the ATTR_RO of the directory will just be ignored, and is used only by applications as a flag (e.g. it's set for the customized folder).

If you want to use ATTR_RO as read-only flag even for the directory, set this option.

  • showexec โ€” if set, the execute permission bits of the file will be allowed only if the extension part of the name is .EXE, .COM, or .BAT. Not set by default.
  • sys_immutable โ€” if set, ATTR_SYS attribute on FAT is handled as IMMUTABLE flag on Linux. Not set by default.
  • flush โ€” if set, the filesystem will try to flush to disk more early than normal. Not set by default.
  • usefree โ€” use the "free clusters" value stored on FSINFO. It'll be used to determine number of free clusters without scanning the disk. But it's not used by default, because recent Windows don't update it correctly in some case. If you're sure the "free clusters" on FSINFO is correct, this option lets you avoid scanning disk. ๐Ÿฆ‹
  • dots, nodots, dotsOK=[yes|no] โ€” various misguided attempts to force Unix or DOS conventions onto a FAT filesystem. ๐Ÿ’€

๐ŸŽ€ Mount options for hfs ๐ŸŒธ

  • creator=cccc, type=cccc โ€” set the creator/type values as shown by the MacOS finder used for creating new files. Default values: '????'.
  • uid=n, gid=n โ€” set the owner and group of all files. (Default: the UID and GID of the current process.)
  • dir_umask=n, file_umask=n, umask=n โ€” set the umask used for all directories, all regular files, or all files and directories. Defaults to the umask of the current process.
  • session=n โ€” select the CDROM session to mount. Defaults to leaving that decision to the CDROM driver. This option will fail with anything but a CDROM as underlying device.
  • part=n โ€” select partition number n from the device. Only makes sense for CDROMs. Defaults to not parsing the partition table at all.
  • quiet โ€” don't complain about invalid mount options. ๐Ÿคซ

๐Ÿ’œ Mount options for hpfs ๐Ÿ‘‘

  • uid=value and gid=value โ€” set the owner and group of all files. (Default: the UID and GID of the current process.)
  • umask=value โ€” set the umask (the bitmask of the permissions that are not present). The default is the umask of the current process. The value is given in octal.
  • case={lower|asis} โ€” convert all files names to lower case, or leave them. (Default: case=lower.)
  • conv=mode โ€” obsolete, may fail or be 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 an 8.3 format (i.e., DOS-like restrictions on filename length), and in addition all characters are in upper case. Also there is no field for file ownership, protection, number of links, provision for block/character devices, etc. ๐Ÿ™ˆ

Rock Ridge is an extension to iso9660 that provides all of these UNIX-like features. Basically there are extensions to each directory record that supply all of the additional information, and when Rock Ridge is in use, the filesystem is indistinguishable from a normal UNIX filesystem (except that it is read-only, of course). Main character energy honestly. ๐Ÿ’…

  • norock โ€” disable the use of Rock Ridge extensions, even if available. Cf. map.
  • nojoliet โ€” disable the use of Microsoft Joliet extensions, even if available. Cf. map.
  • check={r[elaxed]|s[trict]} โ€” with check=relaxed, a filename is first converted to lower case before doing the lookup. This is probably only meaningful together with norock and map=normal. (Default: check=strict.)
  • uid=value and gid=value โ€” give all files in the filesystem the indicated user or group id, possibly overriding the information found in the Rock Ridge extensions. (Default: uid=0,gid=0.)
  • map={n[ormal]|o[ff]|a[corn]} โ€” for non-Rock Ridge volumes, normal name translation maps upper to lower case ASCII, drops a trailing ';1', and converts ';' to '.'. With map=off no name translation is done. See norock. (Default: map=normal.) map=acorn is like map=normal but also apply Acorn extensions if present.
  • mode=value โ€” for non-Rock Ridge volumes, give all files the indicated mode. (Default: read and execute permission for everybody.) Octal mode values require a leading 0.
  • unhide โ€” also shows hidden files and associated files. ๐Ÿซฃ but bestie be careful: if the ordinary files and the associated-or-hidden files have the same filenames, this may make the ordinary files inaccessible. not a vibe.
  • block={512|1024|2048} โ€” sets the block size to the indicated value. default is block=1024 ๐ŸŽ€
  • conv=mode โ€” okay so this option is obsolete and may fail or be ignored. ๐Ÿ’€ it's giving legacy.
  • cruft โ€” if the high byte of the file length contains other garbage, set this mount option to ignore the high order bits of the file length. this implies that a file cannot be larger than 16 MB.
  • session=x โ€” selects the number of the session on a multisession CD, starting with 0.
  • sbsector=xxx โ€” session begins from sector xxx.

the next two are literally the same as for vfat, and specifying them only makes sense when you're using discs encoded using Microsoft's Joliet extensions.

  • iocharset=value โ€” the character set to use for converting 16 bit Unicode characters on CD to 8 bit characters. the default is iso8859-1.
  • utf8 โ€” converts 16 bit Unicode characters on CD to UTF-8. โœจ

๐ŸŒˆ Mount options for jfs

  • iocharset=name โ€” the character set to use for converting from Unicode to ASCII. the default is to do no conversion at all. use iocharset=utf8 for UTF8 translations โ€” but heads up, this requires CONFIG_NLS_UTF8 to be set in the kernel .config file.
  • resize=value โ€” resizes the volume to value blocks. JFS only supports growing a volume, not shrinking it ๐Ÿ‘‘ no takebacks. this option is only valid during a remount, when the volume is mounted read-write. and the resize keyword with no value will grow the volume to the full size of the partition.
  • nointegrity โ€” do not write to the journal. its primary use is to allow for higher performance when restoring a volume from backup media.
the integrity of the volume is not guaranteed if the system abnormally ends. ๐Ÿ˜ญ
  • integrity โ€” default. commits metadata changes to the journal. use this option to remount a volume where the nointegrity option was previously specified, in order to restore normal behavior.
  • errors={continue|remount-ro|panic} โ€” defines the behavior when an error is encountered. either ignore errors and just mark the filesystem erroneous and continue, or remount the filesystem read-only, or panic and halt the system. pick your fighter ๐Ÿ’…
  • noquota|quota|usrquota|grpquota โ€” these options are accepted but ignored ๐Ÿ™ˆ

๐Ÿ“ Mount options for msdos

see the mount options for fat. and 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

just like nfs, the ncpfs implementation expects a binary argument (a struct ncp_mount_data) to the mount(2) system call. this argument is constructed by ncpmount(8), and the current version of mount (2.12) does not know anything about ncpfs. girl it's out of the loop ๐Ÿ˜ญ

๐Ÿ‘‘ Mount options for ntfs3

the ntfs3 kernel driver provides the mount options below โ€” as documented in https://docs.kernel.org/filesystems/ntfs3.html

  • iocharset=name โ€” this option informs the driver how to interpret path strings and translate them to Unicode and back. if this option is not set, the default codepage will be used (CONFIG_NLS_DEFAULT).

Example: iocharset=utf8

  • uid=|gid=|umask= โ€” controls the default permissions for files/directories created after the NTFS volume is mounted.
  • dmask=|fmask= โ€” instead of specifying umask which applies both to files and directories, fmask applies only to files and dmask only to directories.
  • nohidden โ€” files with the Windows-specific HIDDEN (FILE_ATTRIBUTE_HIDDEN) attribute will not be shown under Linux.
  • sys_immutable โ€” files with the Windows-specific SYSTEM (FILE_ATTRIBUTE_SYSTEM) attribute will be marked as system immutable files.
  • hide_dot_files โ€” updates the Windows-specific HIDDEN (FILE_ATTRIBUTE_HIDDEN) attribute when creating and moving or renaming files. files whose names start with a dot will have the HIDDEN attribute set, and files whose names do not start with a dot will have it unset.
  • windows_names โ€” prevents the creation of files and directories with a name not allowed by Windows, either because it contains some not allowed character (which are the characters โ€œ * / : < > ? \ | and those whose code is less than 0x20), because the name (with or without extension) is a reserved file name (CON, AUX, NUL, PRN, LPT1-9, COM1-9), or because the last character is a space or a dot. existing such files can still be read and renamed.
  • discard โ€” enable support of the TRIM command for improved performance on delete operations, which is recommended for use with solid-state drives (SSD). ๐Ÿงš
  • force โ€” forces the driver to mount partitions even if the volume is marked dirty. not recommended for use. โš ๏ธ
  • sparse โ€” create new files as sparse.
  • showmeta โ€” use this parameter to show all meta-files (System Files) on a mounted NTFS partition. by default, all meta-files are hidden.
  • prealloc โ€” preallocate space for files excessively when file size is increasing on writes. decreases fragmentation in case of parallel write operations to different files.
  • acl โ€” support POSIX ACLs (Access Control Lists). effective if supported by Kernel. not to be confused with NTFS ACLs. the option specified as acl enables support for POSIX ACLs.

๐Ÿฆ‹ Mount options for overlay

since Linux 3.18 the overlay pseudo filesystem implements a union mount for other filesystems. iconic behavior honestly.

an overlay filesystem combines two filesystems โ€” an upper filesystem and a lower filesystem. when a name exists in both filesystems, the object in the upper filesystem is visible, while the object in the lower filesystem is either hidden or, in the case of directories, merged with the upper object. main character energy fr fr.

the lower filesystem can be any filesystem supported by Linux and does not need to be writable. the lower filesystem can even be another overlayfs. the upper filesystem will normally be writable, and if it is, it must support the creation of trusted.* extended attributes, and must provide 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:

mount -t overlay  overlay  \
  -olowerdir=/lower,upperdir=/upper,workdir=/work  /merged
  • lowerdir=directory โ€” any filesystem, does not need to be on a writable filesystem.
  • upperdir=directory โ€” the upperdir is normally on a writable filesystem.
  • workdir=directory โ€” the workdir needs to be an empty directory on the same filesystem as upperdir.
  • userxattr โ€” use the "user.overlay." xattr namespace instead of "trusted.overlay.". this is useful for unprivileged mounting of overlayfs. ๐Ÿ’–
  • redirect_dir={on|off|follow|nofollow} โ€” if the redirect_dir feature is enabled, then the directory will be copied up (but not the contents). then the "{trusted|user}.overlay.redirect" extended attribute is set to the path of the original location from the root of the overlay. finally the directory is moved to the new location.
    • on โ€” redirects are enabled.
    • off โ€” redirects are not created and only followed if "redirect_always_follow" feature is enabled in the kernel/module config.
    • follow โ€” redirects are not created, but followed.
    • nofollow โ€” redirects are not created and not followed (equivalent to "redirect_dir=off" if "redirect_always_follow" feature is not enabled).
  • index={on|off} โ€” inode index. if this feature is disabled and a file with multiple hard links is copied up, then this will "break" the link. changes will not be propagated to other names referring to the same inode. ๐Ÿ’€
  • uuid={on|off} โ€” can be used to replace UUID of the underlying filesystem in file handles with null, and effectively disable UUID checks. this can be useful in case the underlying disk is copied and the UUID of this copy is changed. this is only applicable if all lower/upper/work directories are on the same filesystem, otherwise it will fallback to normal behaviour.
  • nfs_export={on|off} โ€” when the underlying filesystems supports NFS export and the "nfs_export" feature is enabled, an overlay filesystem may be exported to NFS.

with the "nfs_export" feature, on copy_up of any lower object, an index entry is created under the index directory. the index entry name is the hexadecimal representation of the copy up origin file handle. for a non-directory object, the index entry is a hard link to the upper inode. for a directory object, the index entry has an extended attribute "{trusted|user}.overlay.upper" with an encoded file handle of the upper directory inode.

when encoding a file handle from an overlay filesystem object, the following rules apply

  • for a non-upper object, encode a lower file handle from lower inode
  • for an indexed object, encode a lower file handle from copy_up origin
  • for a pure-upper object and for an existing non-indexed upper object, encode an upper file handle from upper inode

the encoded overlay file handle includes

  • header including path type information (e.g. lower/upper)
  • UUID of the underlying filesystem
  • underlying filesystem encoding of underlying inode

this encoding format is identical to the encoding format of file handles that are stored in extended attribute "{trusted|user}.overlay.origin". when decoding an overlay file handle, the following steps are followed

  • find underlying layer by UUID and path type information.
  • decode the underlying filesystem file handle to underlying dentry.
  • for a lower file handle, lookup the handle in index directory by name.
  • if a whiteout is found in index, return ESTALE. this represents an overlay object that was deleted after its file handle was encoded.
  • for a non-directory, instantiate a disconnected overlay dentry from the decoded underlying dentry, the path type and index inode, if found.
  • for a directory, use the connected underlying decoded dentry, path type and index, to lookup a connected overlay dentry.

Decoding a non-directory file handle may return a disconnected dentry. And copy_up of that disconnected dentry will create an upper index entry with no upper alias. It's giving chaos, honestly. ๐Ÿ’€

When the overlay filesystem has multiple lower layers, a middle layer directory may have a "redirect" to a lower directory. Because middle layer "redirects" are not indexed, a lower file handle that was encoded from the "redirect" origin directory cannot be used to find the middle or upper layer directory. Similarly, a lower file handle that was encoded from a descendant of the "redirect" origin directory cannot be used to reconstruct a connected overlay path. To mitigate the cases of directories that cannot be decoded from a lower file handle, these directories are copied up on encode and encoded as an upper file handle. On an overlay filesystem with no upper layer, this mitigation cannot be used โ€” NFS export in this setup requires turning off redirect follow (e.g. "redirect_dir=nofollow").

The overlay filesystem does not support non-directory connectable file handles, so exporting with the subtree_check exportfs configuration will cause failures to lookup files over NFS. ๐Ÿ™ˆ

When the NFS export feature is enabled, all directory index entries are verified on mount time to check that upper file handles are not stale. This verification may cause significant overhead in some cases. Ngl, it's a lot.

Note: the mount options index=off,nfs_export=on are conflicting for a read-write mount and will result in an error.
  • xino={on|off|auto} โ€” the "xino" feature composes a unique object identifier from the real object st_ino and an underlying fsid index. It uses the high inode number bits for fsid, because the underlying filesystems rarely use the high inode number bits. In case the underlying inode number does overflow into the high xino bits, the overlay filesystem will fall back to the non-xino behavior for that inode. For a detailed description of the effect of this option, please refer to https://docs.kernel.org/filesystems/overlayfs.html
  • metacopy={on|off} โ€” when the metadata only copy up feature is enabled, overlayfs will only copy up metadata (as opposed to the whole file) when a metadata-specific operation like chown/chmod is performed. The full file will be copied up later, when the file is opened for a WRITE operation. In other words: this is a delayed data copy up operation, and data is copied up when there is a need to actually modify data.
  • volatile โ€” volatile mounts are not guaranteed to survive a crash. It is strongly recommended that volatile mounts are only used if the data written to the overlay can be recreated without significant effort.

The advantage of mounting with the "volatile" option is that all forms of sync calls to the upper filesystem are omitted.

In order to avoid giving a false sense of safety, the syncfs (and fsync) semantics of volatile mounts are slightly different than that of the rest of VFS. If any writeback error occurs on the upperdir's filesystem after a volatile mount takes place, all sync functions will return an error. Once this condition is reached, the filesystem will not recover, and every subsequent sync call will return an error, even if the upperdir has not experienced a new error since the last sync call.

When overlay is mounted with the "volatile" option, the directory $workdir/work/incompat/volatile is created. During the next mount, overlay checks for this directory and refuses to mount if present. This is a strong indicator that the user should throw away the upper and work directories and create a fresh one. In very limited cases where the user knows that the system has not crashed and the contents of upperdir are intact, the "volatile" directory can be removed.


๐ŸŽ€ Mount options for reiserfs ๐ŸŽ€

Reiserfs is a journaling filesystem. Periodt.

  • conv โ€” instructs version 3.6 reiserfs software to mount a version 3.5 filesystem, using the 3.6 format for newly created objects. Heads up: this filesystem will no longer be compatible with reiserfs 3.5 tools.
  • hash={rupasov|tea|r5|detect} โ€” choose which hash function reiserfs will use to find files within directories.
    • rupasov โ€” a hash invented by Yury Yu. Rupasov. It is fast and preserves locality, mapping lexicographically close file names to close hash values. This option should not be used, as it causes a high probability of hash collisions.
    • tea โ€” a Davis-Meyer function implemented by Jeremy Fitzhardinge. It uses hash permuting bits in the name. It gets high randomness and, therefore, low probability of hash collisions at some CPU cost. This may be used if EHASHCOLLISION errors are experienced with the r5 hash.
    • r5 โ€” a modified version of the rupasov hash. It is used by default and is the best choice unless the filesystem has huge directories and unusual file-name patterns.
    • detect โ€” instructs mount to detect which hash function is in use by examining the filesystem being mounted, and to write this information into the reiserfs superblock. This is only useful on the first mount of an old format filesystem.
  • hashed_relocation โ€” tunes the block allocator. This may provide performance improvements in some situations.
  • no_unhashed_relocation โ€” tunes the block allocator. This may provide performance improvements in some situations.
  • noborder โ€” disable the border allocator algorithm invented by Yury Yu. Rupasov. This may provide performance improvements in some situations.
  • nolog โ€” disable journaling. This will provide slight performance improvements in some situations, at the cost of losing reiserfs's fast recovery from crashes. Even with this option turned on, reiserfs still performs all journaling operations, save for actual writes into its journaling area. Implementation of nolog is a work in progress.
  • notail โ€” by default, reiserfs stores small files and 'file tails' directly into its tree. This confuses some utilities such as lilo(8). This option is used to disable packing of files into the tree.
  • replayonly โ€” replay the transactions which are in the journal, but do not actually mount the filesystem. Mainly used by reiserfsck.
  • resize=number โ€” a remount option which permits online expansion of reiserfs partitions. Instructs reiserfs to assume that the device has number blocks. This option is designed for use with devices which are under logical volume management (LVM). There is a special resizer utility which can be obtained from ftp://ftp.namesys.com/pub/reiserfsprogs.
  • user_xattr โ€” enable Extended User Attributes. See the attr(1) manual page.
  • acl โ€” enable POSIX Access Control Lists. See the acl(5) manual page.
  • barrier=none / barrier=flush โ€” this disables / enables the use of write barriers in the journaling code. barrier=none disables, barrier=flush enables (default). This also requires an IO stack which can support barriers, and if reiserfs gets an error on a barrier write, it will disable barriers again with a warning. Write barriers enforce proper on-disk ordering of journal commits, making volatile disk write caches safe to use, at some performance penalty. If your disks are battery-backed in one way or another, disabling barriers may safely improve performance.

๐ŸŒธ Mount options for 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

  • ubiX_Y โ€” UBI device number X, volume number Y
  • 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

Alternative ! separator may be used instead of :.

The following mount options are available:

  • bulk_read โ€” 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.
  • no_bulk_read โ€” do not bulk-read. This is the default.
  • chk_data_crc โ€” check data CRC-32 checksums. This is the default.
  • no_chk_data_crc โ€” do not check data CRC-32 checksums. With this option, the filesystem does not check CRC-32 checksum for data, but it does check it for the internal indexing information. This option only affects reading, not writing. CRC-32 is always calculated when writing the data.
  • compr={none|lzo|zlib} โ€” select the default compressor which is used when new files are written. It is still possible to read compressed files if mounted with the none option.

๐Ÿฆ‹ Mount options for udf ๐Ÿฆ‹

UDF is the "Universal Disk Format" filesystem defined by OSTA, the Optical Storage Technology Association, and is often used for DVD-ROM, frequently in the form of a hybrid UDF/ISO-9660 filesystem. It is, however, perfectly usable by itself on disk drives, flash drives and other block devices. See also iso9660.

  • uid= โ€” make all files in the filesystem belong to the given user. 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. The value is given as either <user> which is a valid user name or the corresponding decimal user id, or the special string "forget".
  • gid= โ€” make all files in the filesystem belong to the given group. 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. The value is given as either <group> which is a valid group name or the corresponding decimal group id, or the special string "forget".
  • umask= โ€” mask out the given permissions from all inodes read from the filesystem. The value is given in octal.
  • mode= โ€” if mode= is set the permissions of all non-directory inodes read from the filesystem will be set to the given mode. The value is given in octal.
  • dmode= โ€” sets the permissions of every single directory inode that gets read off the filesystem to whatever you hand it. Value goes in octal, bestie, don't forget.
  • bs= โ€” sets the block size, and the story here is a whole saga:
    • before kernel version 2.6.30 the default was 2048
    • from 2.6.30 up until 4.11 it was the logical device block size, falling back to 2048
    • since 4.11 it's the logical block size, falling back to any valid block size between the logical device block size and 4096

For the other details, go read the mkudffs(8) 2.0+ manpage โ€” specifically the COMPATIBILITY and BLOCK SIZE sections. ๐Ÿซถ

  • unhide โ€” show files that are otherwise hidden. ๐Ÿ‘€
  • undelete โ€” show deleted files in lists. yes, ghosts. ๐Ÿซง
  • adinicb โ€” embed data in the inode. (this is the default)
  • noadinicb โ€” do not embed data in the inode.
  • shortad โ€” use short UDF address descriptors.
  • longad โ€” use long UDF address descriptors. (default)
  • nostrict โ€” unset strict conformance. rebel behaviour, love that.
  • iocharset= โ€” set the NLS character set. This one requires a kernel compiled with the CONFIG_UDF_NLS option, no cap.
  • utf8 โ€” set the UTF-8 character set. โœจ

๐Ÿš‘ Mount options for debugging and disaster recovery ๐Ÿš‘

  • novrs โ€” ignore the Volume Recognition Sequence and attempt to mount anyway. chaotic but sometimes it's the move. ๐Ÿ’…
  • session= โ€” pick the session number for multi-session recorded optical media. (default = last session)
  • anchor= โ€” override the standard anchor location. (default = 256)
  • lastblock= โ€” set the last block of the filesystem.

๐Ÿ’€ Unused historical mount options that may be encountered and should be removed ๐Ÿ’€

These are the ghosts in your config. If you see them, they should be removed. periodt.
  • 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 ๐ŸŒˆ

  • ufstype=value โ€” okay so UFS is a filesystem that's widely used across a bunch of different operating systems, and the whole problem is that the implementations all differ from each other. Some of their features aren't even documented, so recognizing the ufs type automatically is genuinely hard. That's why you have to specify the type yourself with this mount option. Possible values are:
    • old โ€” old format of ufs. this is the default, and it's read only. (don't forget to give the -r option!) ๐Ÿซ 
    • 44bsd โ€” for filesystems created by a BSD-like system (NetBSD, FreeBSD, OpenBSD).
    • ufs2 โ€” used in FreeBSD 5.x, supported as read-write.
    • 5xbsd โ€” synonym for ufs2.
    • sun โ€” for filesystems created by SunOS or Solaris on Sparc.
    • sunx86 โ€” for filesystems created by Solaris on x86.
    • hp โ€” for filesystems created by HP-UX, read-only.
    • nextstep โ€” for filesystems created by NeXTStep (on NeXT station) โ€” currently read only.
    • nextstep-cd โ€” for NextStep CDROMs (block_size == 2048), read-only.
    • openstep โ€” for filesystems created by OpenStep (currently read only). the same filesystem type is also used by macOS. ๐ŸŽ
  • onerror=value โ€” set the behaviour on error:
    • panic โ€” if an error is encountered, cause a kernel panic. ๐Ÿ’€ iconic of it honestly.
    • lock|umount|repair โ€” these mount options don't do anything at present; when an error is encountered only a console message is printed.

๐Ÿงš Mount options for umsdos ๐Ÿงš

See the mount options for msdos. The dotsOK option is explicitly killed by umsdos. ๐Ÿ’…

๐Ÿ“ Mount options for vfat ๐Ÿ“

First of all, the mount options for fat are recognized. The dotsOK option is explicitly killed by vfat. Furthermore, there are:

  • uni_xlate โ€” translate unhandled Unicode characters into special escaped sequences. This lets you backup and restore filenames that are created with any Unicode characters. Without this option, a '?' is used when no translation is possible. The escape character is ':' because it is otherwise invalid on the vfat filesystem. The escape sequence that gets used, where u is the Unicode character, is: ':', (u & 0x3f), ((u>>6) & 0x3f), (u>>12).
  • posix โ€” allow two files with names that only differ in case. this option is obsolete.
  • nonumtail โ€” first try to make a short name without a sequence number, before trying name~num.ext.
  • utf8 โ€” UTF8 is the filesystem-safe 8-bit encoding of Unicode that's used by the console. It can be enabled for the filesystem with this option, or disabled with utf8=0, utf8=no or utf8=false. If uni_xlate gets set, UTF8 gets disabled.
  • shortname=mode โ€” defines the behaviour for creation and display of filenames that fit into 8.3 characters. If a long name for a file exists, it will always be the preferred one for display. There are four modes:
    • lower โ€” force the short name to lower case upon display; store a long name when the short name is not all upper case.
    • win95 โ€” force the short name to upper case upon display; store a long name when the short name is not all upper case.
    • winnt โ€” display the short name as is; store a long name when the short name is not all lower case or all upper case.
    • mixed โ€” display the short name as is; store a long name when the short name is not all upper case. this mode is the default since Linux 2.6.32.

๐ŸŽ€ Mount options for usbfs ๐ŸŽ€

  • devuid=uid and devgid=gid and devmode=mode โ€” set the owner and group and mode of the device files in the usbfs filesystem (default: uid=gid=0, mode=0644). The mode is given in octal.
  • busuid=uid and busgid=gid and busmode=mode โ€” set the owner and group and mode of the bus directories in the usbfs filesystem (default: uid=gid=0, mode=0555). The mode is given in octal.
  • listuid=uid and listgid=gid and listmode=mode โ€” set the owner and group and mode of the file devices (default: uid=gid=0, mode=0444). The mode is given in octal.

๐Ÿ‘‘ DM-VERITY SUPPORT ๐Ÿ‘‘

The device-mapper verity target provides read-only transparent integrity checking of block devices using the kernel crypto API. The mount command can open the dm-verity device and do the integrity verification before the device filesystem is mounted. Requires libcryptsetup within libmount (optionally via dlopen(3)). 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:

  • verity.hashdevice=path โ€” path to the hash tree device associated with the source volume, to pass to dm-verity.
  • verity.roothash=hex โ€” hex-encoded hash of the root of verity.hashdevice. Mutually exclusive with verity.roothashfile.
  • verity.roothashfile=path โ€” path to a file containing the hex-encoded hash of the root of verity.hashdevice. Mutually exclusive with verity.roothash.
  • verity.hashoffset=offset โ€” if the hash tree device is embedded in the source volume, offset (default: 0) is used by dm-verity to get to the tree.
  • verity.fecdevice=path โ€” path to the Forward Error Correction (FEC) device associated with the source volume, to pass to dm-verity. Optional. Requires a kernel built with CONFIG_DM_VERITY_FEC.
  • verity.fecoffset=offset โ€” if the FEC device is embedded in the source volume, offset (default: 0) is used by dm-verity to get to the FEC area. Optional.
  • verity.fecroots=value โ€” parity bytes for FEC (default: 2). Optional.
  • verity.roothashsig=path โ€” path to pkcs7(1ssl) signature of root hash hex string. Requires crypt_activate_by_signed_key() from cryptsetup and a 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.
  • verity.oncorruption={ignore|restart|panic} โ€” instruct the kernel to ignore, reboot or panic when corruption is detected. By default the I/O operation simply fails. Requires Linux 4.1 or newer, and libcrypsetup 2.3.4 or newer. Optional.
Supported since util-linux v2.35.

For example, the commands:

    mksquashfs /etc /tmp/etc.raw
    veritysetup format /tmp/etc.raw /tmp/etc.verity --root-hash-file=/tmp/etc.roothash
    openssl smime -sign -in /tmp/etc.roothash -nocerts -inkey private.key \
    -signer private.crt -noattr -binary -outform der -out /tmp/etc.roothash.p7s
    mount -o verity.hashdevice=/tmp/etc.verity,verity.roothashfile=/tmp/etc.roothash,\
    verity.roothashsig=/tmp/etc.roothash.p7s /tmp/etc.raw /mnt

create a squashfs image from /etc directory, a verity hash device, and mount the 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. ๐Ÿ”ฅ


๐Ÿ” LOOP-DEVICE SUPPORT ๐Ÿ”

One further possible type is a mount via the loop device. For example, the command

   mount /tmp/disk.img /mnt -t vfat -o loop=/dev/loop3

will set up the loop device /dev/loop3 to correspond to the file /tmp/disk.img, and then mount this device on /mnt.

If no explicit loop device is mentioned (but just an option -o loop is given), then mount will try to find some unused loop device and use that, for example

   mount /tmp/disk.img /mnt -o loop

The mount command automatically creates a loop device from a regular file if a filesystem type is not specified, or the filesystem is known to libblkid, for example:

   mount /tmp/disk.img /mnt

   mount -t ext4 /tmp/disk.img /mnt

This type of mount knows about three options, namely loop, offset and sizelimit, that are really options to losetup(8). (These options can be used in addition to those specific to the filesystem type.)

Since Linux 2.6.25 auto-destruction of loop devices is supported, meaning that any loop device allocated by mount will be freed by umount independently of /etc/mtab. ๐Ÿงน

You can also free a loop device by hand, using losetup -d or umount -d.

Since util-linux v2.29, 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. ๐Ÿซถ

๐Ÿ’… EXIT STATUS ๐Ÿ’…

okay so when mount dips out, it tells you why through these numbers, and the bits can be ORed together, so sometimes you get a combo deal:

  • 0 โ€” slay. success. we ate.
  • 1 โ€” incorrect invocation or permissions. you said it weird, or you're not allowed ๐Ÿ’€
  • 2 โ€” system error (out of memory, cannot fork, no more loop devices). the machine itself is going through it ๐Ÿ˜ญ
  • 4 โ€” internal mount bug. not you bestie, it's giving "the code is the problem"
  • 8 โ€” user interrupt. you hit Ctrl-C, iconic of you
  • 16 โ€” problems writing or locking /etc/mtab. the table said no ๐Ÿ™ˆ
  • 32 โ€” mount failure. it simply did not work
  • 64 โ€” some mount succeeded. partial win, we take those โœจ

and a lil special case for the multitaskers: the command mount -a returns 0 (all succeeded), 32 (all failed), or 64 (some failed, some succeeded).

  • 126 โ€” failed to execute external /sbin/mount.<type> mount helper (since util-linux v2.41). ngl this one's new-new ๐Ÿ†•

๐Ÿงš EXTERNAL HELPERS ๐Ÿงš

the syntax of external mount helpers is literally this, character for character:

/sbin/mount.suffix spec dir [-sfnv] [-N namespace] [-o options] [-t
type.subtype]

where the suffix is the filesystem type, and the -sfnvoN options mean exactly what the normal mount options mean. the -t option is there for filesystems with subtypes support (for example /sbin/mount.fuse -t fuse.sshfs).

now here's the tea: the command mount does not pass the mount options unbindable, runbindable, private, rprivate, slave, rslave, shared, rshared, auto, noauto, comment, x-*, loop, offset and sizelimit to the mount.<suffix> helpers. all the other options get used in a comma-separated list as an argument to the -o option.

the exit status value of the helper is returned as the exit status of mount(8). the value 126 is sed if the mount helper program is found, but the execl() failed.


๐ŸŒˆ ENVIRONMENT ๐ŸŒˆ

  • LIBMOUNT_FORCE_MOUNT2={always|never|auto} โ€” force it to use the classic mount(2) system call (this requires support for the new file descriptors based mount API). default is auto; in that case, libmount tries to be smart and use classic mount(2) only for well-known issues. if the new mount API is unavailable, libmount can still use traditional mount(2), even though LIBMOUNT_FORCE_MOUNT2 is set to never.
  • LIBMOUNT_FSTAB=<path> โ€” overrides the default location of the fstab file (ignored for suid)
  • LIBMOUNT_DEBUG=all โ€” enables libmount debug output
  • LIBBLKID_DEBUG=all โ€” enables libblkid debug output
  • LOOPDEV_DEBUG=all โ€” enables loop device setup debug output

๐ŸŽ€ FILES ๐ŸŽ€

also check out the "The files /etc/fstab, /etc/mtab and /proc/mounts" section above, it's right there bestie.

  • /etc/fstab โ€” filesystem table
  • /run/mount โ€” libmount private runtime directory
  • /etc/mtab โ€” table of mounted filesystems or symlink to /proc/mounts
  • /etc/mtab~ โ€” lock file (unused on systems with mtab symlink)
  • /etc/mtab.tmp โ€” temporary file (unused on systems with mtab symlink)
  • /etc/filesystems โ€” a list of filesystem types to try

๐Ÿ“œ HISTORY ๐Ÿ“œ

a mount command existed in Version 5 AT&T UNIX. so like, ancient. vintage. the original influencer ๐Ÿซถ


๐Ÿ’€ BUGS ๐Ÿ’€

okay bestie, sit down, this is the "here be dragons" part:

  • it is possible for a corrupted filesystem to cause a crash. yes, fr fr.
  • some Linux filesystems don't support -o sync and -o dirsync (the ext2, ext3, ext4, fat and vfat filesystems do support synchronous updates (a la BSD) when mounted with the sync option).
  • the -o remount may not be able to change mount parameters (all ext2fs-specific parameters, except sb, are changeable with a remount, for example, but you can't change gid or umask for the fatfs).
  • it is possible that 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/mount 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 the kernel even if the noac mount option is used.
  • the loop option with the offset or sizelimit options used may fail when using older kernels if the mount command can't confirm that the size of the block device has been configured as requested. this situation can be worked around by using the losetup(8) command manually before calling mount with the configured loop device.
none of these are cute. all of these are real. respect the caveats ๐Ÿ’…

๐Ÿ‘‘ AUTHORS ๐Ÿ‘‘

Karel Zak <kzak@redhat.com>


๐Ÿ”ฅ SEE ALSO ๐Ÿ”ฅ

mount(2), umount(2), filesystems(5), fstab(5), nfs(5), xfs(5), mount_namespaces(7), xattr(7), e2label(8), findmnt(8), losetup(8), lsblk(8), mke2fs(8), mountd(8), nfsd(8), swapon(8), tune2fs(8), umount(8), xfs_admin(8)


๐Ÿ› REPORTING BUGS ๐Ÿ›

for bug reports, use the issue tracker <https://github.com/util-linux/util-linux/issues>. they will read it, no cap.


โญ AVAILABILITY โญ

the mount command is part of the util-linux package which can be downloaded from Linux Kernel Archive <https://www.kernel.org/pub/linux/utils/util-linux/>.


and that's a wrap on the whole page, bestie ๐ŸŽ€ this was util-linux 2.42.4, dated 2026-09-21, and it's the MOUNT(8) manual page โ€” you just read the entire thing and honestly? main character energy. go mount something responsibly ๐Ÿ’–โœจ๐Ÿฆ‹

๐Ÿ“ฆ where this page comes from
  • arch rolling: util-linux 2.42.4-1 ยท BSD-2-Clause AND BSD-3-Clause AND BSD-4-Clause-UC AND GPL-2.0-only AND GPL-2.0-or-later AND GPL-3.0-or-later AND ISC AND LGPL-2.1-or-later AND LicenseRef-PublicDomain
  • ๐Ÿ’– girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms