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

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

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1.13 - (show annotations) (download) (as text)
Sun Dec 7 12:15:17 2003 UTC (11 years ago) by swift
Branch: MAIN
Changes since 1.12: +2 -2 lines
File MIME type: application/xml
Fix typo

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: /home/cvsroot/gentoo/xml/htdocs/doc/en/handbook/hb-install-config.xml,v 1.12 2003/11/30 12:06:53 swift Exp $ -->
5
6 <sections>
7 <section>
8 <title>Timezone</title>
9 <body>
10
11 <p>
12 You now need to select your timezone so that your system knows where it is
13 located. Look for your timezone in <path>/usr/share/zoneinfo</path>, then make a
14 symlink 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>
21 </pre>
22
23 </body>
24 </section>
25 <section>
26 <title>Filesystem Information</title>
27 <subsection>
28 <title>What is fstab?</title>
29 <body>
30
31 <p>
32 Under 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,
36 etc.).
37 </p>
38
39 </body>
40 </subsection>
41 <subsection>
42 <title>Creating /etc/fstab</title>
43 <body>
44
45 <p>
46 <path>/etc/fstab</path> uses a special syntaxis. Every line consists of six
47 fields, separated by whitespace (space(s), tabs or a mixture). Each field has
48 its own meaning:
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>
82 So start <c>nano</c> (or your favorite editor) to create your
83 <path>/etc/fstab</path>:
84 </p>
85
86 <pre caption="Opening /etc/fstab">
87 # <i>nano -w /etc/fstab</i>
88 </pre>
89
90 <p>
91 Lets take a look at how we write down the options for the <path>/boot</path>
92 partition. 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>
95
96 <p>
97 In 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
99 be mounted automatically (<c>noauto</c>) but does need to be checked. So we
100 would 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>
108 Now, to improve performance, most users would want to add the <c>noatime</c>
109 option as mountoption, which results in a faster system since access times
110 aren'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>
118 If 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>
129 To 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
131 partitions 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
139 none /proc proc defaults 0 0
140 none /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
147 removable 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>
152 Now use the above example to create your <path>/etc/fstab</path>. If you are a
153 SPARC-user, you should add the following line to your <path>/etc/fstab</path>
154 too:
155 </p>
156
157 <pre caption="Adding openprom filesystem to /etc/fstab">
158 none /proc/openprom openpromfs defaults 0 0
159 </pre>
160
161 <p>
162 If 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">
166 none /proc/bus/usb usbfs defaults 0 0
167 </pre>
168
169 <p>
170 Reread your <path>/etc/fstab</path>, save and quit to continue.
171 </p>
172
173 </body>
174 </subsection>
175 </section>
176 <section>
177 <title>Networking Information</title>
178 <subsection>
179 <title>Hostname, Domainname etc.</title>
180 <body>
181
182 <p>
183 One of the choices the user has to make is name his PC. This seems to be quite
184 easy, but <e>lots</e> of users are having difficulties finding the appropriate
185 name for their Linux-pc. To speed things up, know that any name you choose can
186 be 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>
191 We 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>
199 Second 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>
207 If you have a NIS domain (if you don't know what that is, then you don't have
208 one), 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>
216 Now 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>
224 </subsection>
225 <subsection>
226 <title>Configuring your Network</title>
227 <body>
228
229 <p>
230 Before you get that "Hey, we've had that already"-feeling, you should remember
231 that the networking you set up in the beginning of the gentoo installation was
232 just for the installation. Right now you are going to configure networking for
233 your Gentoo system permanently.
234 </p>
235
236 <p>
237 All networking information is gathered in <path>/etc/conf.d/net</path>. It uses
238 a straightforward yet not intuitive syntax if you don't know how to setup
239 networking manually. But don't fear, we'll explain everything :)
240 </p>
241
242 <p>
243 First open <path>/etc/conf.d/net</path> with your favorite editor (<c>nano</c>
244 is 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>
252 The first variable you'll find is <c>iface_eth0</c>. It uses the following
253 syntax:
254 </p>
255
256 <pre caption="iface_eth0 syntaxis">
257 iface_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>
261 If you use DHCP (automatic IP retrieval), you should just set <c>iface_eth0</c>
262 to <c>dhcp</c>. However, if you need to setup your network manually and you're
263 not familiar with all the above terms, please read the section on <uri
264 link="?part=1&amp;chap=3#doc_chap4_sect3">Understanding Network
265 Terminology</uri> if you haven't done so already.
266 </p>
267
268 <p>
269 So 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
271 192.168.0.1:
272 </p>
273
274 <pre caption="Examples for /etc/conf.d/net">
275 <comment>(For DHCP:)</comment>
276 iface_eth0="dhcp"
277
278 <comment>(For static IP:)</comment>
279 iface_eth0="192.168.0.2 broadcast 192.168.0.255 netmask 255.255.255.0"
280 gateway="eth0/192.168.0.1"
281 </pre>
282
283 <p>
284 If you have several network interfaces, create extra <c>iface_eth</c> variables,
285 like <c>iface_eth1</c>, <c>iface_eth2</c> etc. The <c>gateway</c> variable
286 shouldn't be reproduced as you can only set one gateway per computer.
287 </p>
288
289 <p>
290 Now 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>
300 To have your network interfaces activated at boot, you need to add those to the
301 default runlevel. If you have PCMCIA interfaces you should skip this action as
302 the 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>
310 If 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
312 use <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>
328 You 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
330 for hosts that aren't resolved by your nameserver. For instance, if your
331 internal 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> (this system) you would
333 open <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">
341 127.0.0.1 tux.homenetwork localhost
342 192.168.0.5 jenny
343 192.168.0.56 benny
344 </pre>
345
346 <p>
347 If your system is the only system (or the nameservers handle all name
348 resolution) a single line is sufficient:
349 </p>
350
351 <pre caption="/etc/hosts for lonely or fully integrated PCs">
352 127.0.0.1 localhost tux
353 </pre>
354
355 <p>
356 Save and exit the editor to continue.
357 </p>
358
359 <p>
360 If you don't have PCMCIA, you can now continue with <uri
361 link="#doc_chap4">System Information</uri>. PCMCIA-users should read the
362 following topic on PCMCIA.
363 </p>
364
365 </body>
366 </subsection>
367 <subsection>
368 <title>Optional: Get PCMCIA Working</title>
369 <body>
370
371 <p>
372 PCMCIA-users should first install the <c>pcmcia-cs</c> package:
373 </p>
374
375 <pre caption="Installing pcmcia-cs">
376 # <i>emerge --usepkg pcmcia-cs</i>
377 </pre>
378
379 <p>
380 When <c>pcmcia-cs</c> is installed, add <c>pcmcia</c> to the <e>boot</e>
381 runlevel:
382 </p>
383
384 <pre caption="Adding pcmcia to the boot runlevel">
385 # <i>rc-update add pcmcia boot</i>
386 </pre>
387
388 </body>
389 </subsection>
390 </section>
391 <section>
392 <title>System Information</title>
393 <body>
394
395 <p>
396 Gentoo uses <path>/etc/rc.conf</path> for general, system-wide configuration.
397 Open up <path>/etc/rc.conf</path> and enjoy all the comments in that file :)
398 </p>
399
400 <pre caption="Opening /etc/rc.conf">
401 # <i>nano -w /etc/rc.conf</i>
402 </pre>
403
404 <p>
405 As you can see, this file is well commented to help you set up the necessary
406 configuration variables. When you're finished configuring
407 <path>/etc/rc.conf</path>, save and exit to continue.
408 </p>
409
410 </body>
411 </section>
412 </sections>

  ViewVC Help
Powered by ViewVC 1.1.20