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 theproc,devfs,devpts,sysfs,rpc_pipefsandnfsdfilesystems. and psst โ this list of filesystems may be replaced by the--types umountoption. 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/mtabis a symlink to/proc/mounts.-c,--no-canonicalizeโ do not canonicalize paths. path canonicalization is based onstat(2)andreadlink(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 bymount(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/mtabthat were unmounted earlier with the-noption. 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.filesystemhelper 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โ performumountin 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 withnoto 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/mountinfoentries. 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 withnoto indicate that no action should be taken for all of the mentioned types. note thatumountreads 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):
0โ success ๐1โ incorrect invocation or permissions2โ system error (out of memory, cannot fork, no more loop devices)4โ internal mount bug8โ user interrupt16โ problems writing or locking/etc/mtab32โ mount failure64โ 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 ๐ถ
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