OSDN Git Service

8cd12c87176eef915d49034a1ecb07916b701059
[lfsbookja/lfsja-git.git] / src / chapter07 / kernfs.ch
1 %
2 % This is part of LFSbookja package.
3 %
4 % This is a CTIE change file for the original XML source of the LFSbook.
5 %
6 @x
7 <?xml version="1.0" encoding="ISO-8859-1"?>
8 @y
9 <?xml version="1.0" encoding="UTF-8"?>
10 @z
11
12 @x
13   <title>Preparing Virtual Kernel File Systems</title>
14 @y
15   <title>仮想カーネルファイルシステムの準備</title>
16 @z
17
18 @x
19     <para>Various file systems exported by the kernel are used to communicate to
20     and from the kernel itself. These file systems are virtual in that no disk
21     space is used for them. The content of the file systems resides in
22     memory.</para>
23 @y
24     <para>
25     カーネルが取り扱うさまざまなファイルシステムは、カーネルとの間でやり取りが行われます。
26     これらのファイルシステムは仮想的なものであり、ディスクを消費するものではありません。
27     ファイルシステムの内容はメモリ上に保持されます。
28     </para>
29 @z
30
31 @x
32     <para>Begin by creating directories onto which the file systems will be
33     mounted:</para>
34 @y
35     <para>
36     ファイルシステムをマウントするディレクトリを以下のようにして生成します。
37     </para>
38 @z
39
40 @x
41     <title>Creating Initial Device Nodes</title>
42 @y
43     <title>初期デバイスノードの生成</title>
44 @z
45
46 @x
47     <para>When the kernel boots the system, it requires the presence of a few
48     device nodes, in particular the <filename
49     class="devicefile">console</filename> and <filename
50     class="devicefile">null</filename> devices. The device nodes must be
51     created on the hard disk so that they are available before the kernel
52     populates <systemitem class="filesystem">/dev</systemitem>), and
53     additionally when Linux is started with
54     <parameter>init=/bin/bash</parameter>. Create the devices by running the
55     following commands:</para>
56 @y
57     <para>
58     カーネルがシステムを起動する際には、いくつかのデバイスノードの存在が必要です。
59     特に <filename class="devicefile">console</filename> と <filename class="devicefile">null</filename> です。
60     これらのデバイスノードはハードディスク上に生成されていなければなりません。
61     <systemitem class="filesystem">/dev</systemitem> が生成され、また Linux が起動パラメーター <parameter>init=/bin/bash</parameter> によって起動されれば利用可能となります。
62     そこで以下のコマンドによりデバイスノードを生成します。
63     </para>
64 @z
65
66 @x
67     <title>Mounting and Populating /dev</title>
68 @y
69     <title>/dev のマウントと有効化</title>
70 @z
71
72 @x
73       <para>The recommended method of populating the <filename
74       class="directory">/dev</filename> directory with devices is to mount a
75       virtual filesystem (such as <systemitem
76       class="filesystem">tmpfs</systemitem>) on the <filename
77       class="directory">/dev</filename> directory, and allow the devices to be
78       created dynamically on that virtual filesystem as they are detected or
79       accessed. Device creation is generally done during the boot process
80       by Udev. Since this new system does not yet have Udev and has not yet
81       been booted, it is necessary to mount and populate <filename
82       class="directory">/dev</filename> manually. This is accomplished by bind
83       mounting the host system's <filename class="directory">/dev</filename>
84       directory. A bind mount is a special type of mount that allows you to
85       create a mirror of a directory or mount point to some other location. Use
86       the following command to achieve this:</para>
87 @y
88       <para>
89       各デバイスを <filename class="directory">/dev</filename> に設定する方法としては、<filename
90       class="directory">/dev</filename> ディレクトリに対して <systemitem
91       class="filesystem">tmpfs</systemitem> のような仮想ファイルシステムをマウントすることが推奨されます。
92       こうすることで各デバイスが検出されアクセスされる際に、その仮想ファイルシステム上にて動的にデバイスを生成する形を取ることができます。
93       このデバイス生成処理は一般的にはシステム起動時に Udev によって行われます。
94       今構築中のシステムにはまだ Udev を導入していませんし、再起動も行っていませんので <filename
95       class="directory">/dev</filename> のマウントと有効化は手動で行ないます。
96       これはホストシステムの <filename class="directory">/dev</filename> ディレクトリに対して、バインドマウントを行うことで実現します。
97       バインドマウント (bind mount) は特殊なマウント方法の一つで、ディレクトリのミラーを生成したり、他のディレクトリへのマウントポイントを生成したりします。
98       以下のコマンドにより実現します。
99       </para>
100 @z
101
102 @x
103     <title>Mounting Virtual Kernel File Systems</title>
104 @y
105     <title>仮想カーネルファイルシステムのマウント</title>
106 @z
107
108 @x
109       <para>Now mount the remaining virtual kernel filesystems:</para>
110 @y
111       <para>残りの仮想カーネルファイルシステムを以下のようにしてマウントします。</para>
112 @z
113
114 @x
115       <title>The meaning of the mount options for devpts:</title>
116 @y
117       <title>devpts に対するマウントオプションの意味</title>
118 @z
119
120 @x gid=5
121           <para>This ensures that all devpts-created device nodes are owned by
122           group ID 5.  This is the ID we will use later on for the <systemitem
123           class="groupname">tty</systemitem> group.  We use the group ID instead
124           of a name, since the host system might use a different ID for its
125           <systemitem class="groupname">tty</systemitem> group.</para>
126 @y
127           <para>
128           このオプションは、devpts により生成されるデバイスノードを、グループID が 5 となるようにするものです。
129           この ID は、この後に <systemitem
130           class="groupname">tty</systemitem> グループにおいて利用します。
131           ここではグループ名ではなくグループ ID を用いるものとしています。
132           この理由は、ホストシステムが <systemitem
133           class="groupname">tty</systemitem> グループに対して異なる ID を利用していることがあるためです。
134           </para>
135 @z
136
137 @x mode=0620
138           <para>This ensures that all devpts-created device nodes have mode 0620
139           (user readable and writable, group writable).  Together with the
140           option above, this ensures that devpts will create device nodes that
141           meet the requirements of grantpt(), meaning the Glibc
142           <command>pt_chown</command> helper binary (which is not installed by
143           default) is not necessary.</para>
144 @y
145           <para>
146           このオプションは、devpts により生成されるデバイスノードのモードを 0620 にします。
147           (所有ユーザーが読み書き可、グループが書き込み可)
148           前のオプションとともにこのオプションを指定することによって、devpts が生成するデバイスノードが grantpt() の要求を満たすようにします。
149           これはつまり、Glibc の ヘルパーコマンド <command>pt_chown</command> (デフォルトではインストールされない) が必要ないことを意味します。
150           </para>
151 @z
152
153 @x
154       <para>In some host systems, <filename>/dev/shm</filename> is a
155       symbolic link to <filename class="directory">/run/shm</filename>.
156       The /run tmpfs was mounted above so in this case only a
157       directory needs to be created.</para>
158 @y
159       <para>
160       ホストシステムによっては <filename>/dev/shm</filename> が <filename
161       class="directory">/run/shm</filename> へのシンボリックリンクになっているものがあります。
162       上の作業にて /run tmpfs がマウントされましたが、これはこのディレクトリを生成する必要がある時のみです。
163       </para>
164 @z