UMOUNT(8)

๐Ÿ’… UMOUNT โ€” the manual page, but make it bestie ๐Ÿ’–

okay so real talk, this is umount from section 8 of the manual (that's the system administration girlies ๐Ÿซถ). she's the one who lets you let go of a filesystem. goodbye. bon voyage. no cap.


โœจ NAME โœจ

umount โ€” unmount filesystems ๐ŸŒธ


๐ŸŽ€ SYNOPSIS ๐ŸŽ€

umount -a [-dflnrv] [-t fstype] [-O option...]

umount [-dflnrv] {directory|device}

umount -h|-V

๐Ÿฆ‹ DESCRIPTION ๐Ÿฆ‹

so umount command detaches the filesystem(s) you mentioned from the file hierarchy. that's the whole gig bestie ๐Ÿ’…

you specify a filesystem by giving the directory where it's been mounted. giving the special device that the filesystem lives on may also work, but lowkey that's obsolete โ€” mainly because it will fail if that device was mounted on more than one directory. awkward. ๐Ÿ™ˆ

โš ๏ธ big heads up: a filesystem cannot be unmounted when it is 'busy' โ€” like when there are open files on it, or when some process has its working directory there, or when a swap file on it is in use. the offending process could even be umount itself โ€” it opens libc, and libc in its turn may open, for example, locale files. the audacity ๐Ÿ˜ญ

a lazy unmount avoids this problem, but it may introduce other issues. see the --lazy description below, k? ๐Ÿ‘‡


๐ŸŒˆ OPTIONS ๐ŸŒˆ

  • -a, --all โ€” all of the filesystems described in /proc/self/mountinfo (or in the deprecated /etc/mtab) get unmounted, except the proc, devfs, devpts, sysfs, rpc_pipefs and nfsd filesystems. and psst โ€” this list of filesystems may be replaced by the --types umount option. iconic. โœจ
  • -A, --all-targets โ€” unmount all mountpoints in the current mount namespace for the specified filesystem. the filesystem can be specified by one of the mountpoints or the device name (or UUID, etc.). when this option is used together with --recursive, then all nested mounts within the filesystem are recursively unmounted. ๐ŸŒ€ this option is only supported on systems where /etc/mtab is a symlink to /proc/mounts.
  • -c, --no-canonicalize โ€” do not canonicalize paths. path canonicalization is based on stat(2) and readlink(2) system calls. these system calls may hang in some cases (for example on NFS if the server is not available ๐Ÿ˜ต). the option has to be used with a canonical path to the mount point.
this option is silently ignored by umount for non-root users. sneaky.

for more details about this option see the mount(8) man page. note that umount does not pass this option to the /sbin/umount.type helpers.

  • -d, --detach-loop โ€” when the unmounted device was a loop device, also free this loop device. this option is unnecessary for devices initialized by mount(8) โ€” in that case "autoclear" functionality is enabled by default. cute ๐ŸŽ€
  • --fake โ€” causes everything to be done except for the actual system call or umount helper execution; this 'fakes' unmounting the filesystem. it can be used to remove entries from the deprecated /etc/mtab that were unmounted earlier with the -n option. pretend unmounting, main character energy ๐Ÿ’€
  • -f, --force โ€” force an unmount (in case of an unreachable NFS system). ๐Ÿ’ช

note that this option does not guarantee that the umount command does not hang. it's strongly recommended to use absolute paths without symlinks to avoid unwanted readlink(2) and stat(2) system calls on unreachable NFS in umount.

  • -i, --internal-only โ€” do not call the /sbin/umount.filesystem helper even if it exists. by default such a helper program is called if it exists.
  • -l, --lazy โ€” lazy unmount. detach the filesystem from the file hierarchy now, and clean up all references to this filesystem as soon as it is not busy anymore. ๐Ÿ˜Œ

a system reboot would be expected in the near future if you're going to use this option for a network filesystem or a local filesystem with submounts. the recommended use-case for umount -l is to prevent hangs on shutdown due to an unreachable network share where a normal umount will hang due to a downed server or a network partition. remounts of the share will not be possible. ๐Ÿšซ

  • -N, --namespace ns โ€” perform umount in the mount namespace specified by ns. ns is either a PID of a process running in that namespace or a special file representing that namespace.

umount switches to the namespace when it reads /etc/fstab, writes /etc/mtab (or writes to /run/mount) and calls the umount(2) system call โ€” otherwise it runs in the original namespace. it means that the target mount namespace does not have to contain any libraries or other requirements necessary to execute the umount(2) command. wild, right? ๐Ÿคฏ

see mount_namespaces(7) for more information.

  • -n, --no-mtab โ€” unmount without writing in /etc/mtab.
  • -O, --test-opts option... โ€” unmount only the filesystems that have the specified option set in /etc/fstab. more than one option may be specified in a comma-separated list. each option can be prefixed with no to indicate that no action should be taken for this option. picky but valid ๐Ÿ’…
  • -q, --quiet โ€” suppress "not mounted" error messages. shhh ๐Ÿคซ
  • -R, --recursive โ€” recursively unmount each specified directory. recursion for each directory will stop if any unmount operation in the chain fails for any reason. the relationship between mountpoints is determined by /proc/self/mountinfo entries. the filesystem must be specified by mountpoint path; a recursive unmount by device name (or UUID) is unsupported. since version 2.37 it umounts also all over-mounted filesystems (more filesystems on the same mountpoint). ๐Ÿช†
  • -r, --read-only โ€” when an unmount fails, try to remount the filesystem read-only.
  • -t, --types type... โ€” indicate that the actions should only be taken on filesystems of the specified type. more than one type may be specified in a comma-separated list. the list of filesystem types can be prefixed with no to indicate that no action should be taken for all of the mentioned types. note that umount reads information about mounted filesystems from the kernel (/proc/mounts) and filesystem names may be different than filesystem names used in the /etc/fstab (e.g., "nfs4" vs. "nfs"). the chaos ๐Ÿ˜ญ
  • -v, --verbose โ€” verbose mode. she's chatty today ๐Ÿ’ฌ
  • -h, --help โ€” display help text and exit.
  • -V, --version โ€” display version and exit.

๐Ÿ‘‘ NON-SUPERUSER UMOUNTS ๐Ÿ‘‘

normally, only the superuser can umount filesystems. however, when fstab contains the user option on a line, anybody can unmount the corresponding filesystem. for more details see the mount(8) man page. we love inclusive access ๐Ÿ’–

since version 2.34 the umount command can be used to perform an umount operation also for fuse filesystems if the kernel mount table contains the user's ID. in this case the fstab user= mount option is not required. slay โœจ

since version 2.35 the umount command does not exit when user permissions are inadequate by internal libmount security rules. it drops suid permissions and continues as a regular non-root user. this can be used to support use-cases where root permissions are not necessary (e.g., fuse filesystems, user namespaces, etc). character development fr fr ๐Ÿซถ


๐ŸŒ€ LOOP DEVICE ๐ŸŒ€

the umount command will automatically detach a loop device previously initialized by the mount(8) command, independently of /etc/mtab.

in this case the device is initialized with the "autoclear" flag (see losetup(8) output for more details), otherwise it's necessary to use the option --detach-loop or call losetup -d device. the autoclear feature is supported since Linux 2.6.25.

note that since Linux v3.7 the kernel uses "lazy device destruction". the system just marks the loop device by the autoclear flag and destroys it later. if you need to wait for a complete removal of the loop device, call udevadm settle after umount. โณ


๐Ÿ’€ EXIT STATUS ๐Ÿ’€

umount has the following exit status values (the bits can be ORed):

  1. 0 โ€” success ๐ŸŽ‰
  2. 1 โ€” incorrect invocation or permissions
  3. 2 โ€” system error (out of memory, cannot fork, no more loop devices)
  4. 4 โ€” internal mount bug
  5. 8 โ€” user interrupt
  6. 16 โ€” problems writing or locking /etc/mtab
  7. 32 โ€” mount failure
  8. 64 โ€” some umount succeeded

the command umount -a returns 0 (all succeeded), 32 (all failed), or 64 (some failed, some succeeded). a little messy but we move ๐Ÿšถ

  1. 126 โ€” failed to execute external /sbin/umount.<type> mount helper (since util-linux v2.41)

๐ŸŒธ EXTERNAL HELPERS ๐ŸŒธ

the syntax of external unmount helpers is:

umount.suffix {directory|device} [-flnrv] [-N namespace] [-t type.subtype]

where suffix is the filesystem type (or the value from a uhelper= or helper= marker in the mtab file). the -t option can be used for filesystems that have subtype support. for example:

umount.fuse -t fuse.sshfs

a uhelper=something marker (unprivileged helper) can appear in the /etc/mtab file when ordinary users need to be able to unmount a mountpoint that is not defined in /etc/fstab (for example for a device that was mounted by udisks(1)). ๐Ÿซถ

a helper=type marker in the mtab file will redirect all unmount requests to the /sbin/umount.type helper independently of UID.

note that /etc/mtab is currently deprecated and helper= and other userspace mount options are maintained by libmount.

the exit status value of the helper is returned as the exit status of umount(8). the value 126 is used if the mount helper program is found, but the execl(3) failed. ๐Ÿ˜ญ


๐Ÿงš ENVIRONMENT ๐Ÿงš

  • LIBMOUNT_FSTAB=<path> โ€” overrides the default location of the fstab file (ignored for suid)
  • LIBMOUNT_DEBUG=all โ€” enables libmount debug output

๐Ÿ“ FILES ๐Ÿ“

  • /etc/mtab โ€” table of mounted filesystems (deprecated and usually replaced by a symlink to /proc/mounts)
  • /etc/fstab โ€” table of known filesystems
  • /proc/self/mountinfo โ€” table of mounted filesystems generated by the kernel.

โญ HISTORY โญ

a umount command appeared in Version 6 AT&T UNIX. she's old money, she's vintage, she's been here since forever ๐Ÿ‘‘


๐ŸŒˆ SEE ALSO ๐ŸŒˆ

umount(2), losetup(8), mount_namespaces(7), mount(8)


๐Ÿ› REPORTING BUGS ๐Ÿ›

for bug reports, use the issue tracker <https://github.com/util-linux/util-linux/issues>.


๐Ÿ’œ AVAILABILITY ๐Ÿ’œ

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


and that's the whole page bestie ๐ŸŽ€ this one's util-linux 2.42.4, dated 2026-09-21, and it lives in section 8 โ€” go forth and unmount responsibly, ily, bye ๐Ÿ’–โœจ๐Ÿฆ‹
๐Ÿ“ฆ 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