1 .\" Copyright (c) 1996 Andries Brouwer
2 .\" This page is somewhat derived from a page that was
3 .\" (c) 1980, 1989, 1991 The Regents of the University of California
4 .\" and had been heavily modified by Rik Faith and myself.
6 .\" This is free documentation; you can redistribute it and/or
7 .\" modify it under the terms of the GNU General Public License as
8 .\" published by the Free Software Foundation; either version 2 of
9 .\" the License, or (at your option) any later version.
11 .\" The GNU General Public License's references to "object code"
12 .\" and "executables" are to be interpreted as the output of any
13 .\" document formatting or typesetting system, including
14 .\" intermediate and printed output.
16 .\" This manual is distributed in the hope that it will be useful,
17 .\" but WITHOUT ANY WARRANTY; without even the implied warranty of
18 .\" MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
19 .\" GNU General Public License for more details.
21 .\" You should have received a copy of the GNU General Public License along
22 .\" with this program; if not, write to the Free Software Foundation, Inc.,
23 .\" 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
25 .TH UMOUNT 8 "July 2014" "util-linux" "System Administration"
27 umount \- unmount file systems
38 .RI { directory | device }...
46 command detaches the mentioned file system(s) from the file hierarchy. A
47 file system is specified by giving the directory where it has been
48 mounted. Giving the special device on which the file system lives may
49 also work, but is obsolete, mainly because it will fail in case this
50 device was mounted on more than one directory.
52 Note that a file system cannot be unmounted when it is 'busy' - for
53 example, when there are open files on it, or when some process has its
54 working directory there, or when a swap file on it is in use. The
55 offending process could even be
57 itself - it opens libc, and libc in its turn may open for example locale
58 files. A lazy unmount avoids this problem.
62 All of the filesystems described in
64 are unmounted, except the \fIproc\fR filesystem.
66 .BR \-A , " \-\-all\-targets"
67 Unmount all mountpoints in the current namespace for the specified filesystem.
68 The filesystem can be specified by one of the mountpoints or the device name (or
69 UUID, etc.). When this option is used together with \fB\-\-recursive\fR, then
70 all nested mounts within the filesystem are recursively unmounted.
71 This option is only supported on systems where /etc/mtab is a symlink
74 .BR \-c , " \-\-no\-canonicalize"
75 Do not canonicalize paths. For more details about this option see the
77 man page. Note that \fBumount\fR does not pass this option to the
78 .BI /sbin/umount. type
81 .BR \-d , " \-\-detach\-loop"
82 When the unmounted device was a loop device, also free this loop
83 device. This option is unnecessary for devices initialized by
85 in this case "autoclear" functionality is enabled by default.
88 Causes everything to be done except for the actual system call or umount helper
89 execution; this 'fakes' unmounting the filesystem. It can be used to remove
92 that were unmounted earlier with the
96 .BR \-f , " \-\-force"
97 Force an unmount (in case of an unreachable NFS system). (Requires kernel
100 Note that this option does not guarantee that umount command does not hang.
101 It's strongly recommended to use absolute paths without symlinks to avoid
102 unwanted readlink and stat syscalls on unreachable NFS in umount.
104 .BR \-i , " \-\-internal\-only"
105 Do not call the \fB/sbin/umount.\fIfilesystem\fR helper even if it exists.
106 By default such a helper program is called if it exists.
108 .BR \-l , " \-\-lazy"
109 Lazy unmount. Detach the filesystem from the file hierarchy now,
110 and clean up all references to this filesystem as soon as it is not busy
111 anymore. (Requires kernel 2.4.11 or later.)
113 .BR \-n , " \-\-no\-mtab"
114 Unmount without writing in
117 .BR \-O , " \-\-test\-opts " \fIoption\fR...
118 Unmount only the filesystems that have the specified option set in
120 More than one option may be specified in a comma-separated list.
121 Each option can be prefixed with
123 to indicate that no action should be taken for this option.
125 .BR \-R , " \-\-recursive"
126 Recursively unmount each specified directory. Recursion for each directory will
127 stop if any unmount operation in the chain fails for any reason. The relationship
128 between mountpoints is determined by /proc/self/mountinfo entries. The filesystem
129 must be specified by mountpoint path; a recursive unmount by device name (or UUID)
132 .BR \-r , " \-\-read\-only"
133 When an unmount fails, try to remount the filesystem read-only.
135 .BR \-t , " \-\-types " \fItype\fR...
136 Indicate that the actions should only be taken on filesystems of the
139 More than one type may be specified in a comma-separated list. The list
140 of filesystem types can be prefixed with
142 to indicate that no action should be taken for all of the mentioned types.
146 reads information about mounted filesystems from kernel (/proc/mounts) and
147 filesystem names may be different than filesystem names used in the /etc/fstab
148 (e.g. "nfs4" vs. "nfs").
150 .BR \-v , " \-\-verbose"
153 .BR \-V , " \-\-version"
154 Display version information and exit.
156 .BR \-h , " \-\-help"
157 Display help text and exit.
161 command will automatically detach loop device previously initialized by
163 command independently of /etc/mtab.
165 In this case the device is initialized with "autoclear" flag (see
167 output for more details), otherwise it's necessary to use the option \fB \-\-detach\-loop\fR
168 or call \fBlosetup -d <device>\fR. The autoclear feature is supported since Linux 2.6.25.
170 The syntax of external unmount helpers is:
174 .RI { directory | device }
180 where \fIsuffix\fR is the filesystem type (or the value from a
181 \fBuhelper=\fR or \fBhelper=\fR marker in the mtab file).
182 The \fB\-t\fR option can be used for filesystems that
183 have subtype support. For example:
186 .B umount.fuse \-t fuse.sshfs
189 A \fBuhelper=\fIsomething\fR marker (unprivileged helper) can appear in
190 the \fI/etc/mtab\fR file when ordinary users need to be able to unmount
191 a mountpoint that is not defined in \fI/etc/fstab\fR
192 (for example for a device that was mounted by \fBudisks\fR(1)).
194 A \fBhelper=\fItype\fR marker in the mtab file will redirect
196 to the \fB/sbin/umount.\fItype\fR helper independently of UID.
200 table of mounted filesystems
203 table of known filesystems
205 .IP LIBMOUNT_FSTAB=<path>
206 overrides the default location of the fstab file (ignored for suid)
207 .IP LIBMOUNT_MTAB=<path>
208 overrides the default location of the mtab file (ignored for suid)
209 .IP LIBMOUNT_DEBUG=all
210 enables libmount debug output
218 command appeared in Version 6 AT&T UNIX.
220 The umount command is part of the util-linux package and is available from
221 .UR ftp://\:ftp.kernel.org\:/pub\:/linux\:/utils\:/util-linux/