1UMOUNT(8) System Administration UMOUNT(8)
2
3
4
6 umount - unmount filesystems
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 filesystem(s) from the file
18 hierarchy. A filesystem is specified by giving the directory where it
19 has been mounted. Giving the special device on which the filesystem
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 filesystem 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 other issues. See --lazy description
29 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 mount namespace for the
40 specified filesystem. The filesystem can be specified by one of
41 the 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 the mount namespace specified by ns. ns is
97 either PID of process running in that namespace or special file
98 representing 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 mount namespace does not have to contain
104 any libraries or other requirements necessary to execute
105 umount(2) command.
106
107 See mount_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 Normally, only the superuser can umount filesystems. However, when
153 fstab contains the user option on a line, anybody can umount the corre‐
154 sponding filesystem. For more details see mount(8) man page.
155
156 Since version 2.34 the umount command can be used to perform umount
157 operation also for fuse filesystems if kernel mount table contains
158 user's ID. In this case fstab user= mount option is not required.
159
160 Since version 2.35 umount command does not exit when user permissions
161 are inadequate by internal libmount security rules. It drops suid per‐
162 missions and continue as regular non-root user. This can be used to
163 support use-cases where root permissions are not necessary (e.g., fuse
164 filesystems, user namespaces, etc).
165
167 The umount command will automatically detach loop device previously
168 initialized by mount(8) command independently of /etc/mtab.
169
170 In this case the device is initialized with "autoclear" flag (see los‐
171 etup(8) output for more details), otherwise it's necessary to use the
172 option --detach-loop or call losetup -d <device>. The autoclear fea‐
173 ture is supported since Linux 2.6.25.
174
176 The syntax of external unmount helpers is:
177
178 umount.suffix {directory|device} [-flnrv] [-N namespace] [-t
179 type.subtype]
180
181 where suffix is the filesystem type (or the value from a uhelper= or
182 helper= marker in the mtab file). The -t option can be used for
183 filesystems that have subtype support. For example:
184
185 umount.fuse -t fuse.sshfs
186
187 A uhelper=something marker (unprivileged helper) can appear in the
188 /etc/mtab file when ordinary users need to be able to unmount a mount‐
189 point that is not defined in /etc/fstab (for example for a device that
190 was mounted by udisks(1)).
191
192 A helper=type marker in the mtab file will redirect all unmount
193 requests to the /sbin/umount.type helper independently of UID.
194
195 Note that /etc/mtab is currently deprecated and helper= and other
196 userspace mount options are maintained by libmount.
197
199 LIBMOUNT_FSTAB=<path>
200 overrides the default location of the fstab file (ignored for
201 suid)
202
203 LIBMOUNT_MTAB=<path>
204 overrides the default location of the mtab file (ignored for
205 suid)
206
207 LIBMOUNT_DEBUG=all
208 enables libmount debug output
209
211 /etc/mtab
212 table of mounted filesystems (deprecated and usually replaced by
213 symlink to /proc/mounts)
214
215 /etc/fstab
216 table of known filesystems
217
218 /proc/self/mountinfo
219 table of mounted filesystems generated by kernel.
220
222 A umount command appeared in Version 6 AT&T UNIX.
223
225 umount(2), losetup(8), mount_namespaces(7) mount(8)
226
228 The umount command is part of the util-linux package and is available
229 from Linux Kernel Archive ⟨https://www.kernel.org/pub/linux/utils/util-
230 linux/⟩.
231
232
233
234util-linux July 2014 UMOUNT(8)