/[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.8 - (hide annotations) (download) (as text)
Sat Nov 15 13:53:33 2003 UTC (10 years, 9 months ago) by swift
Branch: MAIN
Changes since 1.7: +2 -0 lines
File MIME type: application/xml
Add CVS information as comment

1 swift 1.4 <!-- 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 swift 1.8 <!-- $Header$ -->
5    
6 swift 1.2 <sections>
7 swift 1.1 <section>
8     <title>Timezone</title>
9     <body>
10    
11     <p>
12 swift 1.3 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 swift 1.1 </p>
16    
17 swift 1.3 <pre caption="Setting the timezone information">
18     # <i>ls /usr/share/zoneinfo</i>
19     <comment>(Suppose you want to use GTM:)</comment>
20 swift 1.6 # <i>ln -sf /usr/share/zoneinfo/GMT /etc/localtime</i>
21 swift 1.3 </pre>
22    
23 swift 1.1 </body>
24 swift 1.2 </section>
25     <section>
26 swift 1.1 <title>Filesystem Information</title>
27 swift 1.3 <subsection>
28     <title>What is fstab?</title>
29 swift 1.1 <body>
30    
31     <p>
32 swift 1.3 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 swift 1.1 </p>
38    
39     </body>
40 swift 1.3 </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, seperated 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-seperated.
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 swift 1.7 (required) and for your CD-ROM drive (and of course, if you have other
131 swift 1.3 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 swift 1.5 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 swift 1.3 </pre>
168    
169     <p>
170     Reread your <path>/etc/fstab</path>, save and quit to continue.
171     </p>
172    
173     </body>
174     </subsection>
175 swift 1.2 </section>
176     <section>
177 swift 1.1 <title>Networking Information</title>
178 swift 1.3 <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     </body>
216     </subsection>
217     <subsection>
218     <title>Configuring your Network</title>
219     <body>
220    
221     <p>
222     Before you get that "Hey, we've had that already"-feeling, you should remember
223     that the networking you set up in the beginning of the gentoo installation was
224     just for the installation. Right now you are going to configure networking for
225     your Gentoo system permanently.
226     </p>
227    
228     <p>
229     All networking information is gathered in <path>/etc/conf.d/net</path>. It uses
230     a straightforward yet not intuitive syntax if you don't know how to setup
231     networking manually. But don't fear, we'll explain everything :)
232     </p>
233    
234     <p>
235     First open <path>/etc/conf.d/net</path> with your favorite editor (<c>nano</c>
236     is used in this example):
237     </p>
238    
239     <pre caption="Opening /etc/conf.d/net for editing">
240     # <i>nano -w /etc/conf.d/net</i>
241     </pre>
242    
243     <p>
244     The first variable you'll find is <c>iface_eth0</c>. It uses the following
245     syntax:
246     </p>
247    
248     <pre caption="iface_eth0 syntaxis">
249     iface_eth0="<i>&lt;your ip address&gt;</i> broadcast <i>&lt;your broadcast address&gt;</i> netmask <i>&lt;your netmask&gt;</i>"
250     </pre>
251    
252     <p>
253     If you use DHCP (automatic IP retrieval), you should just set <c>iface_eth0</c>
254     to <c>dhcp</c>. However, if you need to setup your network manually and you're
255     not familiar with all the above terms, please read the section on <uri
256     link="?part=1&amp;chap=3#doc_chap4_sect3">Understanding Network
257     Terminology</uri> if you haven't done so already.
258     </p>
259    
260     <p>
261     So lets give two examples; the first one uses DHCP, the second one a static IP
262     (192.168.0.2) with netmask 255.255.255.0, broadcast 192.168.0.255 and gateway
263     192.168.0.1:
264     </p>
265    
266     <pre caption="Examples for /etc/conf.d/net">
267     <comment>(For DHCP:)</comment>
268     iface_eth0="dhcp"
269    
270     <comment>(For static IP:)</comment>
271     iface_eth0="192.168.0.2 broadcast 192.168.0.255 netmask 255.255.255.0"
272     gateway="eth0/192.168.0.1"
273     </pre>
274    
275     <p>
276     If you have several network interfaces, create extra <c>iface_eth</c> variables,
277     like <c>iface_eth1</c>, <c>iface_eth2</c> etc. The <c>gateway</c> variable
278     shouldn't be reproduced as you can only set one gateway per computer.
279     </p>
280    
281     <p>
282     Now save the configuration and exit to continue.
283     </p>
284    
285     </body>
286     </subsection>
287     <subsection>
288     <title>Automatically Start Networking at Boot</title>
289 swift 1.1 <body>
290    
291     <p>
292 swift 1.3 To have your network interfaces activated at boot, you need to add those to the
293     default runlevel. If you have PCMCIA interfaces you should skip this action as
294     the PCMCIA interfaces are started by the PCMCIA init script.
295     </p>
296    
297     <pre caption="Adding net.eth0 to the default runlevel">
298     # <i>rc-update add net.eth0 default</i>
299     </pre>
300    
301     <p>
302     If you have several network interfaces, you need to create the appropriate
303     <path>net.eth1</path>, <path>net.eth2</path> etc. initscripts for those. You can
304     use <c>ln</c> to do this:
305 swift 1.1 </p>
306    
307 swift 1.3 <pre caption="Creating extra initscripts">
308     # <i>cd /etc/init.d</i>
309     # <i>ln -s net.eth0 net.eth1</i>
310     # <i>rc-update add net.eth1 default</i>
311     </pre>
312    
313 swift 1.1 </body>
314 swift 1.3 </subsection>
315     <subsection>
316     <title>Writing Down Network Information</title>
317     <body>
318    
319     <p>
320     You now need to inform Linux about your network. This is defined in
321     <path>/etc/hosts</path> and helps in resolving hostnames to IP addresses
322     for hosts that aren't resolved by your nameserver. For instance, if your
323     internal network consists of three PCs called <c>jenny</c> (192.168.0.5),
324     <c>benny</c> (192.168.0.6) and <c>tux</c> (this system) you would
325     open <path>/etc/hosts</path> and fill in the values:
326     </p>
327    
328     <pre caption="Opening /etc/hosts">
329     # <i>nano -w /etc/hosts</i>
330     </pre>
331    
332     <pre caption="Filling in the networking information">
333 swift 1.5 127.0.0.1 tux.homenetwork localhost
334 swift 1.3 192.168.0.5 jenny
335     192.168.0.56 benny
336     </pre>
337    
338     <p>
339     If your system is the only system (or the nameservers handle all name
340     resolution) a single line is sufficient:
341     </p>
342    
343     <pre caption="/etc/hosts for lonely or fully integrated PCs">
344     127.0.0.1 localhost tux
345     </pre>
346    
347     <p>
348     Save and exit the editor to continue.
349     </p>
350    
351     <p>
352     If you don't have PCMCIA, you can now continue with <uri
353     link="#doc_chap4">System Information</uri>. PCMCIA-users should read the
354     following topic on PCMCIA.
355     </p>
356    
357     </body>
358     </subsection>
359     <subsection>
360     <title>Optional: Get PCMCIA Working</title>
361     <body>
362    
363     <p>
364     PCMCIA-users should first install the <c>pcmcia-cs</c> package:
365     </p>
366    
367     <pre caption="Installing pcmcia-cs">
368     # <i>emerge -k pcmcia-cs</i>
369     </pre>
370    
371     <p>
372     When <c>pcmcia-cs</c> is installed, add <c>pcmcia</c> to the <e>boot</e>
373     runlevel:
374     </p>
375    
376     <pre caption="Adding pcmcia to the default runlevel">
377     # <i>rc-update add pcmcia boot</i>
378     </pre>
379    
380     </body>
381     </subsection>
382 swift 1.2 </section>
383     <section>
384 swift 1.1 <title>System Information</title>
385     <body>
386    
387     <p>
388 swift 1.3 Gentoo uses <path>/etc/rc.conf</path> for general, system-wide configuration.
389     Open up <path>/etc/rc.conf</path> and enjoy all the comments in that file :)
390     </p>
391    
392     <pre caption="Opening /etc/rc.conf">
393     # <i>nano -w /etc/rc.conf</i>
394     </pre>
395    
396     <p>
397     As you can see, this file is well commented to help you set up the necessary
398     configuration variables. When you're finished configuring
399     <path>/etc/rc.conf</path>, save and exit to continue.
400 swift 1.1 </p>
401    
402     </body>
403     </section>
404 swift 1.2 </sections>

  ViewVC Help
Powered by ViewVC 1.1.20