NAME
umount - unmount filesystemsSYNOPSIS
umount -a [-dflnrv] [-t fstype] [-O option...]DESCRIPTION
The umount command detaches the mentioned filesystem(s) from the file hierarchy. A filesystem is specified by giving the directory where it has been mounted. Giving the special device on which the filesystem lives may also work, but is obsolete, mainly because it will fail in case this device was mounted on more than one directory.OPTIONS
-a, --allAll of the filesystems described in
/proc/self/mountinfo (or in deprecated /etc/mtab) are unmounted,
except the proc, devfs, devpts, sysfs, rpc_pipefs and nfsd filesystems. This
list of the filesystems may be replaced by --types umount option.
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.
Do not canonicalize paths. The paths
canonicalization is based on stat(2) and readlink(2) system
calls. These system calls may hang in some cases (for example on NFS if server
is not available). The option has to be used with canonical path to the mount
point.
This option is silently ignored by umount for non-root users.
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.
When the unmounted device was a loop device,
also free this loop device. This option is unnecessary for devices initialized
by mount(8), in this case "autoclear" functionality is
enabled by default.
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.
Force an unmount (in case of an unreachable
NFS system).
Note that this option does not guarantee that 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.
Do not call the
/sbin/umount.filesystem helper even if it exists. By default
such a helper program is called if it exists.
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 near future if you’re going to use
this option for network filesystem or 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.
Perform umount in the mount namespace
specified by ns. ns is either PID of process running in that
namespace or 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 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 umount(2) command.
See mount_namespaces(7) for more information.
Unmount without writing in
/etc/mtab.
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.
Suppress "not mounted" error
messages.
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).
When an unmount fails, try to remount the
filesystem read-only.
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 kernel ( /proc/mounts) and filesystem names may be
different than filesystem names used in the /etc/fstab (e.g.,
"nfs4" vs. "nfs").
Verbose mode.
Display help text and exit.
Print 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 umount the corresponding filesystem. For more details see mount(8) man page.LOOP DEVICE
The umount command will automatically detach loop device previously initialized by mount(8) command independently of /etc/mtab.EXTERNAL HELPERS
The syntax of external unmount helpers is:ENVIRONMENT
LIBMOUNT_FSTAB=<path>overrides the default location of the
fstab file (ignored for suid)
overrides the default location of the
mtab file (ignored for suid)
enables libmount debug output
FILES
/etc/mtabtable of mounted filesystems (deprecated and
usually replaced by symlink to /proc/mounts)
table of known filesystems
table of mounted filesystems generated by
kernel.
HISTORY
A umount command appeared in Version 6 AT&T UNIX.SEE ALSO
umount(2), losetup(8), mount_namespaces(7), mount(8)REPORTING BUGS
For bug reports, use the issue tracker at <https://github.com/util-linux/util-linux/issues>.AVAILABILITY
The umount 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/>.2022-08-04 | util-linux 2.38.1 |