]> git.ipfire.org Git - thirdparty/util-linux.git/blob - sys-utils/umount.8
libmount: do not call umount helper on --fake
[thirdparty/util-linux.git] / sys-utils / umount.8
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.
5 .\"
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.
10 .\"
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.
15 .\"
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.
20 .\"
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.
24 .\"
25 .TH UMOUNT 8 "July 2014" "util-linux" "System Administration"
26 .SH NAME
27 umount \- unmount file systems
28 .SH SYNOPSIS
29 .B umount \-a
30 .RB [ \-dflnrv ]
31 .RB [ \-t
32 .IR fstype ]
33 .RB [ \-O
34 .IR option ...]
35 .sp
36 .B umount
37 .RB [ \-dflnrv ]
38 .RI { directory | device }...
39 .sp
40 .B umount
41 .BR \-h | \-V
42
43 .SH DESCRIPTION
44 The
45 .B umount
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.
51 .PP
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
56 .B umount
57 itself - it opens libc, and libc in its turn may open for example locale
58 files. A lazy unmount avoids this problem.
59 .SH OPTIONS
60 .TP
61 .BR \-a , " \-\-all"
62 All of the filesystems described in
63 .I /etc/mtab
64 are unmounted, except the \fIproc\fR filesystem.
65 .TP
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
72 to /proc/mounts.
73 .TP
74 .BR \-c , " \-\-no\-canonicalize"
75 Do not canonicalize paths. For more details about this option see the
76 .BR mount (8)
77 man page. Note that \fBumount\fR does not pass this option to the
78 .BI /sbin/umount. type
79 helpers.
80 .TP
81 .BR \-d , " \-\-detach\-loop"
82 When the unmounted device was a loop device, also free this loop
83 device.
84 .TP
85 .B \-\-fake
86 Causes everything to be done except for the actual system call or umount helper
87 execution; this 'fakes' unmounting the filesystem. It can be used to remove
88 entries from
89 .I /etc/mtab
90 that were unmounted earlier with the
91 .B \-n
92 option.
93 .TP
94 .BR \-f , " \-\-force"
95 Force an unmount (in case of an unreachable NFS system). (Requires kernel
96 2.1.116 or later.)
97 .TP
98 .BR \-i , " \-\-internal\-only"
99 Do not call the \fB/sbin/umount.\fIfilesystem\fR helper even if it exists.
100 By default such a helper program is called if it exists.
101 .TP
102 .BR \-l , " \-\-lazy"
103 Lazy unmount. Detach the filesystem from the file hierarchy now,
104 and clean up all references to this filesystem as soon as it is not busy
105 anymore. (Requires kernel 2.4.11 or later.)
106 .TP
107 .BR \-n , " \-\-no\-mtab"
108 Unmount without writing in
109 .IR /etc/mtab .
110 .TP
111 .BR \-O , " \-\-test\-opts " \fIoption\fR...
112 Unmount only the filesystems that have the specified option set in
113 .IR /etc/fstab .
114 More than one option may be specified in a comma-separated list.
115 Each option can be prefixed with
116 .B no
117 to indicate that no action should be taken for this option.
118 .TP
119 .BR \-R , " \-\-recursive"
120 Recursively unmount each specified directory. Recursion for each directory will
121 stop if any unmount operation in the chain fails for any reason. The relationship
122 between mountpoints is determined by /proc/self/mountinfo entries. The filesystem
123 must be specified by mountpoint path; a recursive unmount by device name (or UUID)
124 is unsupported.
125 .TP
126 .BR \-r , " \-\-read\-only"
127 When an unmount fails, try to remount the filesystem read-only.
128 .TP
129 .BR \-t , " \-\-types " \fItype\fR...
130 Indicate that the actions should only be taken on filesystems of the
131 specified
132 .IR type .
133 More than one type may be specified in a comma-separated list. The list
134 of filesystem types can be prefixed with
135 .B no
136 to indicate that no action should be taken for all of the mentioned types.
137 .TP
138 .BR \-v , " \-\-verbose"
139 Verbose mode.
140 .TP
141 .BR \-V , " \-\-version"
142 Display version information and exit.
143 .TP
144 .BR \-h , " \-\-help"
145 Display help text and exit.
146 .SH "LOOP DEVICE"
147 The
148 .B umount
149 command will free the loop device associated with a mount when
150 it finds the option \fBloop=...\fR in
151 .IR /etc/mtab ,
152 or when the \fB\-d\fR option was given. Any still associated loop devices
153 can be freed by using \fBlosetup -d\fR; see
154 .BR losetup (8).
155 .SH EXTERNAL HELPERS
156 The syntax of external unmount helpers is:
157 .PP
158 .RS
159 .BI umount. suffix
160 .RI { directory | device }
161 .RB [ \-flnrv ]
162 .RB [ \-t
163 .IR type . subtype ]
164 .RE
165 .PP
166 where \fIsuffix\fR is the filesystem type (or the value from a
167 \fBuhelper=\fR or \fBhelper=\fR marker in the mtab file).
168 The \fB\-t\fR option can be used for filesystems that
169 have subtype support. For example:
170 .PP
171 .RS
172 .B umount.fuse \-t fuse.sshfs
173 .RE
174 .PP
175 A \fBuhelper=\fIsomething\fR marker (unprivileged helper) can appear in
176 the \fI/etc/mtab\fR file when ordinary users need to be able to unmount
177 a mountpoint that is not defined in \fI/etc/fstab\fR
178 (for example for a device that was mounted by \fBudisks\fR(1)).
179 .PP
180 A \fBhelper=\fItype\fR marker in the mtab file will redirect
181 all unmount requests
182 to the \fB/sbin/umount.\fItype\fR helper independently of UID.
183 .SH FILES
184 .TP
185 .B /etc/mtab
186 table of mounted filesystems
187 .TP
188 .B /etc/fstab
189 table of known filesystems
190 .SH ENVIRONMENT
191 .IP LIBMOUNT_FSTAB=<path>
192 overrides the default location of the fstab file (ignored for suid)
193 .IP LIBMOUNT_MTAB=<path>
194 overrides the default location of the mtab file (ignored for suid)
195 .IP LIBMOUNT_DEBUG=all
196 enables libmount debug output
197 .SH "SEE ALSO"
198 .BR umount (2),
199 .BR mount (8),
200 .BR losetup (8)
201 .SH HISTORY
202 A
203 .B umount
204 command appeared in Version 6 AT&T UNIX.
205 .SH AVAILABILITY
206 The umount command is part of the util-linux package and is available from
207 .UR ftp://\:ftp.kernel.org\:/pub\:/linux\:/utils\:/util-linux/
208 Linux Kernel Archive
209 .UE .