/[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.4 - (hide annotations) (download) (as text)
Fri Oct 31 15:37:03 2003 UTC (10 years, 9 months ago) by swift
Branch: MAIN
Changes since 1.3: +3 -0 lines
File MIME type: application/xml
Add licensing to all seperate files, make as many links as possible relative instead of absolute

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

  ViewVC Help
Powered by ViewVC 1.1.20