.\" Hey Emacs! This file is -*- nroff -*- source. .\" .\" Copyright (C) 1993 Rickard E. Faith .\" and Copyright (C) 1994 Andries E. Brouwer .\" and Copyright (C) 2002, 2005 Michael Kerrisk .\" .\" Permission is granted to make and distribute verbatim copies of this .\" manual provided the copyright notice and this permission notice are .\" preserved on all copies. .\" .\" Permission is granted to copy and distribute modified versions of this .\" manual under the conditions for verbatim copying, provided that the .\" entire resulting derived work is distributed under the terms of a .\" permission notice identical to this one. .\" .\" Since the Linux kernel and libraries are constantly changing, this .\" manual page may be incorrect or out-of-date. The author(s) assume no .\" responsibility for errors or omissions, or for damages resulting from .\" the use of the information contained herein. The author(s) may not .\" have taken the same level of care in the production of this manual, .\" which is licensed free of charge, as they might when working .\" professionally. .\" .\" Formatted or processed versions of this manual, if unaccompanied by .\" the source, must acknowledge the copyright and authors of this work. .\" .\" Modified 1996-11-04 by Eric S. Raymond .\" Modified 2001-10-13 by Michael Kerrisk .\" Added note on historical behavior of MS_NOSUID .\" Modified 2002-05-16 by Michael Kerrisk .\" Extensive changes and additions .\" Modified 2002-05-27 by aeb .\" Modified 2002-06-11 by Michael Kerrisk .\" Enhanced descriptions of MS_MOVE, MS_BIND, and MS_REMOUNT .\" Modified 2004-06-17 by Michael Kerrisk .\" 2005-05-18, mtk, Added MNT_EXPIRE, plus a few other tidy-ups. .\" 2008-10-06, mtk: move umount*() material into separate umount.2 page. .\" 2008-10-06, mtk: Add discussion of namespaces. .\" .\" Japanese Version Copyright (c) 1997 SUTO, Mitsuaki .\" all rights reserved. .\" Translated 1997-06-26,SUTO, Mitsuaki .\" Updated 2001-05-20, Kentaro Shirakata .\" Updated 2001-06-25, Kentaro Shirakata .\" Updated 2001-10-15, Kentaro Shirakata .\" Updated 2002-01-01, Kentaro Shirakata .\" Updated 2002-11-24, Kentaro Shirakata .\" Updated 2003-01-27, Kentaro Shirakata .\" Updated 2005-02-28, Akihiro MOTOKI .\" Updated 2005-09-06, Akihiro MOTOKI .\" Updated 2006-07-23, Akihiro MOTOKI, LDP v2.36 .\" Updated 2007-01-07, Akihiro MOTOKI, LDP v2.43 .\" Updated 2007-05-01, Akihiro MOTOKI, LDP v2.46 .\" Updated 2008-08-08, Akihiro MOTOKI, LDP v3.05 .\" Updated 2008-11-10, Akihiro MOTOKI, LDP v3.11 .\" Updated 2010-04-23, Akihiro MOTOKI, LDP v3.24 .\" .\"WORD: lazy umount 遅延アンマウント .\"WORD: Linux-specific Linux 特有 .\" .\" motoki 2005-02-28: .\" - subtree をどう訳すか。部分木、部分ツリー、サブツリー。。。何かないか。 .\" .TH MOUNT 2 2010-09-10 "Linux" "Linux Programmer's Manual" .\"O .SH NAME .SH 名前 .\"O mount \- mount and unmount file systems mount \- ファイルシステムをマウント/アンマウントする .\"O .SH SYNOPSIS .SH 書式 .nf .B "#include " .sp .BI "int mount(const char *" source ", const char *" target , .BI " const char *" filesystemtype ", unsigned long " mountflags , .BI " const void *" data ); .fi .\"O .SH DESCRIPTION .SH 説明 .\"O .BR mount () .\"O attaches the file system specified by .\"O .I source .\"O (which is often a device name, but can also be a directory name .\"O or a dummy) to the directory specified by .\"O .IR target . .BR mount () は .I source で指定されたファイルシステム (デバイス名であることが多いが、 ディレクトリ名やダミーの場合もある) を .I target で指定されたディレクトリに結びつける。 .\"O Appropriate privilege (Linux: the .\"O .B CAP_SYS_ADMIN .\"O capability) is required to mount file systems. ファイルシステムのマウントを行うには、 適切な権限 (Linux では .B CAP_SYS_ADMIN ケーパビリティ) が必要である。 .\"O Since Linux 2.4 a single file system can be visible at .\"O multiple mount points, and multiple mounts can be stacked .\"O on the same mount point. .\"O .\" Multiple mounts on same mount point: since 2.3.99pre7. Linux 2.4 以降、ひとつのファイルシステムを複数のマウントポイントに 結びつけることができ、同じマウントポイントに複数のマウントをスタック させることもできる。 .\" Multiple mounts on same mount point: since 2.3.99pre7. .\"O Values for the .\"O .I filesystemtype .\"O argument supported by the kernel are listed in .\"O .I /proc/filesystems .\"O (like "minix", "ext2", "ext3", "jfs", "xfs", "reiserfs", .\"O "msdos", "proc", "nfs", "iso9660" etc.). .\"O Further types may become available when the appropriate modules .\"O are loaded. 引き数 .I filesystemtype としてカーネルが対応している値は、 .I /proc/filesystems で参照できる (例えば "minix", "ext2", "ext3", "jfs", "xfs", "reiserfs", "msdos", "proc", "nfs", "iso9660" 等)。 適切なモジュールが読み込まれると、さらに別の値が利用可能になるかもしれない。 .\"O The .\"O .I mountflags .\"O argument may have the magic number 0xC0ED (\fBMS_MGC_VAL\fP) .\"O in the top 16 bits (this was required in kernel versions prior to 2.4, but .\"O is no longer required and ignored if specified), .\"O and various mount flags (as defined in \fI\fP for libc4 and libc5 .\"O and in \fI\fP for glibc2) in the low order 16 bits: 引き数 .I mountflags は、先頭 16 ビットはマジックナンバー 0xC0ED (\fBMS_MGC_VAL\fP) で、 残りの 16 ビットがマウントフラグである。 マジックナンバーは、カーネルバージョン 2.4 より前では必須であったが、 現在は必要なく、指定されても無視される。 マウントフラグは libc4 と libc5 では \fI\fP 、 glibc2 では \fI\fP で定義されており、以下の通りである: .\" FIXME 2.6.15 added flags for "shared subtree" functionality: .\" MS_UNBINDABLE, MS_PRIVATE, MS_SHARED, MS_SLAVE .\" These need to be documented on this page. .\" See: .\" Documentation/filesystems/sharedsubtree.txt .\" .\" http://lwn.net/Articles/159077/ .\" .\" http://myweb.sudhaa.com:2022/~ram/sharedsubtree/paper/sharedsubtree.1.pdf .\" Shared-Subtree Concept, Implementation, and Applications in Linux .\" Al Viro viro@ftp.linux.org.uk .\" Ram Pai linuxram@us.ibm.com .\" .\" http://foss.in/2005/slides/sharedsubtree1.pdf .\" Shared Subtree Concept and Implementation in the Linux Kernel .\" Ram Pai .\" .\" 2.6.25 Added MS_I_VERSION, which needs to be documented. .\" .TP .\"O .BR MS_BIND " (Linux 2.4 onward)" .BR MS_BIND " (Linux 2.4 以降)" .\"O .\" since 2.4.0-test9 .\" 正確には 2.4.0-test9 以降 .\"O Perform a bind mount, making a file or a directory subtree visible at .\"O another point within a file system. .\"O Bind mounts may cross file system boundaries and span .\"O .BR chroot (2) .\"O jails. .\"O The .\"O .IR filesystemtype .\"O and .\"O .IR data .\"O arguments are ignored. .\"O Up until Linux 2.6.26, .\"O .I mountflags .\"O was also ignored .\"O .\" with the exception of the "hidden" MS_REC mountflags bit .\"O (the bind mount has the same mount options as .\"O the underlying mount point). バインドマウントを行う。これはファイルやディレクトリの部分木を ファイルシステム内部の別の場所で見えるようにするものである。 バインドマウントを使うと、ファイルシステムをまたいで .BR chroot (2) jail を構成することが可能になる。 引き数 .I filesystemtype と .I data は無視される。 Linux 2.6.26 より前では .I mountflags も無視されていた .\" with the exception of the "hidden" MS_REC mountflags bit (バインドマウントでは、マウントポイントとなるファイルシステムと 同じマウントオプションが使用される)。 .\"O Since Linux 2.6.26, the .\"O .B MS_RDONLY .\"O flag is honored when making a bind mount. Linux 2.6.26 以降では、バインドマウントを行う際に .B MS_RDONLY フラグは無視されない。 .TP .\"O .BR MS_DIRSYNC " (Since Linux 2.5.19)" .BR MS_DIRSYNC " (Linux 2.5.19 以降)" .\"O Make directory changes on this file system synchronous. .\"O (This property can be obtained for individual directories .\"O or subtrees using .\"O .BR chattr (1).) このファイルシステムへのディレクトリ変更を同期的に行う。 (この特性は個々のディレクトリ、または .BR chattr (1) を使った部分木毎に設定できる。) .TP .B MS_MANDLOCK .\"O Permit mandatory locking on files in this file system. .\"O (Mandatory locking must still be enabled on a per-file basis, .\"O as described in .\"O .BR fcntl (2).) .\"O .\" FIXME Say more about MS_MOVE このファイルシステムのファイルに対して強制ロックを認める。 (強制ロックを有効にするには、 .BR fcntl (2) で述べられている方法でファイル単位で許可をしなければならない) .\" FIXME Say more about MS_MOVE .TP .B MS_MOVE .\"O Move a subtree. .\"O .I source .\"O specifies an existing mount point and .\"O .I target .\"O specifies the new location. .\"O The move is atomic: at no point is the subtree unmounted. .\"O The .\"O .IR filesystemtype ", " mountflags ", and " data .\"O arguments are ignored. 部分木を移動する。 .I source にはすでに存在するマウントポイントを指定し、 .I target には新しい場所を指定する。 移動はアトミックである。 操作の実行中、部分ツリーがアンマウントされることはない。 .IR filesystemtype ", " mountflags ", " data 引き数は無視される。 .TP .B MS_NOATIME .\"O Do not update access times for (all types of) files on this file system. このファイルシステムの (全ての種類の) ファイルのアクセス時刻を更新しない。 .TP .B MS_NODEV .\"O Do not allow access to devices (special files) on this file system. このファイルシステムのデバイス (スペシャルファイル) へのアクセスを許可しない。 .TP .B MS_NODIRATIME .\"O Do not update access times for directories on this file system. このファイルシステムのディレクトリのアクセス時刻を更新しない。 .\"O This flag provides a subset of the functionality provided by .\"O .BR MS_NOATIME ; .\"O that is, .\"O .BR MS_NOATIME .\"O implies .\"O .BR MS_NODIRATIME . このフラグは .B MS_NOATIME で提供される機能のサブセットを提供する。つまり、 .B MS_NOATIME では .B MS_NODIRATIME が暗黙のうち設定される。 .TP .B MS_NOEXEC .\"O Do not allow programs to be executed from this file system. このファイルシステムにあるプログラムの実行を許可しない。 .\" (Possibly useful for a file system that contains non-Linux executables. .\" Often used as a security feature, e.g., to make sure that restricted .\" users cannot execute files uploaded using ftp or so.) .TP .B MS_NOSUID .\"O Do not honor set-user-ID and set-group-ID bits when executing .\"O programs from this file system. このファイルシステムのプログラムを実行するときに、 set-user-ID ビットと set-group-ID ビットを無視する。 .\" (This is a security feature to prevent users executing set-UID and .\" set-GID programs from removable disk devices.) .TP .B MS_RDONLY .\"O Mount file system read-only. ファイルシステムを読み込み専用でマウントする。 .\" .\" FIXME Document MS_REC, available since 2.4.11. .\" This flag has meaning in conjunction with MS_BIND and .\" also with the shared subtree flags. .TP .\"O .BR MS_RELATIME " (Since Linux 2.6.20)" .BR MS_RELATIME " (Linux 2.6.20 以降)" .\"O When a file on this file system is accessed, .\"O only update the file's last access time (atime) if the current value .\"O of atime is less than or equal to the file's last modification time (mtime) .\"O or last status change time (ctime). .\"O This option is useful for programs, such as .\"O .BR mutt (1), .\"O that need to know when a file has been read since it was last modified. このファイルシステム上のファイルがアクセスされた際、 そのファイルの最終アクセス時刻 (atime) の現在値が 最終修正時刻 (mtime) や最終状態変更時刻 (ctime) と 等しいか小さい場合にのみ、atime を更新する。 このオプションは、 .BR mutt (1) のように、最後の内容修正以降にファイルがいつ読み出されたかを知る 必要があるプログラムで有用である。 .\"O Since Linux 2.6.30, the kernel defaults to the behavior provided .\"O by this flag (unless .\"O .BR MS_NOATIME .\"O was specified), and the .\"O .B MS_STRICTATIME .\"O flag is required to obtain traditional semantics. .\"O In addition, since Linux 2.6.30, .\"O the file's last access time is always updated if it .\"O is more than 1 day old. Linux 2.6.30 以降では、 .B MS_NOATIME が指定されていない場合には、このフラグの動作が カーネルのデフォルト動作となっており、 Linux 2.6.30 より前の動作をさせるためには .B MS_STRICTATIME フラグを指定する必要がある。 これに加えて、Linux 2.6.30 以降では、 ファイルの最終アクセス時刻が 1 日以上前の場合、 ファイルの最終アクセス時刻は常に更新される。 .\" Matthew Garrett notes in the patch that added this behavior .\" that this lets utilities such as tmpreaper (which deletes .\" files based on last acces time) work correctly. .TP .B MS_REMOUNT .\"O Remount an existing mount. .\"O This allows you to change the .\"O .I mountflags .\"O and .\"O .I data .\"O of an existing mount without having to unmount and remount the file system. .\"O .I source .\"O and .\"O .I target .\"O should be the same values specified in the initial .\"O .BR mount () .\"O call; .\"O .I filesystemtype .\"O is ignored. すでに存在するマウントを再マウントする。 これにより、すでに存在するマウントの .I mountflags と .I data を、一度アンマウントしてから再マウントするという作業をせずに 変更できる。 .I source と .I target は最初の .BR mount () 呼び出しと同じ値を指定する必要がある。 .I filesystemtype は無視される。 .\"O The following .\"O .I mountflags .\"O can be changed: .\"O .BR MS_RDONLY , .\"O .BR MS_SYNCHRONOUS , .\"O .BR MS_MANDLOCK ; .\"O before kernel 2.6.16, the following could also be changed: .\"O .B MS_NOATIME .\"O and .\"O .BR MS_NODIRATIME ; .\"O and, additionally, before kernel 2.4.10, the following could also be changed: .\"O .BR MS_NOSUID , .\"O .BR MS_NODEV , .\"O .BR MS_NOEXEC . .I mountflags のうち .BR MS_RDONLY , .BR MS_SYNCHRONOUS , .B MS_MANDLOCK は変更可能である。 カーネル 2.6.16 より前では、 .BR MS_NOATIME , .B MS_NODIRATIME も変更可能であった。 カーネル 2.4.10 より前では、上記に加えて、 .BR MS_NOSUID , .BR MS_NODEV , .B MS_NOEXEC も変更可能であった。 .TP .\"O .BR MS_SILENT " (since Linux 2.6.17)" .BR MS_SILENT " (Linux 2.6.17 以降)" .\"O Suppress the display of certain .\"O .RI ( printk ()) .\"O warning messages in the kernel log. .\"O This flag supersedes the misnamed and obsolete .\"O .BR MS_VERBOSE .\"O flag (available since Linux 2.4.12), which has the same meaning. カーネルのログ内のある種の .RI ( printk ()) 警告メッセージの表示を抑制する。 このフラグは、名前が不適切で廃止された .B MS_VERBOSE フラグ (Linux 2.4.12 以降で利用可能) を置き換えるもので、同じ意味を持つ。 .TP .\"O .BR MS_STRICTATIME " (Since Linux 2.6.30)" .BR MS_STRICTATIME " (Linux 2.6.30 以降)" .\"O Always update the last access time (atime) when files on this .\"O file system are accessed. .\"O (This was the default behavior before Linux 2.6.30.) .\"O Specifying this flag overrides the effect of setting the .\"O .BR MS_NOATIME .\"O and .\"O .BR MS_RELATIME .\"O flags. このファイルシステムがアクセスされた際に最終アクセス時刻 (atime) を常に更新する (Linux 2.6.30 より前では、これがデフォルトの動作 であった)。 このフラグを指定することで、 .B MS_NOATIME と .B MS_RELATIME の両フラグを設定した際の影響を上書きすることができる。 .TP .B MS_SYNCHRONOUS .\"O Make writes on this file system synchronous (as though .\"O the .\"O .B O_SYNC .\"O flag to .\"O .BR open (2) .\"O was specified for all file opens to this file system). ファイルシステムに対して同期的に書き込みを行う。 (このファイルシステムの全てのオープンされたファイルに対して、 .BR open (2) のフラグに .B O_SYNC を指定したような動作となる) .PP .\"O From Linux 2.4 onward, the .\"O .BR MS_NODEV ", " MS_NOEXEC ", and " MS_NOSUID .\"O flags are settable on a per-mount-point basis. .\"O From kernel 2.6.16 onward, .\"O .B MS_NOATIME .\"O and .\"O .B MS_NODIRATIME .\"O are also settable on a per-mount-point basis. .\"O The .\"O .B MS_RELATIME .\"O flag is also settable on a per-mount-point basis. Linux 2.4 以降では、 .BR MS_NODEV ", " MS_NOEXEC ", " MS_NOSUID はマウントポイント単位で指定できる。 カーネル 2.6.16 以降では、 .B MS_NOATIME と .B MS_NODIRATIME もマウントポイント単位で指定できる。 また、 .B MS_RELATIME フラグもマウントポイント単位で設定できる。 .PP .\"O The .\"O .I data .\"O argument is interpreted by the different file systems. 引き数 .I data がどのように解釈されるかは、ファイルシステムによって異なる。 .\"O Typically it is a string of comma-separated options .\"O understood by this file system. .\"O See .\"O .BR mount (8) .\"O for details of the options available for each filesystem type. たいていは、指定されたファイルシステムで利用可能なオプションが コンマ区切りで並べられた文字列である。 各ファイルシステムに対して指定可能なオプションの詳細については .BR mount (8) を参照のこと。 .\"O .SH "RETURN VALUE" .SH 返り値 .\"O On success, zero is returned. .\"O On error, \-1 is returned, and .\"O .I errno .\"O is set appropriately. 成功した場合 0 が返る。失敗した場合 \-1 が返り、 .I errno がエラーの内容に従って設定される。 .\"O .SH ERRORS .SH エラー .\"O The error values given below result from filesystem type independent .\"O errors. .\"O Each file-system type may have its own special errors and its .\"O own special behavior. .\"O See the kernel source code for details. 以下に示すエラーは、ファイルシステムに依存しないものである。 それぞれのファイルシステムタイプには固有のエラーが存在する場合があり、 独自の動作をすることもある。詳しくはカーネルのソースを見て欲しい。 .TP .B EACCES .\"O A component of a path was not searchable. .\"O (See also .\"O .BR path_resolution (7).) .\"O Or, mounting a read-only file system was attempted without giving the .\"O .B MS_RDONLY .\"O flag. .\"O Or, the block device .\"O .I source .\"O is located on a file system mounted with the .\"O .B MS_NODEV .\"O option. .\"O .\" mtk: Probably: write permission is required for MS_BIND, with .\"O .\" the error EPERM if not present; CAP_DAC_OVERRIDE is required. パスに含まれるディレクトリに検索 (実行) 許可がない .RB ( path_resolution (7) も参照)。 または、 .B MS_RONLY フラグを指定せずに読み込み専用のファイルシステムを マウントしようとした。 または、ブロックデバイス .I source が .B MS_NODEV オプションでマウントされたファイルシステム上にある。 .\" mtk: Probably: write permission is required for MS_BIND, with .\" the error EPERM if not present; CAP_DAC_OVERRIDE is required. .TP .B EBUSY .\"O .I source .\"O is already mounted. .\"O Or, it cannot be remounted read-only, .\"O because it still holds files open for writing. .\"O Or, it cannot be mounted on .\"O .I target .\"O because .\"O .I target .\"O is still busy (it is the working directory of some thread, .\"O the mount point of another device, has open files, etc.). .I source は既にマウントされている。 または、書き込み用にオープンされたファイルがあり、 読み込み専用で再マウントすることができない。 または、 .I target が使用中 (busy) のため、 .I target にマウントできない。 .I target が使用中の例としては、あるスレッドの動作ディレクトリ (working directory) であるとか、別のデバイスのマウントポイントであるとか、 オープンされたファイルが存在する、などがある。 .TP .B EFAULT .\"O One of the pointer arguments points outside the user address space. 場所を示す引き数のひとつがユーザーのアドレス空間の外を指している。 .TP .B EINVAL .\"O .I source .\"O had an invalid superblock. .I source に不正なスーパーブロックがある。 .\"O Or, a remount .\"O .RB ( MS_REMOUNT ) .\"O was attempted, but .\"O .I source .\"O was not already mounted on .\"O .IR target . または、 .I source が .I target にマウントされていないのに、再マウント .RB ( MS_REMOUNT ) が要求された。 .\"O Or, a move .\"O .RB ( MS_MOVE ) .\"O was attempted, but .\"O .I source .\"O was not a mount point, or was \(aq/\(aq. または、 .I source がマウントポイントではないか、\(aq/\(aq なのに、移動 .RB ( MS_MOVE ) が要求された。 .TP .B ELOOP .\"O Too many links encountered during pathname resolution. .\"O Or, a move was attempted, while .\"O .I target .\"O is a descendant of .\"O .IR source . パス名の解決中に登場したリンクが多すぎた。 または、 .I target が .I source の子孫なのに移動が要求された。 .TP .B EMFILE .\"O (In case no block device is required:) .\"O Table of dummy devices is full. .\" motoki: どう訳すのがいいだろうか? (ブロックデバイスが必要でない場合) ダミーデバイスのテーブルが一杯になった。 .TP .B ENAMETOOLONG .\"O A pathname was longer than .\"O .BR MAXPATHLEN . パス名の長さが .B MAXPATHLEN を越えた。 .TP .B ENODEV .\"O .I filesystemtype .\"O not configured in the kernel. .I filesystemtype がカーネル中で定義 (config) されていない。 .TP .B ENOENT .\"O A pathname was empty or had a nonexistent component. パス名が空である。もしくは指定されたパスが存在しない。 .TP .B ENOMEM .\"O The kernel could not allocate a free page to copy filenames or data into. カーネルがファイル名やデータをコピーするための空きページを確保できない。 .TP .B ENOTBLK .\"O .I source .\"O is not a block device (and a device was required). (ブロックデバイスが必要だが) .I source がブロックデバイスではない。 .TP .B ENOTDIR .\"O .IR target , .\"O or a prefix of .\"O .IR source , .\"O is not a directory. .I target か、 .I source のプレフィックスがディレクトリではない。 .TP .B ENXIO .\"O The major number of the block device .\"O .I source .\"O is out of range. ブロックデバイス .I source のメジャー番号が範囲外である。 .TP .B EPERM .\"O The caller does not have the required privileges. 呼び出し元に必要な権限がない。 .\"O .SH VERSIONS .SH バージョン .\"O The definitions of .\"O .BR MS_DIRSYNC , .\"O .BR MS_MOVE , .\"O .BR MS_REC , .\"O .BR MS_RELATIME , .\"O and .\"O .BR MS_STRICTATIME .\"O were only added to glibc headers in version 2.12. .BR MS_DIRSYNC , .BR MS_MOVE , .BR MS_REC , .BR MS_RELATIME , .B MS_STRICTATIME の定義が glibc のヘッダに追加されたのは バージョン 2.12 においてのみである。 .\" FIXME: Definitions of the so-far-undocumented MS_UNBINDABLE, MS_PRIVATE, .\" MS_SHARED, and MS_SLAVE were (also) only added to glibc headers in 2.12. .\"O .SH "CONFORMING TO" .SH 準拠 .\"O This function is Linux-specific and should not be used in .\"O programs intended to be portable. この関数は Linux 固有の関数であり、移植を考慮したプログラムでは 使用すべきでない。 .\"O .SH NOTES .\"O The original .\"O .B MS_SYNC .\"O flag was renamed .\"O .B MS_SYNCHRONOUS .\"O in 1.1.69 .\"O when a different .\"O .B MS_SYNC .\"O was added to \fI\fP. 元の .B MS_SYNC フラグは、別の .B MS_SYNC が \fI\fP に追加されたので 1.1.69 から .B MS_SYNCHRONOUS に名前が変わった。 .LP .\"O Before Linux 2.4 an attempt to execute a set-UID or set-GID program .\"O on a file system mounted with .\"O .B MS_NOSUID .\"O would fail with .\"O .BR EPERM . Linux 2.4 より前のバージョンでは、 .B MS_NOSUID オプション付きでマウントされたファイルシステム上の set-UID や set-GID のプログラムを実行しようとすると、 .B EPERM エラーとなった。 .\"O Since Linux 2.4 the set-UID and set-GID bits are just silently ignored .\"O in this case. Linux 2.4 以降では、このような場合は set-UID ビットや set-GID ビットが 無視されるだけである。 .\"O .\" The change is in patch-2.4.0-prerelease. .\" この変更は patch-2.4.0-prerelease に含まれている。 .\"O .SS Per-process Namespaces .SS プロセス単位の名前空間 .\"O Starting with kernel 2.4.19, Linux provides .\"O per-process mount namespaces. .\"O A mount namespace is the set of file system mounts that .\"O are visible to a process. .\"O Mount-point namespaces can be (and usually are) .\"O shared between multiple processes, .\"O and changes to the namespace (i.e., mounts and unmounts) by one process .\"O are visible to all other processes sharing the same namespace. .\"O (The pre-2.4.19 Linux situation can be considered as one in which .\"O a single namespace was shared by every process on the system.) カーネル 2.4.19 以降の Linux では、プロセス単位のマウント名前空間 (mount namespace) が提供されている。マウント名前空間とは、 あるプロセスに見えているファイルシステムのマウントの集合である。 マウントポイントの名前空間は複数のプロセスで共有することができ、 普通は共有されている。 一つのプロセスによる名前空間の変更 (すなわち、マウントやアンマウント) は 同じ名前空間を共有する他の全てのプロセスにも見える。 (2.4.19 より前の Linux は、一つの名前空間がシステム上の全プロセスで 共有される状況とみなすことができる。) .\"O A child process created by .\"O .BR fork (2) .\"O shares its parent's mount namespace; .\"O the mount namespace is preserved across an .\"O .BR execve (2). .BR fork (2) 経由で作成された子プロセスは親プロセスのマウント名前空間を共有する。 .BR execve (2) の前後でマウント名前空間は保持される。 .\"O A process can obtain a private mount namespace if: .\"O it was created using the .\"O .BR clone (2) .\"O .BR CLONE_NEWNS .\"O flag, .\"O in which case its new namespace is initialized to be a .\"O .I copy .\"O of the namespace of the process that called .\"O .BR clone (2); .\"O or it calls .\"O .BR unshare (2) .\"O with the .\"O .BR CLONE_NEWNS .\"O flag, .\"O which causes the caller's mount namespace to obtain a private copy .\"O of the namespace that it was previously sharing with other processes, .\"O so that future mounts and unmounts by the caller are invisible .\"O to other processes (except child processes that the caller .\"O subsequently creates) and vice versa. プロセスは自分用 (private) のマウント名前空間を持つことができる。 自分用の名前空間を持つことができるのは、 そのプロセスが .BR clone (2) .B CLONE_NEWNS フラグを使って作成された場合と、 そのプロセスが .B CLONE_NEWNS フラグ付きで .BR unshare (2) を呼び出した場合である。 前者の場合、作成されたプロセスの新しい名前空間は .BR clone (2) を呼び出したプロセスの名前空間の「コピー」で初期化される。 後者の場合、 .BR unshare (2) を呼び出すと、呼び出し元のプロセスのマウント名前空間が、 それまでは他のプロセスと共有していた名前空間の自分用のコピーとなる。 これにより、呼び出し元のプロセスがこれ以後に行うマウント/アンマウントは 他のプロセスから見えなくなる (ただし、呼び出し元のプロセスが .BR unshare (2) の呼び出し以降に作成した子プロセスには見える)。 また、その逆の、他のプロセスが行ったマウント/アンマウントも呼び出し元のプロセスには 見えなくなる。 .\"O The Linux-specific .\"O .I /proc/PID/mounts .\"O file exposes the list of mount points in the mount .\"O namespace of the process with the specified ID; see .\"O .BR proc (5) .\"O for details. Linux 独自のファイル .I /proc/PID/mounts では、指定された ID を持つプロセスのマウント名前空間における マウントポイントのリストが公開されている。詳細は .BR proc (5) を参照のこと。 .\"O .SH "SEE ALSO" .SH 関連項目 .BR umount (2), .BR path_resolution (7), .BR mount (8), .BR umount (8)