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
mountuses UUIDs as strings. the UUIDs from the command line or fromfstab(5)are not converted to internal binary representation. the string representation of the UUID should be based on lower case characters.
- note that
PARTLABEL=labelโ human readable partition identifier. this identifier is independent on filesystem and does not change bymkfsormkswapoperations. 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 bymkfsormkswapoperations. it's supported for example for GUID Partition Tables (GPT). ๐ID=idโ hardware block device ID as generated byudevd. this identifier is usually based on WWN (unique storage identifier) and assigned by the hardware manufacturer. seels /dev/disk/by-idfor more details โ this directory and runningudevdis 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 infstab(except for those whose line contains thenoautokeyword). This option was originally designed for use in init scripts. Note that many modern systemd-based distributions do not usemount -aon 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. Themountcommand automatically canonicalizes all paths (from the command line orfstab). This option can be used in conjunction with the-fflag for paths that are already canonicalized. This option is intended for mount helpers that callmount -i. It is highly recommended to not use this command-line option for regular mount operations ๐ฉ. See also theX-mount.nocanonicalizemount 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 ofmountfor 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/usrand/usr/spool. ๐-f,--fakeโ does literally everything except the mount-related system calls. Bestie, the tea:--fakewas originally designed to write an entry to/etc/mtabwithout 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.filesystemhelper, even if it exists. Not even a little. โ-L,--labellabel โ mounts the partition that has the specified label. ๐ท๏ธ-l,--show-labelsโ adds the labels into the mount output. For this to work,mountneeds permission to read the disk device (like, be set-user-ID root, iykyk). You can set a label forext2,ext3orext4with thee2label(8)utility, or for XFS withxfs_admin(8), or for reiserfs withreiserfstune(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 is0755. More details down atX-mount.mkdir. ๐--map-groups,--map-usersinner:outer:count โ adds the specified user/group mapping to anX-mount.idmapmap. 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 atX-mount.idmapbelow. ๐บ๏ธ--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 atX-mount.idmap. ๐-n,--no-mtabโ mounts without writing to/etc/mtab. This is necessary, for example, when/etcis on a read-only filesystem. ๐ซ๐-N,--namespacens โ 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-optsopts โ limits the set of filesystems that-aapplies to. In that regard it's like-t, except-Ois 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,--optionsopts โ 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 themountcommand 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-modemode โ controls how options fromfstab/mtabget combined with options from the command line. mode can be one ofignore,append,prependorreplace. For example,appendmeans options from fstab are appended to options from the command line. The default value isprependโ meaning command line options are evaluated after fstab options. And remember: the last option wins if there are conflicting ones. โ๏ธ--options-sourcesource โ the source of default options. source is a comma-separated list offstab,mtabanddisable.disabledisablesfstabandmtaband enables--options-source-force. The default value isfstab,mtab. ๐--options-source-forceโ uses options fromfstab/mtabeven 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 themount.nfsmount helper only. ๐คทโ๏ธ--sourcedevice โ if only one argument for themountcommand 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. ๐--targetdirectory โ same situation: one argument, could be target or source. This option lets you explicitly define that the argument is the mount target. ๐ฏ--target-prefixdirectory โ 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,--fstabpath โ specifies an alternative fstab file. If path is a directory, then the files in the directory are sorted bystrverscmp(3); files that start with.or don't have an.fstabextension 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,--typesfstype โ the argument after-ttells it the filesystem type. Which filesystem types are currently supported depends on the running kernel. See/proc/filesystemsand/lib/modules/$(uname -r)/kernel/fsfor a complete list of the filesystems. The most common ones areext2,ext3,ext4,xfs,btrfs,vfat,sysfs,proc,nfsandcifs. ๐
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,--uuiduuid โ mount the partition that has the specified uuid.-v,--verboseโ turns on verbose mode. Starting from version2.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 themountdefault is to try read-only if the previousmount(2)syscall with read-write flags on write-protected devices failed.
A synonym is -o rw.
Note that specifying-won the command line forcesmountto 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 thesyncoption.)atimeโ do not use thenoatimefeature, so the inode access time is controlled by kernel defaults. See also the descriptions of therelatimeandstrictatimemount 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 impliesnodiratime.autoโ can be mounted with the-aoption.noautoโ can only be mounted explicitly (i.e., the-aoption will not cause the filesystem to be mounted).context=context,fscontext=context,defcontext=context, androotcontext=context โ thecontext=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 usecontext=on filesystems you don't trust, such as a floppy. It also helps with compatibility with xattr-supporting filesystems on earlier2.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: thecontextvalue might contain commas, in which case the value has to be properly quoted, otherwisemountwill 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, andasync.
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 whennoatimeis set.)nodiratimeโ do not update directory inode access times on this filesystem. (This option is implied whennoatimeis 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)andrename(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 optionsnosuidandnodev(unless overridden by subsequent options, as in the option linegroup,dev,suid).iversionโ every time the inode is modified, thei_versionfield will be incremented.noiversionโ do not increment thei_versioninode field.mandโ allow mandatory locks on this filesystem. Seefcntl(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 tonoatime, but it doesn't breakmutt(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 therelatimefeature, bestie. See also thestrictatimemount option.strictatimeโ Lets you explicitly request full atime updates โจ. This makes it possible for the kernel to default torelatimeornoatimebut 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), orsync(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 thelazytimefeature. 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 permissionnosuid_transition, which in turn needs also policy capabilitynnp_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 optionsnosuidandnodev(unless overridden by subsequent options, as in the option lineowner,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 oldmount(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),syncmay cause life-cycle shortening. โ ๏ธ like it works but it's lowkey burning through your drive's lifespan, no capuserโ Allow an ordinary user to mount the filesystem. The name of the mounting user is written to themtabfile (or to the private libmount file in/run/mounton systems without a regularmtab) so that this same user can unmount the filesystem again. This option implies the optionsnoexec,nosuid, andnodev(unless overridden by subsequent options, as in the option lineuser,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 optionsnoexec,nosuid, andnodev(unless overridden by subsequent options, as in the option lineusers,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.,mtabfile), nor sent to themount.typehelpers nor to themount(2)system call. The suggested format isX-appname.option. so they just vibe and vanish ๐จx-*โ The same asX-*options, but stored permanently in user space. This means the options are also available forumount(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 formkdir(2)in octal notation. The default mode is0755. This functionality is supported only for root users or when mount is executed without suid permissions. The option is also supported asx-mount.mkdir, but this notation is deprecated since v2.30. See also--mkdircommand 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=orUUID=) andfstabprocessing.
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 thatmount(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 (afterunshare --mount) on old kernels, or withmount(8)without support for the file-descriptors-based mount kernel API. In that case, you needunshare --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. Specifyinguas the type prefix creates a UID-mapping,gcreates a GID-mapping, and omitting type or specifyingbcreates both a UID- and GID-mapping. The inner and outer IDs are given in the same order as in/proc/[pid]/uid_map(seeuser_namespaces(7)) and for--map-usersabove. 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.
- A user can specify the ID-mapping directly. The ID-mapping must be specified using the syntax
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, andreadlink(1),readlink(2),realpath(1), andrealpath(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. ๐
btrfsโbtrfs(5)cephfsโmount.ceph(8)cifsโmount.cifs(8)ext2,ext3,ext4โext4(5)fuseโfuse(8)nfsโnfs(5)tmpfsโtmpfs(5)xfsโxfs(5)
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=valueandgid=valueโ set the owner and group of the files in the filesystem (default:uid=gid=0).ownmask=valueandothmask=valueโ set the permission mask for ADFS 'owner' permissions and 'other' permissions, respectively (default:0700and0077, respectively). See also/usr/src/linux/Documentation/filesystems/adfs.rst.
๐ Mount options for affs
uid=valueandgid=valueโ set the owner and group of the root of the filesystem (default:uid=gid=0, but with optionuidorgidwithout specified value, the UID and GID of the current process are taken).setuid=valueandsetgid=valueโ set the owner and group of all files.mode=valueโ set the mode of all files tovalue & 0777disregarding 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 are512,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=valueandgid=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, thengid=5will 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 is0600. A value ofmode=620andgid=5makes "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:fatis not a separate filesystem, it's just a common part shared by themsdos,umsdosandvfatfilesystems. Same DNA, different lewks.
blocksize={512|1024|2048}โ sets the blocksize (default is512). Ngl this option is obsolete ๐uid=valueandgid=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 formtime/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.foobarbecomesverylong.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, codepage437is used.conv=modeโ obsolete and may fail or just be ignored ๐cvf_format=moduleโ forces the driver to use the CVF (Compressed Volume File) modulecvf_moduleinstead of auto-detection. If the kernel supports kmod, thecvf_format=xxxoption 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 isiso8859-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 spuriousESTALEerrors.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 thatESTALEwill 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.,minuteswill be subtracted from each timestamp to convert it to UTC used internally by Linux. Handy when the time zone set in the kernel viasettimeofday(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 tochownorchmodfiles do not return errors, although they fail. Use with caution!rodirโ FAT has theATTR_RO(read-only) attribute. On Windows, theATTR_ROof 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_SYSattribute on FAT is handled asIMMUTABLEflag 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 numbernfrom 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=valueandgid=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]}โ withcheck=relaxed, a filename is first converted to lower case before doing the lookup. This is probably only meaningful together withnorockandmap=normal. (Default:check=strict.)uid=valueandgid=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'.'. Withmap=offno name translation is done. Seenorock. (Default:map=normal.)map=acornis likemap=normalbut 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 leading0.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 isblock=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 with0.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 isiso8859-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. useiocharset=utf8for UTF8 translations โ but heads up, this requiresCONFIG_NLS_UTF8to be set in the kernel.configfile.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 theresizekeyword 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 thenointegrityoption 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 specifyingumaskwhich applies both to files and directories,fmaskapplies only to files anddmaskonly 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 than0x20), 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 asaclenables 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 asupperdir.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 objectst_inoand 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.htmlmetacopy={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 likechown/chmodis 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 ifEHASHCOLLISIONerrors are experienced with ther5hash.r5โ a modified version of therupasovhash. 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 ofnologis a work in progress.notailโ by default, reiserfs stores small files and 'file tails' directly into its tree. This confuses some utilities such aslilo(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 byreiserfsck.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 specialresizerutility which can be obtained fromftp://ftp.namesys.com/pub/reiserfsprogs.user_xattrโ enable Extended User Attributes. See theattr(1)manual page.aclโ enable POSIX Access Control Lists. See theacl(5)manual page.barrier=none/barrier=flushโ this disables / enables the use of write barriers in the journaling code.barrier=nonedisables,barrier=flushenables (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 YubiYโ UBI device number 0, volume number YubiX:NAMEโ UBI device number X, volume with name NAMEubi: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 thenoneoption.
๐ฆ 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=forgetcan 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-1as 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=forgetcan 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-1as 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=โ ifmode=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
- before kernel version 2.6.30 the default was
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 theCONFIG_UDF_NLSoption, 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. useuid=<user>instead.gid=ignoreโ ignored. usegid=<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-roption!) ๐ซ44bsdโ for filesystems created by a BSD-like system (NetBSD, FreeBSD, OpenBSD).ufs2โ used in FreeBSD 5.x, supported as read-write.5xbsdโ synonym forufs2.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 tryingname~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 withutf8=0,utf8=noorutf8=false. Ifuni_xlategets 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=uidanddevgid=gidanddevmode=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=uidandbusgid=gidandbusmode=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=uidandlistgid=gidandlistmode=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 ofverity.hashdevice. Mutually exclusive withverity.roothashfile.verity.roothashfile=pathโ path to a file containing the hex-encoded hash of the root ofverity.hashdevice. Mutually exclusive withverity.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 withCONFIG_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 topkcs7(1ssl)signature of root hash hex string. Requirescrypt_activate_by_signed_key()from cryptsetup and a kernel built withCONFIG_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, andlibcrypsetup2.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 you16โ problems writing or locking/etc/mtab. the table said no ๐32โ mount failure. it simply did not work64โ 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 classicmount(2)system call (this requires support for the new file descriptors based mount API). default isauto; in that case, libmount tries to be smart and use classicmount(2)only for well-known issues. if the new mount API is unavailable, libmount can still use traditionalmount(2), even thoughLIBMOUNT_FORCE_MOUNT2is set tonever.LIBMOUNT_FSTAB=<path>โ overrides the default location of the fstab file (ignored for suid)LIBMOUNT_DEBUG=allโ enables libmount debug outputLIBBLKID_DEBUG=allโ enables libblkid debug outputLOOPDEV_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 syncand-o dirsync(the ext2, ext3, ext4, fat and vfat filesystems do support synchronous updates (a la BSD) when mounted with thesyncoption). - the
-o remountmay not be able to change mount parameters (all ext2fs-specific parameters, exceptsb, are changeable with a remount, for example, but you can't changegidorumaskfor the fatfs). - it is possible that the files
/etc/mtaband/proc/mountsdon'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/mountfile usually contains more reliable information.) this is another reason to replace the mtab file with a symlink to the/proc/mountsfile. - checking files on NFS filesystems referenced by file descriptors (i.e. the
fcntlandioctlfamilies of functions) may lead to inconsistent results due to the lack of a consistency check in the kernel even if thenoacmount option is used. - the
loopoption with theoffsetorsizelimitoptions 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 thelosetup(8)command manually before callingmountwith 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