/[gentoo]/xml/htdocs/doc/en/handbook/hb-install-config.xml
Gentoo

Diff of /xml/htdocs/doc/en/handbook/hb-install-config.xml

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

Revision 1.1 Revision 1.14
1<!-- The content of this document is licensed under the CC-BY-SA license -->
2<!-- See http://creativecommons.org/licenses/by-sa/1.0 -->
3
4<!-- $Header: /var/cvsroot/gentoo/xml/htdocs/doc/en/handbook/hb-install-config.xml,v 1.14 2003/12/20 20:32:02 swift Exp $ -->
5
6<sections>
1<section> 7<section>
2<subsection>
3<title>Timezone</title> 8<title>Timezone</title>
4<body> 9<body>
5 10
6<p> 11<p>
7<path>/etc/localtime</path>. 12You now need to select your timezone so that your system knows where it is
13located. Look for your timezone in <path>/usr/share/zoneinfo</path>, then make a
14symlink to <path>/etc/localtime</path> using <c>ln</c>:
15</p>
16
17<pre caption="Setting the timezone information">
18# <i>ls /usr/share/zoneinfo</i>
19<comment>(Suppose you want to use GMT:)</comment>
20# <i>ln -sf /usr/share/zoneinfo/GMT /etc/localtime</i>
8</p> 21</pre>
9 22
10</body> 23</body>
11</subsection> 24</section>
12<subsection> 25<section>
13<title>Filesystem Information</title> 26<title>Filesystem Information</title>
27<subsection>
28<title>What is fstab?</title>
29<body>
30
31<p>
32Under Linux, all partitions used by the system must be listed in
33<path>/etc/fstab</path>. This file contains the mountpoints of those partitions
34(where they are seen in the file system structure), how they should be mounted
35(special options) and when (automatically or not, can users mount those or not,
36etc.).
37</p>
38
14<body> 39</body>
40</subsection>
41<subsection>
42<title>Creating /etc/fstab</title>
43<body>
15 44
45<p>
46<path>/etc/fstab</path> uses a special syntaxis. Every line consists of six
47fields, separated by whitespace (space(s), tabs or a mixture). Each field has
48its own meaning:
16<p> 49</p>
50
51<ul>
52<li>
53 The first field shows the <b>partition</b> described (the path to the device
54 file)
55</li>
56<li>
57 The second field shows the <b>mountpoint</b> at which the partition should be
58 mounted
59</li>
60<li>
61 The third field shows the <b>filesystem</b> used by the partition
62</li>
63<li>
64 The fourth field shows the <b>mountoptions</b> used by <c>mount</c> when it
65 wants to mount the partition. As every filesystem has its own mountoptions,
66 you are encouraged to read the mount manpage (<c>man mount</c>) for a full
67 listing. Multiple mountoptions are comma-separated.
68</li>
69<li>
70 The fifth field is used by <c>dump</c> to determine if the partition needs to
71 be <b>dump</b>ed or not. You can generally leave this as <c>0</c> (zero).
72</li>
73<li>
74 The sixth field is used by <c>fsck</c> the order in which filesystems should
75 be <b>check</b>ed if the system wasn't shut down properly. The root filesystem
76 should have <c>1</c> while the rest should have <c>2</c> (or <c>0</c> in case
77 a filesystem check isn't necessary).
78</li>
79</ul>
80
81<p>
82So start <c>nano</c> (or your favorite editor) to create your
17<path>/etc/fstab</path> 83<path>/etc/fstab</path>:
84</p>
85
86<pre caption="Opening /etc/fstab">
87# <i>nano -w /etc/fstab</i>
88</pre>
89
18</p> 90<p>
91Lets take a look at how we write down the options for the <path>/boot</path>
92partition. This is just an example, so if your architecture doesn't require a
93<path>/boot</path> partition, don't copy it verbatim.
94</p>
19 95
96<p>
97In our default x86 partitioning example <path>/boot</path> is the
98<path>/dev/hda1</path> partition, with <c>ext2</c> as filesystem. It shouldn't
99be mounted automatically (<c>noauto</c>) but does need to be checked. So we
100would write down:
101</p>
102
103<pre caption="An example /boot line for /etc/fstab">
104/dev/hda1 /boot ext2 noauto 1 2
105</pre>
106
107<p>
108Now, to improve performance, most users would want to add the <c>noatime</c>
109option as mountoption, which results in a faster system since access times
110aren't registered (you don't need those generally anyway):
111</p>
112
113<pre caption="An improved /boot line for /etc/fstab">
114/dev/hda1 /boot ext2 noauto,noatime 1 2
115</pre>
116
117<p>
118If we continue with this, we would end up with the following three lines (for
119<path>/boot</path>, <path>/</path> and the swap partition):
120</p>
121
122<pre caption="Three /etc/fstab lines">
123/dev/hda1 /boot ext2 noauto,noatime 1 2
124/dev/hda2 none swap sw 0 0
125/dev/hda3 / ext3 noatime 0 1
126</pre>
127
128<p>
129To finish up, you should add a rule for <path>/proc</path>, <c>tmpfs</c>
130(required) and for your CD-ROM drive (and of course, if you have other
131partitions or drives, for those too):
132</p>
133
134<pre caption="A full /etc/fstab example">
135/dev/hda1 /boot ext2 noauto,noatime 1 2
136/dev/hda2 none swap sw 0 0
137/dev/hda3 / ext3 noatime 0 1
138
139none /proc proc defaults 0 0
140none /dev/shm tmpfs defaults 0 0
141
142/dev/cdroms/cdrom0 /mnt/cdrom auto noauto,user 0 0
143</pre>
144
145<p>
146<c>auto</c> makes <c>mount</c> guess for the filesystem (recommended for
147removable media as they can be created with one of many filesystems) and
148<c>user</c> makes it possible for non-root users to mount the CD.
149</p>
150
151<p>
152Now use the above example to create your <path>/etc/fstab</path>. If you are a
153SPARC-user, you should add the following line to your <path>/etc/fstab</path>
154too:
155</p>
156
157<pre caption="Adding openprom filesystem to /etc/fstab">
158none /proc/openprom openpromfs defaults 0 0
159</pre>
160
161<p>
162If you need <c>usbfs</c>, add the following line to <path>/etc/fstab</path>:
163</p>
164
165<pre caption="Adding usbfs filesystem to /etc/fstab">
166none /proc/bus/usb usbfs defaults 0 0
167</pre>
168
169<p>
170Reread your <path>/etc/fstab</path>, save and quit to continue.
171</p>
172
20</body> 173</body>
21</subsection>
22<subsection> 174</subsection>
175</section>
176<section>
23<title>Networking Information</title> 177<title>Networking Information</title>
24<body>
25
26<p>
27<path>/etc/conf.d/net</path>, <c>rc-update add net.eth0</c>,
28PCMCIA-information etc.
29</p>
30
31</body>
32</subsection> 178<subsection>
179<title>Hostname, Domainname etc.</title>
180<body>
181
182<p>
183One of the choices the user has to make is name his PC. This seems to be quite
184easy, but <e>lots</e> of users are having difficulties finding the appropriate
185name for their Linux-pc. To speed things up, know that any name you choose can
186be changed afterwards. For all we care, you can just call your system
187<c>tux</c> and domain <c>homenetwork</c>.
188</p>
189
190<p>
191We use these values in the next examples. First we set the hostname:
192</p>
193
194<pre caption="Setting the hostname">
195# <i>echo tux &gt; /etc/hostname</i>
196</pre>
197
198<p>
199Second we set the domainname:
200</p>
201
202<pre caption="Setting the domainname">
203# <i>echo homenetwork &gt; /etc/dnsdomainname</i>
204</pre>
205
206<p>
207If you have a NIS domain (if you don't know what that is, then you don't have
208one), you need to define that one too:
209</p>
210
211<pre caption="Setting the NIS domainname">
212# <i>echo nis.homenetwork &gt; /etc/nisdomainname</i>
213</pre>
214
215<p>
216Now add the <c>domainname</c> script to the default runlevel:
217</p>
218
219<pre caption="Adding domainname to the default runlevel">
220# <i>rc-update add domainname default</i>
221</pre>
222
223</body>
33<subsection> 224</subsection>
225<subsection>
226<title>Configuring your Network</title>
227<body>
228
229<p>
230Before you get that "Hey, we've had that already"-feeling, you should remember
231that the networking you set up in the beginning of the gentoo installation was
232just for the installation. Right now you are going to configure networking for
233your Gentoo system permanently.
234</p>
235
236<p>
237All networking information is gathered in <path>/etc/conf.d/net</path>. It uses
238a straightforward yet not intuitive syntax if you don't know how to setup
239networking manually. But don't fear, we'll explain everything :)
240</p>
241
242<p>
243First open <path>/etc/conf.d/net</path> with your favorite editor (<c>nano</c>
244is used in this example):
245</p>
246
247<pre caption="Opening /etc/conf.d/net for editing">
248# <i>nano -w /etc/conf.d/net</i>
249</pre>
250
251<p>
252The first variable you'll find is <c>iface_eth0</c>. It uses the following
253syntax:
254</p>
255
256<pre caption="iface_eth0 syntaxis">
257iface_eth0="<i>&lt;your ip address&gt;</i> broadcast <i>&lt;your broadcast address&gt;</i> netmask <i>&lt;your netmask&gt;</i>"
258</pre>
259
260<p>
261If you use DHCP (automatic IP retrieval), you should just set <c>iface_eth0</c>
262to <c>dhcp</c>. However, if you need to setup your network manually and you're
263not familiar with all the above terms, please read the section on <uri
264link="?part=1&amp;chap=3#doc_chap4_sect3">Understanding Network
265Terminology</uri> if you haven't done so already.
266</p>
267
268<p>
269So lets give two examples; the first one uses DHCP, the second one a static IP
270(192.168.0.2) with netmask 255.255.255.0, broadcast 192.168.0.255 and gateway
271192.168.0.1:
272</p>
273
274<pre caption="Examples for /etc/conf.d/net">
275<comment>(For DHCP:)</comment>
276iface_eth0="dhcp"
277
278<comment>(For static IP:)</comment>
279iface_eth0="192.168.0.2 broadcast 192.168.0.255 netmask 255.255.255.0"
280gateway="eth0/192.168.0.1"
281</pre>
282
283<p>
284If you have several network interfaces, create extra <c>iface_eth</c> variables,
285like <c>iface_eth1</c>, <c>iface_eth2</c> etc. The <c>gateway</c> variable
286shouldn't be reproduced as you can only set one gateway per computer.
287</p>
288
289<p>
290Now save the configuration and exit to continue.
291</p>
292
293</body>
294</subsection>
295<subsection>
296<title>Automatically Start Networking at Boot</title>
297<body>
298
299<p>
300To have your network interfaces activated at boot, you need to add those to the
301default runlevel. If you have PCMCIA interfaces you should skip this action as
302the PCMCIA interfaces are started by the PCMCIA init script.
303</p>
304
305<pre caption="Adding net.eth0 to the default runlevel">
306# <i>rc-update add net.eth0 default</i>
307</pre>
308
309<p>
310If you have several network interfaces, you need to create the appropriate
311<path>net.eth1</path>, <path>net.eth2</path> etc. initscripts for those. You can
312use <c>ln</c> to do this:
313</p>
314
315<pre caption="Creating extra initscripts">
316# <i>cd /etc/init.d</i>
317# <i>ln -s net.eth0 net.eth1</i>
318# <i>rc-update add net.eth1 default</i>
319</pre>
320
321</body>
322</subsection>
323<subsection>
324<title>Writing Down Network Information</title>
325<body>
326
327<p>
328You now need to inform Linux about your network. This is defined in
329<path>/etc/hosts</path> and helps in resolving hostnames to IP addresses
330for hosts that aren't resolved by your nameserver. For instance, if your
331internal network consists of three PCs called <c>jenny</c> (192.168.0.5),
332<c>benny</c> (192.168.0.6) and <c>tux</c> (192.168.0.7 - this system) you would
333open <path>/etc/hosts</path> and fill in the values:
334</p>
335
336<pre caption="Opening /etc/hosts">
337# <i>nano -w /etc/hosts</i>
338</pre>
339
340<pre caption="Filling in the networking information">
341127.0.0.1 localhost
342192.168.0.5 jenny
343192.168.0.6 benny
344192.168.0.7 tux
345</pre>
346
347<p>
348If your system is the only system (or the nameservers handle all name
349resolution) a single line is sufficient:
350</p>
351
352<pre caption="/etc/hosts for lonely or fully integrated PCs">
353127.0.0.1 localhost tux
354</pre>
355
356<p>
357Save and exit the editor to continue.
358</p>
359
360<p>
361If you don't have PCMCIA, you can now continue with <uri
362link="#doc_chap4">System Information</uri>. PCMCIA-users should read the
363following topic on PCMCIA.
364</p>
365
366</body>
367</subsection>
368<subsection>
369<title>Optional: Get PCMCIA Working</title>
370<body>
371
372<p>
373PCMCIA-users should first install the <c>pcmcia-cs</c> package:
374</p>
375
376<pre caption="Installing pcmcia-cs">
377# <i>emerge --usepkg pcmcia-cs</i>
378</pre>
379
380<p>
381When <c>pcmcia-cs</c> is installed, add <c>pcmcia</c> to the <e>boot</e>
382runlevel:
383</p>
384
385<pre caption="Adding pcmcia to the boot runlevel">
386# <i>rc-update add pcmcia boot</i>
387</pre>
388
389</body>
390</subsection>
391</section>
392<section>
34<title>System Information</title> 393<title>System Information</title>
35<body> 394<body>
36 395
37<p> 396<p>
38<path>/etc/rc.conf</path> 397Gentoo uses <path>/etc/rc.conf</path> for general, system-wide configuration.
398Open up <path>/etc/rc.conf</path> and enjoy all the comments in that file :)
399</p>
400
401<pre caption="Opening /etc/rc.conf">
402# <i>nano -w /etc/rc.conf</i>
403</pre>
404
39</p> 405<p>
406As you can see, this file is well commented to help you set up the necessary
407configuration variables. When you're finished configuring
408<path>/etc/rc.conf</path>, save and exit to continue.
409</p>
40 410
41</body> 411</body>
42</subsection>
43</section> 412</section>
413</sections>

Legend:
Removed from v.1.1  
changed lines
  Added in v.1.14

  ViewVC Help
Powered by ViewVC 1.1.20