]>
Commit | Line | Data |
---|---|---|
7c289c7c SK |
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 | .\" | |
b59c86c8 | 25 | .TH UMOUNT 8 "July 2014" "util-linux" "System Administration" |
7c289c7c SK |
26 | .SH NAME |
27 | umount \- unmount file systems | |
28 | .SH SYNOPSIS | |
7c289c7c SK |
29 | .B umount \-a |
30 | .RB [ \-dflnrv ] | |
31 | .RB [ \-t | |
6ec8a0ba | 32 | .IR fstype ] |
7c289c7c | 33 | .RB [ \-O |
b59c86c8 BS |
34 | .IR option ...] |
35 | .sp | |
7c289c7c SK |
36 | .B umount |
37 | .RB [ \-dflnrv ] | |
b59c86c8 BS |
38 | .RI { directory | device }... |
39 | .sp | |
40 | .B umount | |
41 | .BR \-h | \-V | |
42 | ||
7c289c7c SK |
43 | .SH DESCRIPTION |
44 | The | |
45 | .B umount | |
6ec8a0ba | 46 | command detaches the mentioned file system(s) from the file hierarchy. A |
7c289c7c SK |
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 | |
b59c86c8 | 61 | .BR \-a , " \-\-all" |
6ec8a0ba | 62 | All of the filesystems described in |
29ad8689 KZ |
63 | .I /proc/self/mountinfo |
64 | (or in deprecated /etc/mtab) | |
65 | are unmounted, except the proc, devfs, devpts, sysfs, rpc_pipefs and nfsd | |
66 | filesystems. This list of the filesystems may be replaced by \fB\-\-types\fR | |
67 | umount option. | |
7c289c7c | 68 | .TP |
b06c1ca6 | 69 | .BR \-A , " \-\-all\-targets" |
6f7bce86 | 70 | Unmount all mountpoints in the current namespace for the specified filesystem. |
b59c86c8 BS |
71 | The filesystem can be specified by one of the mountpoints or the device name (or |
72 | UUID, etc.). When this option is used together with \fB\-\-recursive\fR, then | |
73 | all nested mounts within the filesystem are recursively unmounted. | |
74 | This option is only supported on systems where /etc/mtab is a symlink | |
fd7c4924 | 75 | to /proc/mounts. |
4eb49f63 | 76 | .TP |
b06c1ca6 | 77 | .BR \-c , " \-\-no\-canonicalize" |
7c289c7c | 78 | Do not canonicalize paths. For more details about this option see the |
8323d9fd | 79 | .BR mount (8) |
b59c86c8 BS |
80 | man page. Note that \fBumount\fR does not pass this option to the |
81 | .BI /sbin/umount. type | |
82 | helpers. | |
7c289c7c | 83 | .TP |
b06c1ca6 | 84 | .BR \-d , " \-\-detach\-loop" |
b59c86c8 | 85 | When the unmounted device was a loop device, also free this loop |
d00eb87b KZ |
86 | device. This option is unnecessary for devices initialized by |
87 | .BR mount (8), | |
88 | in this case "autoclear" functionality is enabled by default. | |
7c289c7c | 89 | .TP |
b59c86c8 | 90 | .B \-\-fake |
28cdf9c6 KZ |
91 | Causes everything to be done except for the actual system call or umount helper |
92 | execution; this 'fakes' unmounting the filesystem. It can be used to remove | |
29ad8689 | 93 | entries from the deprecated |
7c289c7c SK |
94 | .I /etc/mtab |
95 | that were unmounted earlier with the | |
96 | .B \-n | |
97 | option. | |
98 | .TP | |
b59c86c8 BS |
99 | .BR \-f , " \-\-force" |
100 | Force an unmount (in case of an unreachable NFS system). (Requires kernel | |
7c289c7c | 101 | 2.1.116 or later.) |
dcc3b1fc KZ |
102 | |
103 | Note that this option does not guarantee that umount command does not hang. | |
104 | It's strongly recommended to use absolute paths without symlinks to avoid | |
105 | unwanted readlink and stat syscalls on unreachable NFS in umount. | |
7c289c7c | 106 | .TP |
b06c1ca6 | 107 | .BR \-i , " \-\-internal\-only" |
b59c86c8 BS |
108 | Do not call the \fB/sbin/umount.\fIfilesystem\fR helper even if it exists. |
109 | By default such a helper program is called if it exists. | |
7c289c7c | 110 | .TP |
b59c86c8 BS |
111 | .BR \-l , " \-\-lazy" |
112 | Lazy unmount. Detach the filesystem from the file hierarchy now, | |
113 | and clean up all references to this filesystem as soon as it is not busy | |
114 | anymore. (Requires kernel 2.4.11 or later.) | |
115 | .TP | |
b06c1ca6 | 116 | .BR \-n , " \-\-no\-mtab" |
7c289c7c SK |
117 | Unmount without writing in |
118 | .IR /etc/mtab . | |
119 | .TP | |
b06c1ca6 | 120 | .BR \-O , " \-\-test\-opts " \fIoption\fR... |
b59c86c8 | 121 | Unmount only the filesystems that have the specified option set in |
7c289c7c | 122 | .IR /etc/fstab . |
6ec8a0ba | 123 | More than one option may be specified in a comma-separated list. |
7c289c7c SK |
124 | Each option can be prefixed with |
125 | .B no | |
b59c86c8 | 126 | to indicate that no action should be taken for this option. |
7c289c7c | 127 | .TP |
b59c86c8 BS |
128 | .BR \-R , " \-\-recursive" |
129 | Recursively unmount each specified directory. Recursion for each directory will | |
130 | stop if any unmount operation in the chain fails for any reason. The relationship | |
131 | between mountpoints is determined by /proc/self/mountinfo entries. The filesystem | |
132 | must be specified by mountpoint path; a recursive unmount by device name (or UUID) | |
fd2b0ce5 | 133 | is unsupported. |
13ee1c91 | 134 | .TP |
b06c1ca6 | 135 | .BR \-r , " \-\-read\-only" |
b59c86c8 | 136 | When an unmount fails, try to remount the filesystem read-only. |
7c289c7c | 137 | .TP |
b59c86c8 | 138 | .BR \-t , " \-\-types " \fItype\fR... |
6ec8a0ba | 139 | Indicate that the actions should only be taken on filesystems of the |
7c289c7c SK |
140 | specified |
141 | .IR type . | |
6ec8a0ba BS |
142 | More than one type may be specified in a comma-separated list. The list |
143 | of filesystem types can be prefixed with | |
7c289c7c | 144 | .B no |
b59c86c8 | 145 | to indicate that no action should be taken for all of the mentioned types. |
6c820514 KZ |
146 | .BR |
147 | Note that | |
148 | .B umount | |
149 | reads information about mounted filesystems from kernel (/proc/mounts) and | |
150 | filesystem names may be different than filesystem names used in the /etc/fstab | |
151 | (e.g. "nfs4" vs. "nfs"). | |
7c289c7c | 152 | .TP |
b59c86c8 | 153 | .BR \-v , " \-\-verbose" |
7c289c7c SK |
154 | Verbose mode. |
155 | .TP | |
b59c86c8 | 156 | .BR \-V , " \-\-version" |
b4362b6f | 157 | Display version information and exit. |
b59c86c8 BS |
158 | .TP |
159 | .BR \-h , " \-\-help" | |
160 | Display help text and exit. | |
161 | .SH "LOOP DEVICE" | |
7c289c7c SK |
162 | The |
163 | .B umount | |
d00eb87b KZ |
164 | command will automatically detach loop device previously initialized by |
165 | .BR mount (8) | |
166 | command independently of /etc/mtab. | |
167 | ||
168 | In this case the device is initialized with "autoclear" flag (see | |
169 | .BR losetup (8) | |
170 | output for more details), otherwise it's necessary to use the option \fB \-\-detach\-loop\fR | |
171 | or call \fBlosetup -d <device>\fR. The autoclear feature is supported since Linux 2.6.25. | |
d6983300 | 172 | .SH EXTERNAL HELPERS |
b59c86c8 | 173 | The syntax of external unmount helpers is: |
7c289c7c | 174 | .PP |
d6983300 BS |
175 | .RS |
176 | .BI umount. suffix | |
b59c86c8 BS |
177 | .RI { directory | device } |
178 | .RB [ \-flnrv ] | |
7c289c7c | 179 | .RB [ \-t |
b59c86c8 | 180 | .IR type . subtype ] |
d6983300 | 181 | .RE |
7c289c7c | 182 | .PP |
851c2bd5 BS |
183 | where \fIsuffix\fR is the filesystem type (or the value from a |
184 | \fBuhelper=\fR or \fBhelper=\fR marker in the mtab file). | |
d6983300 BS |
185 | The \fB\-t\fR option can be used for filesystems that |
186 | have subtype support. For example: | |
7c289c7c | 187 | .PP |
d6983300 BS |
188 | .RS |
189 | .B umount.fuse \-t fuse.sshfs | |
190 | .RE | |
851c2bd5 BS |
191 | .PP |
192 | A \fBuhelper=\fIsomething\fR marker (unprivileged helper) can appear in | |
193 | the \fI/etc/mtab\fR file when ordinary users need to be able to unmount | |
194 | a mountpoint that is not defined in \fI/etc/fstab\fR | |
195 | (for example for a device that was mounted by \fBudisks\fR(1)). | |
196 | .PP | |
197 | A \fBhelper=\fItype\fR marker in the mtab file will redirect | |
198 | all unmount requests | |
199 | to the \fB/sbin/umount.\fItype\fR helper independently of UID. | |
29ad8689 KZ |
200 | .PP |
201 | Note that \fI/etc/mtab\fR is currently deprecated and helper= and another | |
202 | userspace mount options are maintained by libmount. | |
7c289c7c | 203 | .SH FILES |
b59c86c8 BS |
204 | .TP |
205 | .B /etc/mtab | |
29ad8689 KZ |
206 | table of mounted filesystems (deprecated and usually replaced by |
207 | symlink to /proc/mounts) | |
b59c86c8 BS |
208 | .TP |
209 | .B /etc/fstab | |
851c2bd5 | 210 | table of known filesystems |
29ad8689 KZ |
211 | .TP |
212 | .B /proc/self/mountinfo | |
213 | table of mounted filesystems generated by kernel. | |
ca3dbca1 DB |
214 | .SH ENVIRONMENT |
215 | .IP LIBMOUNT_FSTAB=<path> | |
68e422ec | 216 | overrides the default location of the fstab file (ignored for suid) |
ca3dbca1 | 217 | .IP LIBMOUNT_MTAB=<path> |
68e422ec KZ |
218 | overrides the default location of the mtab file (ignored for suid) |
219 | .IP LIBMOUNT_DEBUG=all | |
220 | enables libmount debug output | |
7c289c7c SK |
221 | .SH "SEE ALSO" |
222 | .BR umount (2), | |
223 | .BR mount (8), | |
224 | .BR losetup (8) | |
225 | .SH HISTORY | |
226 | A | |
227 | .B umount | |
228 | command appeared in Version 6 AT&T UNIX. | |
229 | .SH AVAILABILITY | |
230 | The umount command is part of the util-linux package and is available from | |
231 | .UR ftp://\:ftp.kernel.org\:/pub\:/linux\:/utils\:/util-linux/ | |
232 | Linux Kernel Archive | |
233 | .UE . |