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