OSDN Git Service

(split) LDP: Translation snapshots for ja.po.
[linuxjm/LDP_man-pages.git] / draft / man2 / mount.2
1 .\" Hey Emacs! This file is -*- nroff -*- source.
2 .\"
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>
6 .\"
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.
10 .\"
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.
15 .\"
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
22 .\" professionally.
23 .\"
24 .\" Formatted or processed versions of this manual, if unaccompanied by
25 .\" the source, must acknowledge the copyright and authors of this work.
26 .\"
27 .\" Modified 1996-11-04 by Eric S. Raymond <esr@thyrsus.com>
28 .\" Modified 2001-10-13 by Michael Kerrisk <mtk.manpages@gmail.com>
29 .\"     Added note on historical behavior of MS_NOSUID
30 .\" Modified 2002-05-16 by Michael Kerrisk <mtk.manpages@gmail.com>
31 .\"     Extensive changes and additions
32 .\" Modified 2002-05-27 by aeb
33 .\" Modified 2002-06-11 by Michael Kerrisk <mtk.manpages@gmail.com>
34 .\"     Enhanced descriptions of MS_MOVE, MS_BIND, and MS_REMOUNT
35 .\" Modified 2004-06-17 by Michael Kerrisk <mtk.manpages@gmail.com>
36 .\" 2005-05-18, mtk, Added MNT_EXPIRE, plus a few other tidy-ups.
37 .\" 2008-10-06, mtk: move umount*() material into separate umount.2 page.
38 .\" 2008-10-06, mtk: Add discussion of namespaces.
39 .\"
40 .\" Japanese Version Copyright (c) 1997 SUTO, Mitsuaki
41 .\"         all rights reserved.
42 .\" Translated 1997-06-26,SUTO, Mitsuaki <suto@av.crl.sony.co.jp>
43 .\" Updated 2001-05-20, Kentaro Shirakata <argrath@ub32.org>
44 .\" Updated 2001-06-25, Kentaro Shirakata
45 .\" Updated 2001-10-15, Kentaro Shirakata
46 .\" Updated 2002-01-01, Kentaro Shirakata
47 .\" Updated 2002-11-24, Kentaro Shirakata
48 .\" Updated 2003-01-27, Kentaro Shirakata
49 .\" Updated 2005-02-28, Akihiro MOTOKI <amotoki@dd.iij4u.or.jp>
50 .\" Updated 2005-09-06, Akihiro MOTOKI
51 .\" Updated 2006-07-23, Akihiro MOTOKI, LDP v2.36
52 .\" Updated 2007-01-07, Akihiro MOTOKI, LDP v2.43
53 .\" Updated 2007-05-01, Akihiro MOTOKI, LDP v2.46
54 .\" Updated 2008-08-08, Akihiro MOTOKI, LDP v3.05
55 .\" Updated 2008-11-10, Akihiro MOTOKI, LDP v3.11
56 .\" Updated 2010-04-23, Akihiro MOTOKI, LDP v3.24
57 .\"
58 .\"WORD:        lazy umount             遅延アンマウント
59 .\"WORD:        Linux-specific          Linux 特有
60 .\"
61 .\" motoki 2005-02-28:
62 .\" - subtree をどう訳すか。部分木、部分ツリー、サブツリー。。。何かないか。
63 .\"
64 .TH MOUNT 2 2010-09-10 "Linux" "Linux Programmer's Manual"
65 .\"O .SH NAME
66 .SH 名前
67 .\"O mount \- mount and unmount file systems
68 mount \- ファイルシステムをマウント/アンマウントする
69 .\"O .SH SYNOPSIS
70 .SH 書式
71 .nf
72 .B "#include <sys/mount.h>"
73 .sp
74 .BI "int mount(const char *" source ", const char *" target ,
75 .BI "          const char *" filesystemtype ", unsigned long " mountflags ,
76 .BI "          const void *" data );
77 .fi
78 .\"O .SH DESCRIPTION
79 .SH 説明
80 .\"O .BR mount ()
81 .\"O attaches the file system specified by
82 .\"O .I source
83 .\"O (which is often a device name, but can also be a directory name
84 .\"O or a dummy) to the directory specified by
85 .\"O .IR target .
86 .BR mount ()
87
88 .I source
89 で指定されたファイルシステム (デバイス名であることが多いが、
90 ディレクトリ名やダミーの場合もある) を
91 .I target
92 で指定されたディレクトリに結びつける。
93
94 .\"O Appropriate privilege (Linux: the
95 .\"O .B CAP_SYS_ADMIN
96 .\"O capability) is required to mount file systems.
97 ファイルシステムのマウントを行うには、
98 適切な権限 (Linux では
99 .B CAP_SYS_ADMIN
100 ケーパビリティ) が必要である。
101
102 .\"O Since Linux 2.4 a single file system can be visible at
103 .\"O multiple mount points, and multiple mounts can be stacked
104 .\"O on the same mount point.
105 .\"O .\" Multiple mounts on same mount point: since 2.3.99pre7.
106 Linux 2.4 以降、ひとつのファイルシステムを複数のマウントポイントに
107 結びつけることができ、同じマウントポイントに複数のマウントをスタック
108 させることもできる。
109 .\" Multiple mounts on same mount point: since 2.3.99pre7.
110
111 .\"O Values for the
112 .\"O .I filesystemtype
113 .\"O argument supported by the kernel are listed in
114 .\"O .I /proc/filesystems
115 .\"O (like "minix", "ext2", "ext3", "jfs", "xfs", "reiserfs",
116 .\"O "msdos", "proc", "nfs", "iso9660" etc.).
117 .\"O Further types may become available when the appropriate modules
118 .\"O are loaded.
119 引き数
120 .I filesystemtype
121 としてカーネルが対応している値は、
122 .I /proc/filesystems
123 で参照できる (例えば "minix", "ext2", "ext3", "jfs", "xfs", "reiserfs",
124 "msdos", "proc", "nfs", "iso9660" 等)。
125 適切なモジュールが読み込まれると、さらに別の値が利用可能になるかもしれない。
126
127 .\"O The
128 .\"O .I mountflags
129 .\"O argument may have the magic number 0xC0ED (\fBMS_MGC_VAL\fP)
130 .\"O in the top 16 bits (this was required in kernel versions prior to 2.4, but
131 .\"O is no longer required and ignored if specified),
132 .\"O and various mount flags (as defined in \fI<linux/fs.h>\fP for libc4 and libc5
133 .\"O and in \fI<sys/mount.h>\fP for glibc2) in the low order 16 bits:
134 引き数
135 .I mountflags
136 は、先頭 16 ビットはマジックナンバー 0xC0ED (\fBMS_MGC_VAL\fP) で、
137 残りの 16 ビットがマウントフラグである。
138 マジックナンバーは、カーネルバージョン 2.4 より前では必須であったが、
139 現在は必要なく、指定されても無視される。
140 マウントフラグは libc4 と libc5 では \fI<linux/fs.h>\fP 、
141 glibc2 では \fI<sys/mount.h>\fP で定義されており、以下の通りである:
142 .\" FIXME 2.6.15 added flags for "shared subtree" functionality:
143 .\" MS_UNBINDABLE, MS_PRIVATE, MS_SHARED, MS_SLAVE
144 .\" These need to be documented on this page.
145 .\" See:
146 .\" Documentation/filesystems/sharedsubtree.txt
147 .\"
148 .\" http://lwn.net/Articles/159077/
149 .\"
150 .\" http://myweb.sudhaa.com:2022/~ram/sharedsubtree/paper/sharedsubtree.1.pdf
151 .\" Shared-Subtree Concept, Implementation, and Applications in Linux
152 .\" Al Viro viro@ftp.linux.org.uk
153 .\" Ram Pai linuxram@us.ibm.com
154 .\"
155 .\" http://foss.in/2005/slides/sharedsubtree1.pdf
156 .\" Shared Subtree Concept and Implementation in the Linux Kernel
157 .\" Ram Pai
158 .\"
159 .\" 2.6.25 Added MS_I_VERSION, which needs to be documented.
160 .\"
161 .TP
162 .\"O .BR MS_BIND " (Linux 2.4 onward)"
163 .BR MS_BIND " (Linux 2.4 以降)"
164 .\"O .\" since 2.4.0-test9
165 .\" 正確には 2.4.0-test9 以降
166 .\"O Perform a bind mount, making a file or a directory subtree visible at
167 .\"O another point within a file system.
168 .\"O Bind mounts may cross file system boundaries and span
169 .\"O .BR chroot (2)
170 .\"O jails.
171 .\"O The
172 .\"O .IR filesystemtype
173 .\"O and
174 .\"O .IR data
175 .\"O arguments are ignored.
176 .\"O Up until Linux 2.6.26,
177 .\"O .I mountflags
178 .\"O was also ignored
179 .\"O .\" with the exception of the "hidden" MS_REC mountflags bit
180 .\"O (the bind mount has the same mount options as
181 .\"O the underlying mount point).
182 バインドマウントを行う。これはファイルやディレクトリの部分木を
183 ファイルシステム内部の別の場所で見えるようにするものである。
184 バインドマウントを使うと、ファイルシステムをまたいで
185 .BR chroot (2)
186 jail を構成することが可能になる。
187 引き数
188 .I filesystemtype
189
190 .I data
191 は無視される。
192 Linux 2.6.26 より前では
193 .I mountflags
194 も無視されていた
195 .\" with the exception of the "hidden" MS_REC mountflags bit
196 (バインドマウントでは、マウントポイントとなるファイルシステムと
197 同じマウントオプションが使用される)。
198 .\"O Since Linux 2.6.26, the
199 .\"O .B MS_RDONLY
200 .\"O flag is honored when making a bind mount.
201 Linux 2.6.26 以降では、バインドマウントを行う際に
202 .B MS_RDONLY
203 フラグは無視されない。
204 .TP
205 .\"O .BR MS_DIRSYNC " (Since Linux 2.5.19)"
206 .BR MS_DIRSYNC " (Linux 2.5.19 以降)"
207 .\"O Make directory changes on this file system synchronous.
208 .\"O (This property can be obtained for individual directories
209 .\"O or subtrees using
210 .\"O .BR chattr (1).)
211 このファイルシステムへのディレクトリ変更を同期的に行う。
212 (この特性は個々のディレクトリ、または
213 .BR chattr (1)
214 を使った部分木毎に設定できる。)
215 .TP
216 .B MS_MANDLOCK
217 .\"O Permit mandatory locking on files in this file system.
218 .\"O (Mandatory locking must still be enabled on a per-file basis,
219 .\"O as described in
220 .\"O .BR fcntl (2).)
221 .\"O .\" FIXME Say more about MS_MOVE
222 このファイルシステムのファイルに対して強制ロックを認める。
223 (強制ロックを有効にするには、
224 .BR fcntl (2)
225 で述べられている方法でファイル単位で許可をしなければならない)
226 .\" FIXME Say more about MS_MOVE
227 .TP
228 .B MS_MOVE
229 .\"O Move a subtree.
230 .\"O .I source
231 .\"O specifies an existing mount point and
232 .\"O .I target
233 .\"O specifies the new location.
234 .\"O The move is atomic: at no point is the subtree unmounted.
235 .\"O The
236 .\"O .IR filesystemtype ", " mountflags ", and " data
237 .\"O arguments are ignored.
238 部分木を移動する。
239 .I source
240 にはすでに存在するマウントポイントを指定し、
241 .I target
242 には新しい場所を指定する。
243 移動はアトミックである。
244 操作の実行中、部分ツリーがアンマウントされることはない。
245 .IR filesystemtype ", " mountflags ", " data
246 引き数は無視される。
247 .TP
248 .B MS_NOATIME
249 .\"O Do not update access times for (all types of) files on this file system.
250 このファイルシステムの (全ての種類の) ファイルのアクセス時刻を更新しない。
251 .TP
252 .B MS_NODEV
253 .\"O Do not allow access to devices (special files) on this file system.
254 このファイルシステムのデバイス (スペシャルファイル) へのアクセスを許可しない。
255 .TP
256 .B MS_NODIRATIME
257 .\"O Do not update access times for directories on this file system.
258 このファイルシステムのディレクトリのアクセス時刻を更新しない。
259 .\"O This flag provides a subset of the functionality provided by
260 .\"O .BR MS_NOATIME ;
261 .\"O that is,
262 .\"O .BR MS_NOATIME
263 .\"O implies
264 .\"O .BR MS_NODIRATIME .
265 このフラグは
266 .B MS_NOATIME
267 で提供される機能のサブセットを提供する。つまり、
268 .B MS_NOATIME
269 では
270 .B MS_NODIRATIME
271 が暗黙のうち設定される。
272 .TP
273 .B MS_NOEXEC
274 .\"O Do not allow programs to be executed from this file system.
275 このファイルシステムにあるプログラムの実行を許可しない。
276 .\" (Possibly useful for a file system that contains non-Linux executables.
277 .\" Often used as a security feature, e.g., to make sure that restricted
278 .\" users cannot execute files uploaded using ftp or so.)
279 .TP
280 .B MS_NOSUID
281 .\"O Do not honor set-user-ID and set-group-ID bits when executing
282 .\"O programs from this file system.
283 このファイルシステムのプログラムを実行するときに、
284 set-user-ID ビットと set-group-ID ビットを無視する。
285 .\" (This is a security feature to prevent users executing set-UID and
286 .\" set-GID programs from removable disk devices.)
287 .TP
288 .B MS_RDONLY
289 .\"O Mount file system read-only.
290 ファイルシステムを読み込み専用でマウントする。
291 .\"
292 .\" FIXME Document MS_REC, available since 2.4.11.
293 .\" This flag has meaning in conjunction with MS_BIND and
294 .\" also with the shared subtree flags.
295 .TP
296 .\"O .BR MS_RELATIME " (Since Linux 2.6.20)"
297 .BR MS_RELATIME " (Linux 2.6.20 以降)"
298 .\"O When a file on this file system is accessed,
299 .\"O only update the file's last access time (atime) if the current value
300 .\"O of atime is less than or equal to the file's last modification time (mtime)
301 .\"O or last status change time (ctime).
302 .\"O This option is useful for programs, such as
303 .\"O .BR mutt (1),
304 .\"O that need to know when a file has been read since it was last modified.
305 このファイルシステム上のファイルがアクセスされた際、
306 そのファイルの最終アクセス時刻 (atime) の現在値が
307 最終修正時刻 (mtime) や最終状態変更時刻 (ctime) と
308 等しいか小さい場合にのみ、atime を更新する。
309 このオプションは、
310 .BR mutt (1)
311 のように、最後の内容修正以降にファイルがいつ読み出されたかを知る
312 必要があるプログラムで有用である。
313 .\"O Since Linux 2.6.30, the kernel defaults to the behavior provided
314 .\"O by this flag (unless
315 .\"O .BR MS_NOATIME
316 .\"O was specified), and the
317 .\"O .B MS_STRICTATIME
318 .\"O flag is required to obtain traditional semantics.
319 .\"O In addition, since Linux 2.6.30,
320 .\"O the file's last access time is always updated if it
321 .\"O is more than 1 day old.
322 Linux 2.6.30 以降では、
323 .B MS_NOATIME
324 が指定されていない場合には、このフラグの動作が
325 カーネルのデフォルト動作となっており、
326 Linux 2.6.30 より前の動作をさせるためには
327 .B MS_STRICTATIME
328 フラグを指定する必要がある。
329 これに加えて、Linux 2.6.30 以降では、
330 ファイルの最終アクセス時刻が 1 日以上前の場合、
331 ファイルの最終アクセス時刻は常に更新される。
332 .\" Matthew Garrett notes in the patch that added this behavior
333 .\" that this lets utilities such as tmpreaper (which deletes
334 .\" files based on last acces time) work correctly.
335 .TP
336 .B MS_REMOUNT
337 .\"O Remount an existing mount.
338 .\"O This allows you to change the
339 .\"O .I mountflags
340 .\"O and
341 .\"O .I data
342 .\"O of an existing mount without having to unmount and remount the file system.
343 .\"O .I source
344 .\"O and
345 .\"O .I target
346 .\"O should be the same values specified in the initial
347 .\"O .BR mount ()
348 .\"O call;
349 .\"O .I filesystemtype
350 .\"O is ignored.
351 すでに存在するマウントを再マウントする。
352 これにより、すでに存在するマウントの
353 .I mountflags
354
355 .I data
356 を、一度アンマウントしてから再マウントするという作業をせずに
357 変更できる。
358 .I source
359
360 .I target
361 は最初の
362 .BR mount ()
363 呼び出しと同じ値を指定する必要がある。
364 .I filesystemtype
365 は無視される。
366
367 .\"O The following
368 .\"O .I mountflags
369 .\"O can be changed:
370 .\"O .BR MS_RDONLY ,
371 .\"O .BR MS_SYNCHRONOUS ,
372 .\"O .BR MS_MANDLOCK ;
373 .\"O before kernel 2.6.16, the following could also be changed:
374 .\"O .B MS_NOATIME
375 .\"O and
376 .\"O .BR MS_NODIRATIME ;
377 .\"O and, additionally, before kernel 2.4.10, the following could also be changed:
378 .\"O .BR MS_NOSUID ,
379 .\"O .BR MS_NODEV ,
380 .\"O .BR MS_NOEXEC .
381 .I mountflags
382 のうち
383 .BR MS_RDONLY ,
384 .BR MS_SYNCHRONOUS ,
385 .B MS_MANDLOCK
386 は変更可能である。
387 カーネル 2.6.16 より前では、
388 .BR MS_NOATIME ,
389 .B MS_NODIRATIME
390 も変更可能であった。
391 カーネル 2.4.10 より前では、上記に加えて、
392 .BR MS_NOSUID ,
393 .BR MS_NODEV ,
394 .B MS_NOEXEC
395 も変更可能であった。
396 .TP
397 .\"O .BR MS_SILENT " (since Linux 2.6.17)"
398 .BR MS_SILENT " (Linux 2.6.17 以降)"
399 .\"O Suppress the display of certain
400 .\"O .RI ( printk ())
401 .\"O warning messages in the kernel log.
402 .\"O This flag supersedes the misnamed and obsolete
403 .\"O .BR MS_VERBOSE
404 .\"O flag (available since Linux 2.4.12), which has the same meaning.
405 カーネルのログ内のある種の
406 .RI ( printk ())
407 警告メッセージの表示を抑制する。
408 このフラグは、名前が不適切で廃止された
409 .B MS_VERBOSE
410 フラグ (Linux 2.4.12 以降で利用可能) を置き換えるもので、同じ意味を持つ。
411 .TP
412 .\"O .BR MS_STRICTATIME " (Since Linux 2.6.30)"
413 .BR MS_STRICTATIME " (Linux 2.6.30 以降)"
414 .\"O Always update the last access time (atime) when files on this
415 .\"O file system are accessed.
416 .\"O (This was the default behavior before Linux 2.6.30.)
417 .\"O Specifying this flag overrides the effect of setting the
418 .\"O .BR MS_NOATIME
419 .\"O and
420 .\"O .BR MS_RELATIME
421 .\"O flags.
422 このファイルシステムがアクセスされた際に最終アクセス時刻 (atime)
423 を常に更新する (Linux 2.6.30 より前では、これがデフォルトの動作
424 であった)。
425 このフラグを指定することで、
426 .B MS_NOATIME
427
428 .B MS_RELATIME
429 の両フラグを設定した際の影響を上書きすることができる。
430 .TP
431 .B MS_SYNCHRONOUS
432 .\"O Make writes on this file system synchronous (as though
433 .\"O the
434 .\"O .B O_SYNC
435 .\"O flag to
436 .\"O .BR open (2)
437 .\"O was specified for all file opens to this file system).
438 ファイルシステムに対して同期的に書き込みを行う。
439 (このファイルシステムの全てのオープンされたファイルに対して、
440 .BR open (2)
441 のフラグに
442 .B O_SYNC
443 を指定したような動作となる)
444 .PP
445 .\"O From Linux 2.4 onward, the
446 .\"O .BR MS_NODEV ", " MS_NOEXEC ", and " MS_NOSUID
447 .\"O flags are settable on a per-mount-point basis.
448 .\"O From kernel 2.6.16 onward,
449 .\"O .B MS_NOATIME
450 .\"O and
451 .\"O .B MS_NODIRATIME
452 .\"O are also settable on a per-mount-point basis.
453 .\"O The
454 .\"O .B MS_RELATIME
455 .\"O flag is also settable on a per-mount-point basis.
456 Linux 2.4 以降では、
457 .BR MS_NODEV ", " MS_NOEXEC ", " MS_NOSUID
458 はマウントポイント単位で指定できる。
459 カーネル 2.6.16 以降では、
460 .B MS_NOATIME
461
462 .B MS_NODIRATIME
463 もマウントポイント単位で指定できる。
464 また、
465 .B MS_RELATIME
466 フラグもマウントポイント単位で設定できる。
467 .PP
468 .\"O The
469 .\"O .I data
470 .\"O argument is interpreted by the different file systems.
471 引き数
472 .I data
473 がどのように解釈されるかは、ファイルシステムによって異なる。
474 .\"O Typically it is a string of comma-separated options
475 .\"O understood by this file system.
476 .\"O See
477 .\"O .BR mount (8)
478 .\"O for details of the options available for each filesystem type.
479 たいていは、指定されたファイルシステムで利用可能なオプションが
480 コンマ区切りで並べられた文字列である。
481 各ファイルシステムに対して指定可能なオプションの詳細については
482 .BR mount (8)
483 を参照のこと。
484 .\"O .SH "RETURN VALUE"
485 .SH 返り値
486 .\"O On success, zero is returned.
487 .\"O On error, \-1 is returned, and
488 .\"O .I errno
489 .\"O is set appropriately.
490 成功した場合 0 が返る。失敗した場合 \-1 が返り、
491 .I errno
492 がエラーの内容に従って設定される。
493 .\"O .SH ERRORS
494 .SH エラー
495 .\"O The error values given below result from filesystem type independent
496 .\"O errors.
497 .\"O Each file-system type may have its own special errors and its
498 .\"O own special behavior.
499 .\"O See the kernel source code for details.
500 以下に示すエラーは、ファイルシステムに依存しないものである。
501 それぞれのファイルシステムタイプには固有のエラーが存在する場合があり、
502 独自の動作をすることもある。詳しくはカーネルのソースを見て欲しい。
503 .TP
504 .B EACCES
505 .\"O A component of a path was not searchable.
506 .\"O (See also
507 .\"O .BR path_resolution (7).)
508 .\"O Or, mounting a read-only file system was attempted without giving the
509 .\"O .B MS_RDONLY
510 .\"O flag.
511 .\"O Or, the block device
512 .\"O .I source
513 .\"O is located on a file system mounted with the
514 .\"O .B MS_NODEV
515 .\"O option.
516 .\"O .\" mtk: Probably: write permission is required for MS_BIND, with
517 .\"O .\" the error EPERM if not present; CAP_DAC_OVERRIDE is required.
518 パスに含まれるディレクトリに検索 (実行) 許可がない
519 .RB ( path_resolution (7)
520 も参照)。
521 または、
522 .B MS_RONLY
523 フラグを指定せずに読み込み専用のファイルシステムを
524 マウントしようとした。
525 または、ブロックデバイス
526 .I source
527
528 .B MS_NODEV
529 オプションでマウントされたファイルシステム上にある。
530 .\" mtk: Probably: write permission is required for MS_BIND, with
531 .\" the error EPERM if not present; CAP_DAC_OVERRIDE is required.
532 .TP
533 .B EBUSY
534 .\"O .I source
535 .\"O is already mounted.
536 .\"O Or, it cannot be remounted read-only,
537 .\"O because it still holds files open for writing.
538 .\"O Or, it cannot be mounted on
539 .\"O .I target
540 .\"O because
541 .\"O .I target
542 .\"O is still busy (it is the working directory of some thread,
543 .\"O the mount point of another device, has open files, etc.).
544 .I source
545 は既にマウントされている。
546 または、書き込み用にオープンされたファイルがあり、
547 読み込み専用で再マウントすることができない。
548 または、
549 .I target
550 が使用中 (busy) のため、
551 .I target
552 にマウントできない。
553 .I target
554 が使用中の例としては、あるスレッドの動作ディレクトリ (working
555 directory) であるとか、別のデバイスのマウントポイントであるとか、
556 オープンされたファイルが存在する、などがある。
557 .TP
558 .B EFAULT
559 .\"O One of the pointer arguments points outside the user address space.
560 場所を示す引き数のひとつがユーザーのアドレス空間の外を指している。
561 .TP
562 .B EINVAL
563 .\"O .I source
564 .\"O had an invalid superblock.
565 .I source
566 に不正なスーパーブロックがある。
567 .\"O Or, a remount
568 .\"O .RB ( MS_REMOUNT )
569 .\"O was attempted, but
570 .\"O .I source
571 .\"O was not already mounted on
572 .\"O .IR target .
573 または、
574 .I source
575
576 .I target
577 にマウントされていないのに、再マウント
578 .RB ( MS_REMOUNT )
579 が要求された。
580 .\"O Or, a move
581 .\"O .RB ( MS_MOVE )
582 .\"O was attempted, but
583 .\"O .I source
584 .\"O was not a mount point, or was \(aq/\(aq.
585 または、
586 .I source
587 がマウントポイントではないか、\(aq/\(aq なのに、移動
588 .RB ( MS_MOVE )
589 が要求された。
590 .TP
591 .B ELOOP
592 .\"O Too many links encountered during pathname resolution.
593 .\"O Or, a move was attempted, while
594 .\"O .I target
595 .\"O is a descendant of
596 .\"O .IR source .
597 パス名の解決中に登場したリンクが多すぎた。
598 または、
599 .I target
600
601 .I source
602 の子孫なのに移動が要求された。
603 .TP
604 .B EMFILE
605 .\"O (In case no block device is required:)
606 .\"O Table of dummy devices is full.
607 .\" motoki: どう訳すのがいいだろうか?
608 (ブロックデバイスが必要でない場合)
609 ダミーデバイスのテーブルが一杯になった。
610 .TP
611 .B ENAMETOOLONG
612 .\"O A pathname was longer than
613 .\"O .BR MAXPATHLEN .
614 パス名の長さが
615 .B MAXPATHLEN
616 を越えた。
617 .TP
618 .B ENODEV
619 .\"O .I filesystemtype
620 .\"O not configured in the kernel.
621 .I filesystemtype
622 がカーネル中で定義 (config) されていない。
623 .TP
624 .B ENOENT
625 .\"O A pathname was empty or had a nonexistent component.
626 パス名が空である。もしくは指定されたパスが存在しない。
627 .TP
628 .B ENOMEM
629 .\"O The kernel could not allocate a free page to copy filenames or data into.
630 カーネルがファイル名やデータをコピーするための空きページを確保できない。
631 .TP
632 .B ENOTBLK
633 .\"O .I source
634 .\"O is not a block device (and a device was required).
635 (ブロックデバイスが必要だが)
636 .I source
637 がブロックデバイスではない。
638 .TP
639 .B ENOTDIR
640 .\"O .IR target ,
641 .\"O or a prefix of
642 .\"O .IR source ,
643 .\"O is not a directory.
644 .I target
645 か、
646 .I source
647 のプレフィックスがディレクトリではない。
648 .TP
649 .B ENXIO
650 .\"O The major number of the block device
651 .\"O .I source
652 .\"O is out of range.
653 ブロックデバイス
654 .I source
655 のメジャー番号が範囲外である。
656 .TP
657 .B EPERM
658 .\"O The caller does not have the required privileges.
659 呼び出し元に必要な権限がない。
660 .\"O .SH VERSIONS
661 .SH バージョン
662 .\"O The definitions of
663 .\"O .BR MS_DIRSYNC ,
664 .\"O .BR MS_MOVE ,
665 .\"O .BR MS_REC ,
666 .\"O .BR MS_RELATIME ,
667 .\"O and
668 .\"O .BR MS_STRICTATIME
669 .\"O were only added to glibc headers in version 2.12.
670 .BR MS_DIRSYNC ,
671 .BR MS_MOVE ,
672 .BR MS_REC ,
673 .BR MS_RELATIME ,
674 .B MS_STRICTATIME
675 の定義が glibc のヘッダに追加されたのは
676 バージョン 2.12 においてのみである。
677 .\" FIXME: Definitions of the so-far-undocumented MS_UNBINDABLE, MS_PRIVATE,
678 .\"  MS_SHARED, and MS_SLAVE were (also) only added to glibc headers in 2.12.
679 .\"O .SH "CONFORMING TO"
680 .SH 準拠
681 .\"O This function is Linux-specific and should not be used in
682 .\"O programs intended to be portable.
683 この関数は Linux 固有の関数であり、移植を考慮したプログラムでは
684 使用すべきでない。
685 .\"O .SH NOTES
686 .\"O The original
687 .\"O .B MS_SYNC
688 .\"O flag was renamed
689 .\"O .B MS_SYNCHRONOUS
690 .\"O in 1.1.69
691 .\"O when a different
692 .\"O .B MS_SYNC
693 .\"O was added to \fI<mman.h>\fP.
694 元の
695 .B MS_SYNC
696 フラグは、別の
697 .B MS_SYNC
698 が \fI<mman.h>\fP に追加されたので
699 1.1.69 から
700 .B MS_SYNCHRONOUS
701 に名前が変わった。
702 .LP
703 .\"O Before Linux 2.4 an attempt to execute a set-UID or set-GID program
704 .\"O on a file system mounted with
705 .\"O .B MS_NOSUID
706 .\"O would fail with
707 .\"O .BR EPERM .
708 Linux 2.4 より前のバージョンでは、
709 .B MS_NOSUID
710 オプション付きでマウントされたファイルシステム上の
711 set-UID や set-GID のプログラムを実行しようとすると、
712 .B EPERM
713 エラーとなった。
714 .\"O Since Linux 2.4 the set-UID and set-GID bits are just silently ignored
715 .\"O in this case.
716 Linux 2.4 以降では、このような場合は set-UID ビットや set-GID ビットが
717 無視されるだけである。
718 .\"O .\" The change is in patch-2.4.0-prerelease.
719 .\" この変更は patch-2.4.0-prerelease に含まれている。
720 .\"O .SS Per-process Namespaces
721 .SS プロセス単位の名前空間
722 .\"O Starting with kernel 2.4.19, Linux provides
723 .\"O per-process mount namespaces.
724 .\"O A mount namespace is the set of file system mounts that
725 .\"O are visible to a process.
726 .\"O Mount-point namespaces can be (and usually are)
727 .\"O shared between multiple processes,
728 .\"O and changes to the namespace (i.e., mounts and unmounts) by one process
729 .\"O are visible to all other processes sharing the same namespace.
730 .\"O (The pre-2.4.19 Linux situation can be considered as one in which
731 .\"O a single namespace was shared by every process on the system.)
732 カーネル 2.4.19 以降の Linux では、プロセス単位のマウント名前空間
733 (mount namespace) が提供されている。マウント名前空間とは、
734 あるプロセスに見えているファイルシステムのマウントの集合である。
735 マウントポイントの名前空間は複数のプロセスで共有することができ、
736 普通は共有されている。
737 一つのプロセスによる名前空間の変更 (すなわち、マウントやアンマウント) は
738 同じ名前空間を共有する他の全てのプロセスにも見える。
739 (2.4.19 より前の Linux は、一つの名前空間がシステム上の全プロセスで
740 共有される状況とみなすことができる。)
741
742 .\"O A child process created by
743 .\"O .BR fork (2)
744 .\"O shares its parent's mount namespace;
745 .\"O the mount namespace is preserved across an
746 .\"O .BR execve (2).
747 .BR fork (2)
748 経由で作成された子プロセスは親プロセスのマウント名前空間を共有する。
749 .BR execve (2)
750 の前後でマウント名前空間は保持される。
751
752 .\"O A process can obtain a private mount namespace if:
753 .\"O it was created using the
754 .\"O .BR clone (2)
755 .\"O .BR CLONE_NEWNS
756 .\"O flag,
757 .\"O in which case its new namespace is initialized to be a
758 .\"O .I copy
759 .\"O of the namespace of the process that called
760 .\"O .BR clone (2);
761 .\"O or it calls
762 .\"O .BR unshare (2)
763 .\"O with the
764 .\"O .BR CLONE_NEWNS
765 .\"O flag,
766 .\"O which causes the caller's mount namespace to obtain a private copy
767 .\"O of the namespace that it was previously sharing with other processes,
768 .\"O so that future mounts and unmounts by the caller are invisible
769 .\"O to other processes (except child processes that the caller
770 .\"O subsequently creates) and vice versa.
771 プロセスは自分用 (private) のマウント名前空間を持つことができる。
772 自分用の名前空間を持つことができるのは、
773 そのプロセスが
774 .BR clone (2)
775 .B CLONE_NEWNS
776 フラグを使って作成された場合と、
777 そのプロセスが
778 .B CLONE_NEWNS
779 フラグ付きで
780 .BR unshare (2)
781 を呼び出した場合である。
782 前者の場合、作成されたプロセスの新しい名前空間は
783 .BR clone (2)
784 を呼び出したプロセスの名前空間の「コピー」で初期化される。
785 後者の場合、
786 .BR unshare (2)
787 を呼び出すと、呼び出し元のプロセスのマウント名前空間が、
788 それまでは他のプロセスと共有していた名前空間の自分用のコピーとなる。
789 これにより、呼び出し元のプロセスがこれ以後に行うマウント/アンマウントは
790 他のプロセスから見えなくなる
791 (ただし、呼び出し元のプロセスが
792 .BR unshare (2)
793 の呼び出し以降に作成した子プロセスには見える)。
794 また、その逆の、他のプロセスが行ったマウント/アンマウントも呼び出し元のプロセスには
795 見えなくなる。
796
797 .\"O The Linux-specific
798 .\"O .I /proc/PID/mounts
799 .\"O file exposes the list of mount points in the mount
800 .\"O namespace of the process with the specified ID; see
801 .\"O .BR proc (5)
802 .\"O for details.
803 Linux 独自のファイル
804 .I /proc/PID/mounts
805 では、指定された ID を持つプロセスのマウント名前空間における
806 マウントポイントのリストが公開されている。詳細は
807 .BR proc (5)
808 を参照のこと。
809 .\"O .SH "SEE ALSO"
810 .SH 関連項目
811 .BR umount (2),
812 .BR path_resolution (7),
813 .BR mount (8),
814 .BR umount (8)