1 .\" Hey Emacs! This file is -*- nroff -*- source.
3 .\" Copyright (C) 1993 Rickard E. Faith <faith@cs.unc.edu>
4 .\" and Copyright (C) 1994 Andries E. Brouwer <aeb@cwi.nl>
5 .\" and Copyright (C) 2002, 2005 Michael Kerrisk <mtk.manpages@gmail.com>
7 .\" Permission is granted to make and distribute verbatim copies of this
8 .\" manual provided the copyright notice and this permission notice are
9 .\" preserved on all copies.
11 .\" Permission is granted to copy and distribute modified versions of this
12 .\" manual under the conditions for verbatim copying, provided that the
13 .\" entire resulting derived work is distributed under the terms of a
14 .\" permission notice identical to this one.
16 .\" Since the Linux kernel and libraries are constantly changing, this
17 .\" manual page may be incorrect or out-of-date. The author(s) assume no
18 .\" responsibility for errors or omissions, or for damages resulting from
19 .\" the use of the information contained herein. The author(s) may not
20 .\" have taken the same level of care in the production of this manual,
21 .\" which is licensed free of charge, as they might when working
24 .\" Formatted or processed versions of this manual, if unaccompanied by
25 .\" the source, must acknowledge the copyright and authors of this work.
27 .\" 2008-10-06, mtk: Created this as a new page by splitting
28 .\" umount/umount2 material out of mount.2
30 .\" Japanese Version Copyright (c) 2008 Akihiro MOTOKI
31 .\" all rights reserved.
32 .\" Translated 2008-11-20, Akihiro MOTOKI <amotoki@dd.iij4u.or.jp>, LDP v3.13
34 .TH UMOUNT 2 2009-09-03 "Linux" "Linux Programmer's Manual"
37 .\"O umount, umount2 \- unmount file system
38 umount, umount2 \- ¥Õ¥¡¥¤¥ë¥·¥¹¥Æ¥à¤ò¥¢¥ó¥Þ¥¦¥ó¥È¤¹¤ë
42 .B "#include <sys/mount.h>"
44 .BI "int umount(const char *" target );
46 .BI "int umount2(const char *" target ", int " flags );
53 .\"O remove the attachment of the (topmost) file system mounted on
60 ¤Ë¥Þ¥¦¥ó¥È¤µ¤ì¤Æ¤¤¤ë (ºÇ¾å°Ì¤Î) ¥Õ¥¡¥¤¥ë¥·¥¹¥Æ¥à¤ò³°¤¹¡£
61 .\" Note: the kernel naming differs from the glibc naming
62 .\" umount2 is the glibc name for what the kernel now calls umount
63 .\" and umount is the glibc name for oldumount
65 .\"O Appropriate privilege (Linux: the
67 .\"O capability) is required to unmount file systems.
68 ¥Õ¥¡¥¤¥ë¥·¥¹¥Æ¥à¤Î¥¢¥ó¥Þ¥¦¥ó¥È¤ò¹Ô¤¦¤Ë¤Ï¡¢
69 ŬÀڤʸ¢¸Â (Linux ¤Ç¤Ï
71 ¥±¡¼¥Ñ¥Ó¥ê¥Æ¥£) ¤¬É¬ÍפǤ¢¤ë¡£
73 .\"O Linux 2.1.116 added the
75 .\"O system call, which, like
77 .\"O unmounts a target, but allows additional
79 .\"O controlling the behavior of the operation:
82 ¥·¥¹¥Æ¥à¥³¡¼¥ë¤¬Äɲ䵤줿¡£¤³¤ì¤Ï
86 ¤ò¥¢¥ó¥Þ¥¦¥ó¥È¤¹¤ë¤¬¡¢
88 ¤¬Äɲ䵤ì¤Æ¤ª¤ê¡¢Áàºî»þ¤Î¿¶¤ëÉñ¤¤¤òÀ©¸æ¤Ç¤¤ë¡£
90 .\"O .BR MNT_FORCE " (since Linux 2.1.116)"
91 .BR MNT_FORCE " (2.1.116 °Ê¹ß)"
92 .\"O Force unmount even if busy.
93 .\"O This can cause data loss.
94 .\"O (Only for NFS mounts.)
95 »ÈÍÑÃæ (busy) ¤Ç¤â¶¯À©Åª¤Ë¥¢¥ó¥Þ¥¦¥ó¥È¤ò¼Â¹Ô¤¹¤ë¡£
96 ¤³¤ì¤ò¹Ô¤¦¤È¥Ç¡¼¥¿¤ò¼º¤¦²ÄǽÀ¤¬¤¢¤ë¡£
99 .\"O .BR MNT_DETACH " (since Linux 2.4.11)"
100 .BR MNT_DETACH " (2.4.11 °Ê¹ß)"
101 .\"O Perform a lazy unmount: make the mount point unavailable for
102 .\"O new accesses, and actually perform the unmount when the mount point
103 .\"O ceases to be busy.
104 Ãٱ䥢¥ó¥Þ¥¦¥ó¥È¤ò¹Ô¤¦¡£¥Þ¥¦¥ó¥È¥Ý¥¤¥ó¥È¤ËÂФ¹¤ë¿·µ¬¤Î¥¢¥¯¥»¥¹¤Ï
105 ÉÔ²Äǽ¤È¤Ê¤ê¡¢¼ÂºÝ¤Î¥¢¥ó¥Þ¥¦¥ó¥È¤Ï¥Þ¥¦¥ó¥È¥Ý¥¤¥ó¥È¤¬¥Ó¥¸¡¼¤Ç
106 ¤Ê¤¯¤Ê¤Ã¤¿»þÅÀ¤Ç¹Ô¤¦¡£
108 .\"O .BR MNT_EXPIRE " (since Linux 2.6.8)"
109 .BR MNT_EXPIRE " (Linux 2.6.8 °Ê¹ß)"
110 .\"O Mark the mount point as expired.
111 ¥Þ¥¦¥ó¥È¥Ý¥¤¥ó¥È¤Ë´ü¸ÂÀÚ¤ì¤Î°õ¤ò¤Ä¤±¤ë¡£
112 .\"O If a mount point is not currently in use, then an initial call to
114 .\"O with this flag fails with the error
116 .\"O but marks the mount point as expired.
117 ¥Þ¥¦¥ó¥È¥Ý¥¤¥ó¥È¤¬¸½ºß»ÈÍÑÃæ¤Ç¤Ê¤¤¾ì¹ç¡¢¤³¤Î¥Õ¥é¥°¤ò¤Ä¤±¤Æ
121 ¥¨¥é¡¼¤Ç¼ºÇÔ¤¹¤ë¤¬¡¢¥Þ¥¦¥ó¥È¥Ý¥¤¥ó¥È¤Ë¤Ï´ü¸ÂÀÚ¤ì (expire)
123 .\"O The mount point remains expired as long as it isn't accessed
125 ¤½¤Î¥Þ¥¦¥ó¥È¥Ý¥¤¥ó¥È¤Ï¤¤¤º¤ì¤«¤Î¥×¥í¥»¥¹¤¬¥¢¥¯¥»¥¹¤·¤Ê¤¤¸Â¤ê
126 ´ü¸ÂÀÚ¤ì¤Î°õ¤¬¤Ä¤¤¤¿¤Þ¤Þ¤È¤Ê¤ë¡£
131 .\"O unmounts an expired mount point.
136 ¤ò¸Æ¤Ó½Ð¤¹¤È¡¢´ü¸ÂÀÚ¤ì¤Î°õ¤Î¤Ä¤¤¤¿¥Þ¥¦¥ó¥È¥Ý¥¤¥ó¥È¤¬
138 .\"O This flag cannot be specified with either
141 .\"O .BR MNT_DETACH .
146 ¤ÈƱ»þ¤Ë»ØÄꤹ¤ë¤³¤È¤Ï¤Ç¤¤Ê¤¤¡£
147 .\"O .SH "RETURN VALUE"
149 .\"O On success, zero is returned.
150 .\"O On error, \-1 is returned, and
152 .\"O is set appropriately.
153 À®¸ù¤·¤¿¾ì¹ç 0 ¤¬Ê֤롣
154 ¥¨¥é¡¼¤Î¾ì¹ç¡¢\-1 ¤¬Ê֤ꡢ
156 ¤¬¥¨¥é¡¼¤ÎÆâÍƤˤ·¤¿¤¬¤Ã¤ÆÀßÄꤵ¤ì¤ë¡£
159 .\"O The error values given below result from filesystem type independent
161 .\"O Each filesystem type may have its own special errors and its
162 .\"O own special behavior.
163 .\"O See the kernel source code for details.
164 °Ê²¼¤Ë¼¨¤¹¥¨¥é¡¼¤Ï¡¢¥Õ¥¡¥¤¥ë¥·¥¹¥Æ¥à¤Ë°Í¸¤·¤Ê¤¤¤â¤Î¤Ç¤¢¤ë¡£
165 ¤½¤ì¤¾¤ì¤Î¥Õ¥¡¥¤¥ë¥·¥¹¥Æ¥à¥¿¥¤¥×¤Ë¤Ï¸ÇͤΥ¨¥é¡¼¤¬Â¸ºß¤¹¤ë¾ì¹ç¤¬¤¢¤ê¡¢
166 Æȼ«¤ÎÆ°ºî¤ò¤¹¤ë¤³¤È¤â¤¢¤ë¡£¾Ü¤·¤¯¤Ï¥«¡¼¥Í¥ë¤Î¥½¡¼¥¹¤ò¸«¤ÆÍߤ·¤¤¡£
173 .\"O successfully marked an unbusy file system as expired.
177 ¤Î¸Æ¤Ó½Ð¤·¤Ç¡¢Àµ¾ï¤Ë̤»ÈÍѤΥե¡¥¤¥ë¥·¥¹¥Æ¥à¤Ë´ü¸ÂÀÚ¤ì¤Î°õ¤ò
182 .\"O could not be unmounted because it is busy.
183 »ÈÍÑÃæ (busy) ¤Î¤¿¤á¡¢
185 ¤ò¥¢¥ó¥Þ¥¦¥ó¥È¤Ç¤¤Ê¤«¤Ã¤¿¡£
189 .\"O points outside the user address space.
191 ¤¬¥æ¡¼¥¶¥¢¥É¥ì¥¹¶õ´Ö¤Î³°¤ò»Ø¤·¤Æ¤¤¤ë¡£
195 .\"O is not a mount point.
205 ¤¬¥Þ¥¦¥ó¥È¥Ý¥¤¥ó¥È¤Ç¤Ï¤Ê¤¤¡£
219 .\"O A pathname was longer than
220 .\"O .BR MAXPATHLEN .
226 .\"O A pathname was empty or had a nonexistent component.
227 ¥Ñ¥¹Ì¾¤¬¶õ¤Ç¤¢¤ë¡£¤â¤·¤¯¤Ï»ØÄꤵ¤ì¤¿¥Ñ¥¹¤¬Â¸ºß¤·¤Ê¤¤¡£
230 .\"O The kernel could not allocate a free page to copy filenames or data into.
231 ¥«¡¼¥Í¥ë¤¬¥Õ¥¡¥¤¥ë̾¤ä¥Ç¡¼¥¿¤ò¥³¥Ô¡¼¤¹¤ë¤¿¤á¤Î¶õ¤¥Ú¡¼¥¸¤ò³ÎÊݤǤ¤Ê¤«¤Ã¤¿¡£
234 .\"O The caller does not have the required privileges.
235 ¸Æ¤Ó½Ð¤·¸µ¤¬É¬Íפʸ¢¸Â¤ò»ý¤Ã¤Æ¤¤¤Ê¤¤¡£
241 .\" http://sourceware.org/bugzilla/show_bug.cgi?id=10092
242 .\"O are only available in glibc since version 2.11.
246 ¤Ï¥Ð¡¼¥¸¥ç¥ó 2.11 °Ê¹ß¤Î glibc ¤Ç¤Î¤ßÍøÍѤǤ¤ë¡£
247 .\"O .SH "CONFORMING TO"
249 .\"O These functions are Linux-specific and should not be used in
250 .\"O programs intended to be portable.
251 ¤³¤Î´Ø¿ô¤Ï Linux ¸Çͤδؿô¤Ç¤¢¤ê¡¢°Ü¿¢¤ò¹Íθ¤·¤¿¥×¥í¥°¥é¥à¤Ç¤Ï
257 .\"O function was called as \fIumount(device)\fP and would return
259 .\"O when called with something other than a block device.
262 ´Ø¿ô¤Ï \fIumount(device)\fP ¤Î·Á¤Ç¸Æ¤Ó½Ð¤µ¤ì¡¢
263 ¥Ö¥í¥Ã¥¯¥Ç¥Ð¥¤¥¹°Ê³°¤ò»ØÄꤷ¤Æ¸Æ¤Ó½Ð¤¹¤È
266 .\"O In Linux 0.98p4 a call \fIumount(dir)\fP was added, in order to
267 .\"O support anonymous devices.
268 Linux 0.98p4 ¤Ç¡¢ÌµÌ¾¥Ç¥Ð¥¤¥¹ (anonymous device) ¤ËÂбþ¤¹¤ë¤¿¤á¤Ë
269 \fIumount(dir)\fP ¤Î·Á¤Ç¤Î¸Æ¤Ó½Ð¤·¤¬²Ã¤¨¤é¤ì¤¿¡£
270 .\"O In Linux 2.3.99-pre7 the call \fIumount(device)\fP was removed,
271 .\"O leaving only \fIumount(dir)\fP (since now devices can be mounted
272 .\"O in more than one place, so specifying the device does not suffice).
273 Linux 2.3.99-pre7 ¤Ç¡¢\fIumount(device)\fP ¤Ïºï½ü¤µ¤ì¡¢
274 \fIumount(dir)\fP ¤À¤±¤¬»Ä¤µ¤ì¤¿
275 (°ì¤Ä¤Î¥Ç¥Ð¥¤¥¹¤òÊ£¿ô¤Î°ÌÃ֤˥ޥ¦¥ó¥È½ÐÍè¤ë¤è¤¦¤Ë¤Ê¤Ã¤¿¤¿¤á¡¢
276 ¥Ç¥Ð¥¤¥¹¤ò»ØÄꤷ¤¿¤À¤±¤Ç¤ÏÉÔ½½Ê¬¤À¤«¤é¤Ç¤¢¤ë)¡£
280 .BR path_resolution (7),