1UMOUNT(8) System Administration UMOUNT(8)
2
3
4
6 umount - unmount file systems
7
9 umount -a [-dflnrv] [-t fstype] [-O option...]
10
11 umount [-dflnrv] {directory|device}...
12
13 umount -h|-V
14
15
17 The umount command detaches the mentioned file system(s) from the file
18 hierarchy. A file system is specified by giving the directory where it
19 has been mounted. Giving the special device on which the file system
20 lives may also work, but is obsolete, mainly because it will fail in
21 case this device was mounted on more than one directory.
22
23 Note that a file system cannot be unmounted when it is 'busy' - for
24 example, when there are open files on it, or when some process has its
25 working directory there, or when a swap file on it is in use. The
26 offending process could even be umount itself - it opens libc, and libc
27 in its turn may open for example locale files. A lazy unmount avoids
28 this problem, but it may introduce another issues. See --lazy descrip‐
29 tion below.
30
32 -a, --all
33 All of the filesystems described in /proc/self/mountinfo (or in
34 deprecated /etc/mtab) are unmounted, except the proc, devfs,
35 devpts, sysfs, rpc_pipefs and nfsd filesystems. This list of the
36 filesystems may be replaced by --types umount option.
37
38 -A, --all-targets
39 Unmount all mountpoints in the current namespace for the speci‐
40 fied filesystem. The filesystem can be specified by one of the
41 mountpoints or the device name (or UUID, etc.). When this
42 option is used together with --recursive, then all nested mounts
43 within the filesystem are recursively unmounted. This option is
44 only supported on systems where /etc/mtab is a symlink to
45 /proc/mounts.
46
47 -c, --no-canonicalize
48 Do not canonicalize paths. The paths canonicalization is based
49 on stat(2) and readlink(2) system calls. These system calls may
50 hang in some cases (for example on NFS if server is not avail‐
51 able). The option has to be used with canonical path to the
52 mount point.
53
54 For more details about this option see the mount(8) man page.
55 Note that umount does not pass this option to the
56 /sbin/umount.type helpers.
57
58 -d, --detach-loop
59 When the unmounted device was a loop device, also free this loop
60 device. This option is unnecessary for devices initialized by
61 mount(8), in this case "autoclear" functionality is enabled by
62 default.
63
64 --fake Causes everything to be done except for the actual system call
65 or umount helper execution; this 'fakes' unmounting the filesys‐
66 tem. It can be used to remove entries from the deprecated
67 /etc/mtab that were unmounted earlier with the -n option.
68
69 -f, --force
70 Force an unmount (in case of an unreachable NFS system).
71
72 Note that this option does not guarantee that umount command
73 does not hang. It's strongly recommended to use absolute paths
74 without symlinks to avoid unwanted readlink and stat system
75 calls on unreachable NFS in umount.
76
77 -i, --internal-only
78 Do not call the /sbin/umount.filesystem helper even if it
79 exists. By default such a helper program is called if it
80 exists.
81
82 -l, --lazy
83 Lazy unmount. Detach the filesystem from the file hierarchy
84 now, and clean up all references to this filesystem as soon as
85 it is not busy anymore.
86
87 A system reboot would be expected in near future if you're going
88 to use this option for network filesystem or local filesystem
89 with submounts. The recommended use-case for umount -l is to
90 prevent hangs on shutdown due to an unreachable network share
91 where a normal umount will hang due to a downed server or a net‐
92 work partition. Remounts of the share will not be possible.
93
94
95 -N, --namespace ns
96 Perform umount in namespace specified by ns. ns is either PID
97 of process running in that namespace or special file represent‐
98 ing that namespace.
99
100 umount(8) switches to the namespace when it reads /etc/fstab,
101 writes /etc/mtab (or writes to /run/mount) and calls umount(2)
102 system call, otherwise it runs in the original namespace. It
103 means that the target namespace does not have to contain any
104 libraries or another requirements necessary to execute umount(2)
105 command.
106
107 See namespaces(7) for more information.
108
109 -n, --no-mtab
110 Unmount without writing in /etc/mtab.
111
112 -O, --test-opts option...
113 Unmount only the filesystems that have the specified option set
114 in /etc/fstab. More than one option may be specified in a
115 comma-separated list. Each option can be prefixed with no to
116 indicate that no action should be taken for this option.
117
118 -q, --quiet
119 Suppress "not mounted" error messages.
120
121 -R, --recursive
122 Recursively unmount each specified directory. Recursion for
123 each directory will stop if any unmount operation in the chain
124 fails for any reason. The relationship between mountpoints is
125 determined by /proc/self/mountinfo entries. The filesystem must
126 be specified by mountpoint path; a recursive unmount by device
127 name (or UUID) is unsupported.
128
129 -r, --read-only
130 When an unmount fails, try to remount the filesystem read-only.
131
132 -t, --types type...
133 Indicate that the actions should only be taken on filesystems of
134 the specified type. More than one type may be specified in a
135 comma-separated list. The list of filesystem types can be pre‐
136 fixed with no to indicate that no action should be taken for all
137 of the mentioned types. Note that umount reads information
138 about mounted filesystems from kernel (/proc/mounts) and
139 filesystem names may be different than filesystem names used in
140 the /etc/fstab (e.g. "nfs4" vs. "nfs").
141
142 -v, --verbose
143 Verbose mode.
144
145 -V, --version
146 Display version information and exit.
147
148 -h, --help
149 Display help text and exit.
150
152 The umount command will automatically detach loop device previously
153 initialized by mount(8) command independently of /etc/mtab.
154
155 In this case the device is initialized with "autoclear" flag (see los‐
156 etup(8) output for more details), otherwise it's necessary to use the
157 option --detach-loop or call losetup -d <device>. The autoclear fea‐
158 ture is supported since Linux 2.6.25.
159
161 The syntax of external unmount helpers is:
162
163 umount.suffix {directory|device} [-flnrv] [-N namespace] [-t
164 type.subtype]
165
166 where suffix is the filesystem type (or the value from a uhelper= or
167 helper= marker in the mtab file). The -t option can be used for
168 filesystems that have subtype support. For example:
169
170 umount.fuse -t fuse.sshfs
171
172 A uhelper=something marker (unprivileged helper) can appear in the
173 /etc/mtab file when ordinary users need to be able to unmount a mount‐
174 point that is not defined in /etc/fstab (for example for a device that
175 was mounted by udisks(1)).
176
177 A helper=type marker in the mtab file will redirect all unmount
178 requests to the /sbin/umount.type helper independently of UID.
179
180 Note that /etc/mtab is currently deprecated and helper= and another
181 userspace mount options are maintained by libmount.
182
184 /etc/mtab
185 table of mounted filesystems (deprecated and usually replaced by
186 symlink to /proc/mounts)
187
188 /etc/fstab
189 table of known filesystems
190
191 /proc/self/mountinfo
192 table of mounted filesystems generated by kernel.
193
195 LIBMOUNT_FSTAB=<path>
196 overrides the default location of the fstab file (ignored for
197 suid)
198
199 LIBMOUNT_MTAB=<path>
200 overrides the default location of the mtab file (ignored for
201 suid)
202
203 LIBMOUNT_DEBUG=all
204 enables libmount debug output
205
207 umount(2), losetup(8), mount(8)
208
210 A umount command appeared in Version 6 AT&T UNIX.
211
213 The umount command is part of the util-linux package and is available
214 from Linux Kernel Archive ⟨https://www.kernel.org/pub/linux/utils/util-
215 linux/⟩.
216
217
218
219util-linux July 2014 UMOUNT(8)