]> git.ipfire.org Git - thirdparty/util-linux.git/blob - sys-utils/umount.8
Merge branch 'master' of https://github.com/rudimeier/util-linux
[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 "August 2012" "util-linux" "System Administration"
26 .SH NAME
27 umount \- unmount file systems
28 .SH SYNOPSIS
29 .B umount
30 .RB [ \-hV ]
31 .LP
32 .B umount \-a
33 .RB [ \-dflnrv ]
34 .RB [ \-t
35 .IR vfstype ]
36 .RB [ \-O
37 .IR options ]
38 .br
39 .B umount
40 .RB [ \-dflnrv ]
41 .RI { dir | device }...
42 .SH DESCRIPTION
43 The
44 .B umount
45 command detaches the file system(s) mentioned from the file hierarchy. A
46 file system is specified by giving the directory where it has been
47 mounted. Giving the special device on which the file system lives may
48 also work, but is obsolete, mainly because it will fail in case this
49 device was mounted on more than one directory.
50 .PP
51 Note that a file system cannot be unmounted when it is 'busy' - for
52 example, when there are open files on it, or when some process has its
53 working directory there, or when a swap file on it is in use. The
54 offending process could even be
55 .B umount
56 itself - it opens libc, and libc in its turn may open for example locale
57 files. A lazy unmount avoids this problem.
58 .SH OPTIONS
59 .TP
60 \fB\-a\fR, \fB\-\-all\fR
61 All of the file systems described in
62 .I /etc/mtab
63 are unmounted. (With
64 .B umount
65 version 2.7 and later: the
66 .I proc
67 filesystem is not unmounted.)
68 .TP
69 \fB\-A\fR, \fB\-\-all-targets\fR
70 Unmount all mountpoints in the current namespace for the specified filesystem.
71 The filesystem could be specified by one of the mountpoints or device name (or
72 UUID, etc.). This option could be used together with \fB\-\-recursive\fR then
73 all nested mounts within the filesystem are recursively unmounted. The
74 \fB\-\-all-targets\fR is only supported on systems where /etc/mtab is a symlink
75 to /proc/mounts.
76 .TP
77 \fB\-c\fR, \fB\-\-no\-canonicalize\fR
78 Do not canonicalize paths. For more details about this option see the
79 .BR mount (8)
80 man page. Note that umount(8) does not pass this option to /sbin/umount.<type> helpers.
81 .TP
82 \fB\-d\fR, \fB\-\-detach\-loop\fR
83 In case the unmounted device was a loop device, also free this loop
84 device.
85 .TP
86 \fB\-\-fake\fP
87 Causes everything to be done except for the actual system call; this 'fakes'
88 unmounting the filesystem. It can be used to remove entries from
89 .I /etc/mtab
90 that were unmounted earlier with the
91 .B \-n
92 option.
93 .TP
94 \fB\-f\fR, \fB\-\-force\fR
95 Force unmount (in case of an unreachable NFS system). (Requires kernel
96 2.1.116 or later.)
97 .TP
98 \fB\-i\fR, \fB\-\-internal\-only\fR
99 Do not call the /sbin/umount.<filesystem> helper even if it exists. By
100 default /sbin/umount.<filesystem> helper is called if one exists.
101 .TP
102 \fB\-n\fR, \fB\-\-no\-mtab\fR
103 Unmount without writing in
104 .IR /etc/mtab .
105 .TP
106 \fB\-l\fR, \fB\-\-lazy\fR
107 Lazy unmount. Detach the filesystem from the filesystem hierarchy now,
108 and cleanup all references to the filesystem as soon as it is not busy
109 anymore. (Requires kernel 2.4.11 or later.)
110 .TP
111 \fB\-O\fR, \fB\-\-test\-opts\fR \fIoptions,list\fR
112 Indicate that the actions should only be taken on file systems with the
113 specified options in
114 .IR /etc/fstab .
115 More than one option type may be specified in a comma separated list.
116 Each option can be prefixed with
117 .B no
118 to specify options for which no action should be taken.
119 .TP
120 \fB\-R\fR, \fB\-\-recursive\fR
121 Recursively unmount each directory specified. Recursion for each directory will
122 stop if any unmount operation in the chain fails for any reason. The relationship
123 between mountpoints is determined by /proc/self/mountinfo entries. The filesystem
124 must be specified by mountpoint path, recursive unmount by device name (or UUID)
125 is unsupported.
126 .TP
127 \fB\-r\fR, \fB\-\-read\-only\fR
128 In case unmounting fails, try to remount read-only.
129 .TP
130 \fB\-t\fR, \fB\-\-types\fR \fIvfstype,ext2,ext3\fR
131 Indicate that the actions should only be taken on file systems of the
132 specified
133 .IR type .
134 More than one type may be specified in a comma separated list. The list
135 of file system types can be prefixed with
136 .B no
137 to specify the file system types on which no action should be taken.
138 .TP
139 \fB\-v\fR, \fB\-\-verbose\fR
140 Verbose mode.
141 .TP
142 \fB\-h\fR, \fB\-\-help\fR
143 Display help text and exit.
144 .TP
145 \fB\-V\fR, \fB\-\-version\fR
146 Display version information and exit.
147 .SH "THE LOOP DEVICE"
148 The
149 .B umount
150 command will free the loop device (if any) associated with the mount, in
151 case it finds the option 'loop=...' in
152 .IR /etc/mtab ,
153 or when the \-d option was given. Any pending loop devices can be freed
154 using 'losetup -d', see
155 .BR losetup (8).
156 .SH "EXTERNAL HELPERS"
157 The syntax of external umount helpers is:
158 .PP
159 .BI /sbin/umount. <suffix>
160 .RI { dir | device }
161 .RB [ \-nlfvr ]
162 .RB [ \-t
163 .IR type.subtype ]
164 .PP
165 where the <suffix> is filesystem type or a value from "uhelper=" or
166 "helper=" mtab option. The \-t option is used for filesystems with
167 subtypes support (for example /sbin/mount.fuse -t fuse.sshfs).
168 .PP
169 The uhelper= (unprivileged umount helper) is possible to use when
170 non-root user wants to umount a mountpoint which is not defined in the
171 /etc/fstab file (e.g. devices mounted by udisk).
172 .PP
173 The helper= mount option redirects all umount requests to the
174 /sbin/umount.<helper> independently on UID.
175 .SH FILES
176 .I /etc/mtab
177 table of mounted file systems
178 .SH ENVIRONMENT
179 .IP LIBMOUNT_FSTAB=<path>
180 overrides the default location of the fstab file
181 .IP LIBMOUNT_MTAB=<path>
182 overrides the default location of the mtab file
183 .IP LIBMOUNT_DEBUG=0xffff
184 enables debug output
185 .SH "SEE ALSO"
186 .BR umount (2),
187 .BR mount (8),
188 .BR losetup (8)
189 .SH HISTORY
190 A
191 .B umount
192 command appeared in Version 6 AT&T UNIX.
193 .SH AVAILABILITY
194 The umount command is part of the util-linux package and is available from
195 .UR ftp://\:ftp.kernel.org\:/pub\:/linux\:/utils\:/util-linux/
196 Linux Kernel Archive
197 .UE .