/[gentoo]/xml/htdocs/doc/en/gentoo-x86-install.xml
Gentoo

Contents of /xml/htdocs/doc/en/gentoo-x86-install.xml

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1.146 - (hide annotations) (download) (as text)
Wed Aug 6 08:47:24 2003 UTC (14 years, 2 months ago) by avenj
Branch: MAIN
Changes since 1.145: +52 -55 lines
File MIME type: application/xml
Necessary doc fixes

1 zhen 1.16 <?xml version="1.0" encoding="UTF-8"?>
2 drobbins 1.1 <!DOCTYPE guide SYSTEM "/dtd/guide.dtd">
3 zhen 1.3 <guide link="/doc/en/gentoo-x86-install.xml">
4 swift 1.142 <title>Gentoo Linux 1.4 Installation Instructions</title>
5 zhen 1.16 <author title="Chief Architect">
6     <mail link="drobbins@gentoo.org">Daniel Robbins</mail>
7     </author>
8     <author title="Author">Chris Houser</author>
9 swift 1.142 <author title="Author">Jerry Alexandratos</author>
10 zhen 1.16 <author title="Ghost">
11     <mail link="g2boojum@gentoo.org">Grant Goodyear</mail>
12     </author>
13     <author title="Editor">
14     <mail link="zhen@gentoo.org">John P. Davis</mail>
15     </author>
16     <author title="Editor">
17     <mail link="Pierre-Henri.Jondot@wanadoo.fr">Pierre-Henri Jondot</mail>
18     </author>
19     <author title="Editor">
20     <mail link="stocke2@gentoo.org">Eric Stockbridge</mail>
21     </author>
22     <author title="Editor">
23     <mail link="rajiv@gentoo.org">Rajiv Manglani</mail>
24     </author>
25 seo 1.41 <author title="Editor">
26     <mail link="seo@gentoo.org">Jungmin Seo</mail>
27     </author>
28 zhware 1.43 <author title="Editor">
29     <mail link="zhware@gentoo.org">Stoyan Zhekov</mail>
30     </author>
31 jhhudso 1.75 <author title="Editor">
32     <mail link="jhhudso@gentoo.org">Jared Hudson</mail>
33     </author>
34     <author title="Editor">
35     <mail link="">Colin Morey</mail>
36 drobbins 1.97 </author>
37 peesh 1.96 <author title="Editor">
38     <mail link="peesh@gentoo.org">Jorge Paulo</mail>
39 jhhudso 1.75 </author>
40 carl 1.101 <author title="Editor">
41     <mail link="carl@gentoo.org">Carl Anderson</mail>
42     </author>
43 swift 1.142 <author title="Editor, Reviewer">
44     <mail link="swift@gentoo.org">Sven Vermeulen</mail>
45     </author>
46 swift 1.112 <author title="Editor">
47 swift 1.142 <mail link="avenj@gentoo.org">Jon Portnoy</mail>
48     </author>
49     <author title="Reviewer">
50     <mail link="gerrynjr@gentoo.org">Gerald J. Normandin Jr.</mail>
51     </author>
52     <author title="Reviewer">
53     <mail link="spyderous@gentoo.org">Donnie Berkholz</mail>
54 swift 1.112 </author>
55 zhen 1.16 <abstract>These instructions step you through the process of installing Gentoo
56 swift 1.142 Linux 1.4, release version (not _rc versions.) The Gentoo Linux installation process supports various installation
57 zhen 1.6 approaches, depending upon how much of the system you want to custom-build from
58     scratch.
59     </abstract>
60 swift 1.141
61     <license/>
62    
63 avenj 1.146 <version>2.6.4</version>
64     <date>6th of August 2003</date>
65 zhen 1.16 <chapter>
66     <title>About the Install</title>
67     <section>
68     <body>
69 swift 1.142 <p>First, if you are new to this, welcome to Gentoo Linux! Gentoo
70     Linux can be installed in many different ways. Those who are looking
71     for a rapid install can use pre-built packages, while those who want
72     the ultimate in customizability can compile Gentoo Linux entirely
73     from the original source code. The method you choose is up to
74     you.</p>
75    
76     <p>One significant change in relation to the official 1.4 release is
77     our new 2-CD installation set, which can be ordered from <uri
78     link="http://store.gentoo.org">The Gentoo Linux Store</uri>, in
79     addition to being available on our mirrors. We currently have 2-CD
80     installation sets for x86 (486 and above), i686 (Pentium Pro,
81     Pentium II, Athlon/Duron and above), Pentium III, Pentium 4, and Athlon XP.
82     To see what 2-CD set is right for you, read the detailed
83     descriptions of each product in the <uri
84     link="http://store.gentoo.org">store</uri>. The store descriptions
85     contain fairly comprehensive CPU compatibility information.</p>
86    
87     <p>So, about the 2 CD set -- here's what's on each CD. The first
88     CD ("CD 1") is called "Live CD Installation," and is a bootable CD-ROM,
89     meaning that you can put "CD 1" in your drive and run Gentoo Linux
90     directly from the CD. You can then use this CD-based version of
91     Gentoo to install Gentoo Linux 1.4 to your hard disk. In addition
92     to containing a bootable Gentoo Linux environment, every CD 1
93     contains everything you need to install Gentoo Linux quickly, even
94     without a connection to the Internet. In addition, several
95     pre-compiled packages are also included on CD 1, such as the
96     ever-important XFree86 X server. If you have an ISO CD-ROM image
97     file for CD 1, its name will end in "-cd1.iso".</p>
98    
99     <p>In contrast, the second CD ("CD 2") isn't bootable, and contains
100     lots of pre-built packages for your system. Included on this CD are
101     optimized versions of packages such as KDE, GNOME, OpenOffice,
102     Mozilla, Evolution, and others. CD 2 is <i>optional</i> and is
103     intended for those people who are interested in installing Gentoo
104     Linux very quickly. The packages included on CD 2 typically take
105     about 36 hours to compile from source on a typical modern
106     single-processor system. If you have an ISO CD-ROM image file for CD
107     2, its name will end in "-cd2.iso". </p>
108    
109     <note>A complete Gentoo Linux 2-CD set contains the Gentoo Reference
110     Platform, which is a complete pre-built Gentoo Linux system including GNOME,
111     KDE, Mozilla, and OpenOffice. The Gentoo Reference Platform ("GRP")
112     was created to allow rapid Gentoo Linux installs
113     packages for those who need this capability. The "compile from
114     source" functionality, which is the cornerstone of Gentoo Linux,
115     will always be a fully-supported installation option as well. The
116     purpose of the GRP is to make Gentoo Linux more convenient for some
117     users, without impacting Gentoo's powerful "compile from source"
118     installation process in any way.</note>
119    
120     <p>In addition to our 2-CD set, we also have a very small "basic"
121     Live CD that you can use to boot your system. Once your system has
122     booted, you can configure a connection to the Internet and then
123     install Gentoo over the network. The advantage of this "basic" CD is
124     that it is small, and thus the ISO CD-ROM image file can be
125     downloaded quickly. If you're an advanced user who wants to install
126     the most up-to-date version of Gentoo Linux available, and have a
127     fast network connection, then you may prefer this option. If you
128     have an ISO CD-ROM image file for our "basic" Live CD, its name will
129     end in "-basic.iso".</p>
130 drobbins 1.70
131 swift 1.142 <p>To use any Gentoo Linux CD-based installation method, you will
132     need to have a 486+ processor and ideally at least 64 Megabytes of
133     RAM. (Gentoo Linux has been successfully built with 64MB of RAM +
134     64MB of swap space, but the build process is awfully slow under
135     those conditions.)</p>
136    
137     <p>Once you boot one of our Live CDs, you have even more options.
138     Gentoo Linux can be installed using one of three &quot;stage&quot;
139     tarball files. The one you choose depends on how much of the system
140     you want to compile yourself. The stage1 tarball is used when you
141     want to bootstrap and build the entire system from scratch. The
142     stage2 tarball is used for building the entire system from a
143     bootstrapped "semi-compiled" state. The stage3 tarball already
144     contains a basic Gentoo Linux system that has been built for
145     you. If you are interested in doing a "GRP" install, then the
146     stage3 tarball should be used.</p>
147    
148     <p><b>If you're not doing a GRP install, should you start from a stage1, stage2, or
149     stage3 tarball?</b> Here is some information that should help you
150     make this decision.
151     Starting from a stage1 allows you to have total
152     control over the optimization settings and optional build-time
153     functionality that is initially enabled on your system. This makes
154     stage1 installs good for power users who know what they are doing.
155 avenj 1.146 It is also a great installation method for those who want to more
156     about the inner workings of Gentoo Linux.</p>
157 swift 1.142
158     <p>
159     Stage2 installs allow you to skip the bootstrap process, and doing
160     this is fine if you are happy with the optimization settings that we
161     chose for your particular stage2 tarball. And choosing to go with a
162     stage3 allows for the fastest install of Gentoo Linux, but also
163     means that your base system will have the optimization settings that
164     we chose for you (which to be honest, are good settings and were
165     carefully chosen to enhance performance while maintaining
166     stability.) Since major releases of Gentoo Linux have stage3's
167     specifically optimized for various popular processors, starting
168     from a stage3 can offer the best of all worlds -- a fast install
169     and a system that is well-optimized.
170     <b>If you're installing Gentoo Linux for the
171     first time, consider using a stage3 tarball for
172     installation, or a stage3 with GRP.</b></p>
173 drobbins 1.70
174 swift 1.142 <note><b>Advanced users:</b> if you use a stage3 install, you should not
175     change the default CHOST setting in make.conf. If you need to make
176     such a change, you should start with a stage1 tarball and build up
177     your system with the desired CHOST setting. The CHOST setting
178     typically looks something like this:
179     <c>i686-pc-linux-gnu</c>.</note>
180    
181 drobbins 1.70 <impo>If you encounter a problem with any part of the install and wish to
182 drobbins 1.21 report it as a bug, report it to <uri>http://bugs.gentoo.org</uri>. If the bug
183 jhhudso 1.75 needs to be sent upstream to the original software developers (eg the KDE team) the
184 drobbins 1.70 <e>Gentoo Linux developers</e> will take care of that for you.
185     </impo>
186 swift 1.142
187     <note>Another note: the installation instructions in the LiveCD may not
188     be as up-to-date as our Web documentation at
189     <uri>http://www.gentoo.org/doc/en/gentoo-x86-install.xml</uri>. Refer to
190     our Web documentation for the most up-to-date
191 peesh 1.127 installation instructions.
192     </note>
193 swift 1.142
194    
195    
196     <p>Now, let us quickly review the install process. First, we will
197     download, burn CD(s),
198 jhhudso 1.75 and boot a LiveCD. After getting a root prompt, we will create partitions, create
199 drobbins 1.21 our filesystems, and extract either a stage1, stage2 or stage3 tarball. If we
200     are using a stage1 or stage2 tarball, we will take the appropriate steps to get
201 jhhudso 1.75 our system to stage3. Once our system is at stage3, we can configure it
202 swift 1.142 (customize configuration files, install a boot loader, etc), boot it and have a
203     fully-functional Gentoo Linux system. After your basic Gentoo Linux system
204     is running, you can optionally use "CD 2" of our 2-CD set and install any
205     number of pre-built packages such as KDE, GNOME, OpenOffice, Mozilla, or
206     others that you'd like on your system.
207     </p>
208     <p>Depending on what stage of the build
209 jhhudso 1.75 process you're starting from, here is what is required for installation: </p>
210 zhen 1.26 <table>
211 zhen 1.16 <tr>
212     <th>stage tarball</th>
213 swift 1.142 <th>Internet access required</th>
214     <th>Media required</th>
215     <th>steps</th>
216 zhen 1.16 </tr>
217     <tr>
218     <ti>1</ti>
219 swift 1.142 <ti>Yes</ti>
220     <ti>"basic" or "CD 1"</ti>
221     <ti>partition/filesystem setup, emerge sync, bootstrap, emerge system, final config</ti>
222 zhen 1.16 </tr>
223     <tr>
224     <ti>2</ti>
225 swift 1.142 <ti>Yes</ti>
226     <ti>"basic" or "CD 1"</ti>
227     <ti>partition/filesystem setup, emerge sync, emerge system, final config</ti>
228 zhen 1.16 </tr>
229     <tr>
230     <ti>3</ti>
231 swift 1.142 <ti>No if using "CD 1", Yes otherwise</ti>
232     <ti>"basic" or "CD 1"</ti>
233     <ti>partition/filesystem setup, emerge sync (not required if
234     using "CD 1"), final config</ti>
235 zhen 1.16 </tr>
236 swift 1.142 <tr>
237     <ti>3+GRP</ti>
238     <ti>No</ti>
239     <ti>"CD 1", optionally "CD 2"</ti>
240     <ti>partition/filesystem setup, final config, install CD 1
241     pre-built packages (optional), reboot,
242     install extra pre-built packages like KDE and GNOME (if using
243     "CD 2").</ti>
244     </tr>
245     </table>
246 swift 1.137 <note>Hardware ATA RAID users should read the section about
247     ATA RAID on the bottom of this document before proceeding.
248     </note>
249 zhen 1.16 </body>
250     </section>
251     </chapter>
252     <chapter>
253     <title>Booting</title>
254     <section>
255     <body>
256 swift 1.134 <warn>Read this whole section before proceeding, especially the
257     available boot options. Ignoring this could lead to wrong
258     keyboard settings, unstarted pcmcia services etc.</warn>
259 swift 1.142
260     <p>Start by booting your Live CD of choice. You should see a fancy
261     boot screen with the Gentoo Linux logo on it. At this screen, you
262     can hit Enter to begin the boot process, or boot the LiveCD with
263     custom boot options by specifying a kernel followed by boot options
264     and then hitting Enter. For example <c>gentoo nousb nohotplug</c>.
265     If you are installing Gentoo Linux on a system with more than one
266     processor ("SMP",) then you should type <c>smp</c> instead of
267     <c>gentoo</c> at the prompt. This will allow the LiveCD to see all
268     the processors in your system, not just the first one.</p>
269    
270     <p>
271     Consult the following table for a partial list of available kernels and
272     options or press F2 and F3 to view the help screens.</p>
273    
274     <table>
275 antifa 1.105 <tr>
276 swift 1.142 <th>Available kernels</th>
277 antifa 1.105 <th>description</th>
278     </tr>
279    
280 swift 1.142 <tr><ti>gentoo</ti><ti>standard gentoo kernel (default)</ti></tr>
281 antifa 1.105 <tr><ti>nofb</ti><ti>framebuffer mode disabled</ti></tr>
282     <tr><ti>smp</ti><ti>loads a smp kernel in noframebuffer mode</ti></tr>
283     <tr><ti>acpi</ti><ti>enables acpi=on + loads acpi modules during init</ti></tr>
284     <tr><ti>memtest</ti><ti>boots the memory testing program</ti></tr>
285    
286     </table>
287 swift 1.142
288 antifa 1.105 <p>
289     <table>
290     <tr>
291 swift 1.142 <th>Available boot options</th>
292 antifa 1.105 <th>description</th>
293     </tr>
294 antifa 1.106
295     <tr><ti>doataraid</ti>
296     <ti>loads ide raid modules from initrd</ti></tr>
297 antifa 1.105
298 antifa 1.106 <tr><ti>dofirewire</ti>
299     <ti>modprobes firewire modules in initrd (for firewire cdroms,etc)</ti></tr>
300    
301     <tr><ti>dokeymap</ti>
302     <ti>enable keymap selection for non-us keyboard layouts</ti></tr>
303    
304     <tr><ti>dopcmcia</ti>
305     <ti>starts pcmcia service</ti></tr>
306    
307 antifa 1.105 <tr><ti>doscsi</ti>
308     <ti>scan for scsi devices (breaks some ethernet cards)</ti></tr>
309    
310 antifa 1.106 <tr><ti>noapm</ti>
311     <ti>disables apm module load</ti></tr>
312    
313 antifa 1.105 <tr><ti>nodetect</ti>
314     <ti>causes hwsetup/kudzu and hotplug not to run</ti></tr>
315    
316     <tr><ti>nodhcp</ti>
317     <ti>dhcp does not automatically start if nic detected</ti></tr>
318    
319 antifa 1.106 <tr><ti>nohotplug</ti>
320     <ti>disables loading hotplug service</ti></tr>
321 antifa 1.105
322     <tr><ti>noraid</ti>
323     <ti>disables loading of evms modules</ti></tr>
324    
325 antifa 1.106 <tr><ti>nousb</ti>
326     <ti>disables usb module load from initrd, disables hotplug</ti></tr>
327 antifa 1.105
328     <tr><ti>ide=nodma</ti>
329     <ti>Force disabling of dma for malfunctioning ide devices</ti></tr>
330    
331     <tr><ti>cdcache</ti>
332     <ti>Cache the entire runtime portion of cd in ram, This uses 40mb of RAM , but allows you to umount /mnt/cdrom and mount another cdrom.</ti></tr>
333    
334     </table></p>
335 drobbins 1.70
336 swift 1.142
337     <p>Once you hit Enter, you will be greeted with an even fancier boot
338 avenj 1.146 screen and progress bar:</p>
339 swift 1.142
340     <figure link="/images/install/livecd-1.4-boot.png" caption="The Gentoo
341     Linux Live CD booting" />
342 avenj 1.146
343 swift 1.142
344     <p>Once the boot process completes, you will be automatically logged in
345     to the "Live" Gentoo Linux as
346     &quot;<c>root</c>&quot;, the "super user." You should have a root (&quot;<c>#</c>&quot;) prompt
347 seemant 1.78 on the current console, and can also switch to other consoles by pressing
348 jhhudso 1.75 Alt-F2, Alt-F3 and Alt-F4. Get back to the one you started on by pressing
349 avenj 1.146 Alt-F1. The console will look like this:</p>
350 swift 1.142
351     <figure link="/images/install/livecd-1.4-con.png" caption="The Gentoo
352     Linux Live CD console" />
353 swift 1.144
354 swift 1.142 <note><b>Advanced users:</b> When the Live CD boots, the Live CD root password is
355     set to a random string for security purposes. If you plan to start
356     <c>sshd</c> to allow remote logins to your Live CD, you should set the Live
357     CD root password now by typing <c>passwd</c> and following the prompts.
358     Otherwise, you will not know the proper password for logging into the Live
359     CD over the network. </note>
360    
361 zhen 1.26 <p>You've probably also noticed that above your <c>#</c> prompt is a bunch of help text
362 drobbins 1.70 that explains how to do things like configure your Linux networking and telling you where you can find
363 drobbins 1.21 the Gentoo Linux stage tarballs and packages on your CD.
364 zhen 1.6 </p>
365 zhen 1.16 </body>
366     </section>
367     </chapter>
368     <chapter>
369 swift 1.142 <title>Optional hardware configuration</title>
370 zhen 1.16 <section>
371     <body>
372 swift 1.142 <p>When the Live CD boots, it tries to detect all your hardware
373     devices and loads the appropiate kernel modules to support your
374     hardware. In the vast majority of cases, it does a very good job.
375     However, in some cases, it may not auto-load the kernel modules
376     you need. If the PCI auto-detection missed some of your system's hardware, you
377 jhhudso 1.75 will have to load the appropriate kernel modules manually.
378 zhen 1.6 To view a list of all available network card modules, type <c>ls
379 swift 1.142 /lib/modules/`uname -r`/kernel/drivers/net/*</c>. To load a particular module,
380 zhen 1.6 type:
381     </p>
382 jhhudso 1.81 <pre caption="PCI Modules Configuration">
383 drobbins 1.1 # <c>modprobe pcnet32</c>
384 zhen 1.6 <comment>(replace pcnet32 with your NIC module)</comment>
385 jhhudso 1.81 </pre>
386 drobbins 1.70 <p>Likewise, if you want to be able to access any SCSI hardware that wasn't detected
387 jhhudso 1.75 during the initial boot autodetection process, you will need to load the appropriate
388 zhen 1.6 modules from /lib/modules, again using <c>modprobe</c>:
389     </p>
390 jhhudso 1.81 <pre caption="Loading SCSI Modules">
391 drobbins 1.1 # <c>modprobe aic7xxx</c>
392 jhhudso 1.73 <comment>(replace aic7xxx with your SCSI adapter module)</comment>
393 drobbins 1.1 # <c>modprobe sd_mod</c>
394 jhhudso 1.73 <comment>(sd_mod is the module for SCSI disk support)</comment>
395 jhhudso 1.81 </pre>
396 zhen 1.6 <note>
397 swift 1.142 Support for SCSI CD-ROMs and disks are built-in in the kernel.
398 zhen 1.52 </note>
399 swift 1.142
400     <note><b>Advanced users:</b> The Gentoo LiveCD should have enabled DMA
401     on your disks so that disk transfers are as fast as possible, but if it did not,
402     <c>hdparm</c> can be used to set DMA on your drives as follows:
403     <pre caption="Setting DMA">
404 jhhudso 1.81 <comment>Replace hdX with your disk device.</comment>
405 drobbins 1.21 # hdparm -d 1 /dev/hdX <comment>Enables DMA </comment>
406 jhhudso 1.75 # hdparm -d1 -A1 -m16 -u1 -a64 /dev/hdX
407     <comment>(Enables DMA and other safe performance-enhancing options)</comment>
408     # hdparm -X66 /dev/hdX
409     <comment>(Force-enables Ultra-DMA -- dangerous -- may cause some drives to mess up)</comment>
410     </pre>
411 swift 1.142 </note>
412    
413    
414     </body>
415 zhen 1.16 </section>
416     </chapter>
417     <chapter>
418 swift 1.142 <title>Optional Networking configuration</title>
419 drobbins 1.70 <section>
420     <title>Maybe it just works?</title>
421     <body>
422 swift 1.142 <p>If your system is plugged into an Ethernet network, it is very
423     likely that your networking configuration has already been
424     set up automatically for you. If so, you should be able to take advantage of the many included
425 drobbins 1.70 network-aware commands on the LiveCD such as <c>ssh</c>, <c>scp</c>, <c>ping</c>, <c>irssi</c>, <c>wget</c> and <c>lynx</c>,
426     among others.</p>
427    
428     <p>If networking has been configured for you, the <c>/sbin/ifconfig</c> command should
429     list some internet interfaces besides <c>lo</c>, such as <c>eth0</c>:
430     </p>
431 jhhudso 1.81 <pre caption="/sbin/ifconfig for a working network card">
432 drobbins 1.70 eth0 Link encap:Ethernet HWaddr 00:50:BA:8F:61:7A
433     inet addr:192.168.0.2 Bcast:192.168.0.255 Mask:255.255.255.0
434     inet6 addr: fe80::50:ba8f:617a/10 Scope:Link
435     UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
436     RX packets:1498792 errors:0 dropped:0 overruns:0 frame:0
437     TX packets:1284980 errors:0 dropped:0 overruns:0 carrier:0
438     collisions:1984 txqueuelen:100
439     RX bytes:485691215 (463.1 Mb) TX bytes:123951388 (118.2 Mb)
440     Interrupt:11
441 jhhudso 1.81 </pre>
442 drobbins 1.70 <p>You may want to also try pinging your ISP's DNS server (found in <path>/etc/resolv.conf</path>),
443     and a Web site of choice, just to make sure that your packets are reaching the net, DNS name
444     resolution is working correctly, etc.
445     </p>
446 jhhudso 1.81 <pre caption="Further Network Testing">
447 drobbins 1.94 # <c>ping -c 3 www.yahoo.com </c>
448 jhhudso 1.81 </pre>
449 drobbins 1.70 <p>Are you able to use your network? If so, you can skip the rest of this section.</p>
450     </body>
451     </section>
452 zhen 1.16 <section>
453     <title> PPPoE configuration</title>
454     <body>
455 drobbins 1.70 <p>Assuming you need PPPoE to connect to the internet, the LiveCD (any version) has
456 drobbins 1.21 made things easy for you by including <c>rp-pppoe</c>. Use the provided <c>adsl-setup</c>
457 zhen 1.6 script to configure your connection. You will be prompted for the ethernet
458     device that is connected to your adsl modem, your username and password,
459     the IPs of your DNS servers, and if you need a basic firewall or not. </p>
460 jhhudso 1.81 <pre caption="Configuring PPPoE">
461 zhen 1.6 # <c> adsl-setup </c>
462     # <c> adsl-start </c>
463 jhhudso 1.81 </pre>
464 drobbins 1.70 <p>If something goes wrong, double-check that you correctly typed
465 zhen 1.6 your username and password by looking at <path>/etc/ppp/pap-secrets</path> or
466     <path>/etc/ppp/chap-secrets</path>, and make sure you are using the right ethernet device. </p>
467 zhen 1.16 </body>
468     </section>
469     <section>
470     <title> Automatic Network Configuration </title>
471     <body>
472 drobbins 1.70 <p>The simplest way to set up networking if it didn't get configured automatically is to run the <c>net-setup</c> script.</p>
473 jhhudso 1.81 <pre caption="Net-Setup Script">
474 drobbins 1.1 # <c>net-setup eth0</c>
475 jhhudso 1.81 </pre>
476 drobbins 1.70 <p>Of course, if you prefer, you may still set up networking manually. This is covered next.</p>
477 zhen 1.16 </body>
478     </section>
479     <section>
480     <title>Manual DHCP Configuration</title>
481     <body>
482     <p>Network configuration is simple with DHCP; If your ISP is not using
483     DHCP, skip down to the static configuration section below. </p>
484 jhhudso 1.81 <pre caption="Network configuration with DHCP">
485     # <c>dhcpcd eth0</c>
486     </pre>
487 zhen 1.16 <note>Some ISPs require you to provide a hostname. To do that,
488 zhen 1.6 add a <c>-h myhostname</c> flag to the dhcpcd command line above.
489     </note>
490 zhen 1.16 <p>If you receive <i>dhcpConfig</i> warnings, don't panic; the errors
491 zhen 1.6 are most likely cosmetic. Skip down to Network testing below.</p>
492 zhen 1.16 </body>
493     </section>
494     <section>
495     <title>Manual Static Configuration</title>
496     <body>
497     <p>We need to setup just enough networking so that we can download
498 swift 1.117 sources for the system build, as well as the required localhost interface. The needed information is explained in the next table.</p>
499    
500     <table>
501     <tr><th>Information</th><th>Description</th><th>Example value</th></tr>
502 swift 1.142 <tr><ti>IP address</ti><ti>The IP address you want to assign to your network card</ti><ti>192.168.1.2</ti></tr>
503     <tr><ti>Broadcast address</ti><ti>The IP address which will broadcast the packets to all the hosts in the network.</ti><ti>192.168.1.255</ti></tr>
504 swift 1.117 <tr><ti>Network mask</ti><ti>The mask which is used together with the IP address to see what part of the address is for network-identification and host-identification</ti><ti>255.255.255.0</ti></tr>
505 swift 1.142 <tr><ti>Gateway</ti><ti>The IP address of the computer which will forward the packets that are not meant for the local network (most of the time the computer which shares the internet connection)</ti><ti>192.168.1.1</ti></tr>
506 swift 1.117 </table>
507    
508     <p>Type in the following commands, replacing
509 zhen 1.6 $IFACE with your network interface (typically <c>eth0</c>), $IPNUM
510     with your IP address, $BCAST with your broadcast address, and $NMASK
511     with your network mask. For the <c>route</c> command, replace
512     $GTWAY with your default gateway.
513     </p>
514 jhhudso 1.81 <pre caption="Static IP Network Configuration">
515 drobbins 1.1 # <c>ifconfig $IFACE $IPNUM broadcast $BCAST netmask $NMASK</c>
516 swift 1.117 # <c>/sbin/route add -net default gw $GTWAY netmask 0.0.0.0 metric 1 $IFACE</c>
517 jhhudso 1.81 </pre>
518 jhhudso 1.75 <p>Now it is time to create the <path>/etc/resolv.conf</path>
519 swift 1.115 file so that name resolution (finding Web/FTP sites by name, rather
520     than just by IP address) will work. You can use <c>nano -w
521     /etc/resolv.conf</c> to create <path>/etc/resolv.conf</path>.
522     <c>nano</c> is a small and easy-to-use editor.</p>
523 jhhudso 1.75 <p>Here is a template to follow for creating your /etc/resolv.conf file: </p>
524 jhhudso 1.81 <pre caption="/etc/resolv.conf template">
525 drobbins 1.1 domain mydomain.com
526     nameserver 10.0.0.1
527     nameserver 10.0.0.2
528 jhhudso 1.81 </pre>
529 zhen 1.16 <p>Replace <c>10.0.0.1</c> and <c>10.0.0.2</c> with the IP addresses of your
530 zhen 1.6 primary and secondary DNS servers respectively.</p>
531 zhen 1.16 </body>
532     </section>
533     <section>
534     <title>Proxy Configuration</title>
535     <body>
536 swift 1.115 <p>If you are behind a proxy, it could be necessary to configure your proxy before
537 peesh 1.104 you continue. We will export some variables to set up the proxy accordingly.
538 zhen 1.6 </p>
539 jhhudso 1.81 <pre caption="Setting a Proxy">
540 swift 1.115 <codenote>If the proxy restricts HTTP traffic:</codenote>
541 zhen 1.16 # <c>export http_proxy=&quot;machine.company.com:1234&quot; </c>
542 swift 1.115 <codenote>If the proxy restricts FTP traffic:</codenote>
543     # <c>export ftp_proxy=&quot;machine.company.com&quot; </c>
544     <codenote>If the proxy restricts RSYNC traffic:</codenote>
545     # <c>export RSYNC_PROXY=&quot;machine.company.com&quot; </c>
546 jhhudso 1.81 </pre>
547 zhen 1.16 </body>
548     </section>
549 drobbins 1.70 <section>
550 zhen 1.16 <title>Networking is go!</title>
551     <body>
552 seemant 1.78 <p>Networking should now be configured and usable. You should be able to use the included
553 drobbins 1.21 <c>ssh</c>, <c>scp</c>, <c>lynx</c>, <c>irssi</c> and <c>wget</c> commands to connect to other machines on your LAN or the Internet.</p>
554 zhen 1.16 </body>
555     </section>
556     </chapter>
557     <chapter>
558 jhhudso 1.81 <title>Setting your system's date and time</title>
559     <section>
560     <body>
561     <p>Now you need to set your system's date and time.
562     You can do this using the <c>date</c> command.</p>
563     <pre caption="Setting your system's date">
564     # <c>date</c>
565     Thu Feb 27 09:04:42 CST 2003
566     <comment>(If your date is wrong, set your date with this next command)</comment>
567     # <c>date 022709042003</c>
568     <comment>(date MMDDhhmmCCYY)</comment>
569     </pre>
570     </body>
571     </section>
572     </chapter>
573     <chapter>
574 drobbins 1.86 <title>Filesystems, partitions and block devices</title>
575 zhen 1.16 <section>
576 drobbins 1.86 <title>Introduction to block devices</title>
577 zhen 1.16 <body>
578 drobbins 1.86 <p>
579     In this section, we'll take a good look at disk-oriented aspects of Gentoo Linux and Linux in general, including
580 peesh 1.99 Linux filesystems, partitions and block devices. Then, once you're familiar with the ins and outs of disks and
581 drobbins 1.86 filesystems, you'll be guided through the process of setting up partitions and filesystems for your Gentoo Linux
582     install.
583     </p>
584     <p>
585     To begin, I'll introduce "block devices". The most famous block device is
586     probably the one that represents the first IDE drive in a Linux system:
587     </p>
588     <pre caption="/dev/hda, the block device representing the primary master IDE drive in your system">
589     /dev/hda
590     </pre>
591    
592     <p>
593     If your system uses SCSI drives, then your first hard drive will be:
594     </p>
595    
596     <pre caption="/dev/sda, the block device representing the first logical SCSI drive in your system">
597     /dev/sda
598     </pre>
599    
600     <p>The block devices above represent an <i>abstract</i> interface to the disk.
601     User programs can use these block devices to interact with your disk without
602     worrying about whether your drivers are IDE, SCSI or something else. The
603     program can simply address the storage on the disk as a bunch of contiguous,
604     randomly-accessible 512-byte blocks. </p>
605     </body>
606     </section>
607     <section>
608     <title>Partitions and fdisk</title>
609     <body>
610     <p> Under Linux, we create filesystems by using a special command called
611     <c>mkfs</c> (or <c>mke2fs</c>, <c>mkreiserfs</c>, etc,) specifying a particular
612     block device as a command-line argument. </p>
613    
614     <p> However, although it is theoretically possible to use a "whole disk" block
615     device (one that represents the <i>entire</i> disk) like <c>/dev/hda</c> or
616     <c>/dev/sda</c> to house a single filesystem, this is almost never done in
617     practice. Instead, full disk block devices are split up into smaller, more
618 peesh 1.99 manageable block devices called "partitions". Partitions are created using a
619 drobbins 1.86 tool called <c>fdisk</c>, which is used to create and edit the partition table
620     that's stored on each disk. The partition table defines exactly how to split
621     up the full disk. </p>
622    
623     <p> We can take a look at a disk's partition table by running <c>fdisk</c>,
624     specifying a block device that represents a full disk as an argument: </p>
625    
626     <note>Alternate interfaces to the disk's partition table include <c>cfdisk</c>,
627 swift 1.142 <c>parted</c> and <c>partimage</c>. We recommend <c>fdisk</c> because it's
628     more powerful and well known in the Unix/Linux world.</note>
629 drobbins 1.86
630     <pre caption="Starting up fdisk">
631     # fdisk /dev/hda
632     </pre>
633     <p>
634     or
635     </p>
636     <pre caption="Starting up fdisk to look at the partition table on /dev/sda">
637     # fdisk /dev/sda
638     </pre>
639    
640     <impo>
641     <b>Note that you should <i>not</i> save or make any changes to a disk's
642     partition table if any of its partitions contain filesystems that are in use or
643     contain important data. Doing so will generally cause data on the disk to be
644     lost.</b>
645     </impo>
646    
647     <p>
648     Once in fdisk, you'll be greeted with a prompt that looks like this:
649     </p>
650    
651     <pre caption="The fdisk prompt">
652     Command (m for help):
653     </pre>
654    
655    
656     <p>
657     Type <c>p</c> to display your disk's current partition configuration:
658     </p>
659    
660     <pre caption="An example partition configuration">
661     Command (m for help): p
662    
663     Disk /dev/hda: 240 heads, 63 sectors, 2184 cylinders
664     Units = cylinders of 15120 * 512 bytes
665    
666     Device Boot Start End Blocks Id System
667     /dev/hda1 1 14 105808+ 83 Linux
668     /dev/hda2 15 49 264600 82 Linux swap
669     /dev/hda3 50 70 158760 83 Linux
670     /dev/hda4 71 2184 15981840 5 Extended
671     /dev/hda5 71 209 1050808+ 83 Linux
672     /dev/hda6 210 348 1050808+ 83 Linux
673     /dev/hda7 349 626 2101648+ 83 Linux
674     /dev/hda8 627 904 2101648+ 83 Linux
675     /dev/hda9 905 2184 9676768+ 83 Linux
676    
677     Command (m for help):
678     </pre>
679    
680     <p> This particular disk is configured to house seven Linux filesystems (each
681     with a corresponding partition listed as "Linux") as well as a swap partition
682     (listed as "Linux swap"). </p>
683    
684     <p>
685     Notice the name of the corresponding partition block
686     devices on the left hand side, starting with <c>/dev/hda1</c> and going up to
687     <c>/dev/hda9</c>. In the early days of the PC, partitioning software only
688     allowed a maximum of four partitions (called "primary" partitions). This was
689     too limiting, so a workaround called an <i>extended partitioning</i> was
690     created. An extended partition is very similar to a primary partition, and
691     counts towards the primary partition limit of four. However, extended
692     partitions can hold any number of so-called <i>logical</i> partitions inside
693     them, providing an effective means of working around the four partition limit.
694     </p>
695    
696     <p>
697     All partitions <c>hda5</c> and higher are logical partitions. The numbers 1
698     through 4 are reserved for primary or extended partitions. </p>
699    
700     <p> So, In our example, <c>hda1</c> through <c>hda3</c> are primary partitions.
701     <c>hda4</c> is an extended partition that contains logical partitions
702 drobbins 1.87 <c>hda5</c> through <c>hda9</c>. You would never actually
703 drobbins 1.86 <i>use</i> <c>/dev/hda4</c> for storing any filesystems directly -- it simply
704     acts as a container for partitions <c>hda5</c> through <c>hda9</c>. </p>
705    
706     <p> Also, notice that each partition has an "Id", also called a "partition
707     type". Whenever you create a new partition, you should ensure that the
708     partition type is set correctly. '83' is the correct partition type for
709 swift 1.115 partitions that will be housing Linux filesystems, '82' is the correct
710     partition type for Linux swap partitions and 'fd' is the recommended partition
711     type for Software RAID partitions. You set the partition type using the
712 drobbins 1.86 <c>t</c> option in <c>fdisk</c>. The Linux kernel uses the partition type
713 peesh 1.99 setting to auto-detect filesystems and swap devices on the disk at boot-time.
714 drobbins 1.86 </p>
715     </body>
716     </section>
717     <section>
718     <title>Using fdisk to set up partitions</title>
719     <body>
720    
721 drobbins 1.87 <p>Now that you've had your introduction to the way disk partitioning is
722 drobbins 1.86 done under Linux, it's time to walk you through the process of setting up disk
723     partitions for your Gentoo Linux installation. After we walk you through the
724     process of creating partitions on your disk, your partition configuration will
725     look like this: </p>
726    
727     <pre caption="The partition configuration that you will have after following these steps">
728     Disk /dev/hda: 30.0 GB, 30005821440 bytes
729     240 heads, 63 sectors/track, 3876 cylinders
730     Units = cylinders of 15120 * 512 = 7741440 bytes
731    
732     Device Boot Start End Blocks Id System
733     /dev/hda1 * 1 14 105808+ 83 Linux
734     /dev/hda2 15 81 506520 82 Linux swap
735     /dev/hda3 82 3876 28690200 83 Linux
736    
737     Command (m for help):
738     </pre>
739    
740     <p>In our suggested "newbie" partition configuration, we have three partitions.
741     The first one (<c>/dev/hda1</c>) at the beginning of the disk is a small
742     partition called a boot partition. The boot partition's purpose is to hold all
743     the critical data related to booting -- GRUB boot loader information (if you
744     will be using GRUB) as well as your Linux kernel(s). The boot partition gives
745     us a safe place to store everything related to booting Linux. During normal
746     day-to-day Gentoo Linux use, your boot partition should remain <e>unmounted</e>
747 drobbins 1.87 for safety. If you are setting up a SCSI system, your boot partition will
748     likely end up being <c>/dev/sda1</c>.</p>
749 drobbins 1.86
750 drobbins 1.98 <p>It's recommended to have boot partitions (containing everything necessary for
751     the boot loader to work) at the beginning of the disk. While not necessarily
752     required anymore, it is a useful tradition from the days when the lilo boot
753     loader wasn't able to load kernels from filesystems that extended beyond disk
754     cylinder 1024.
755     </p>
756    
757 drobbins 1.86 <p>The second partition (<c>/dev/hda2</c>) is used to for swap space. The
758     kernel uses swap space as virtual memory when RAM becomes low. This partition,
759     relatively speaking, isn't very big either, typically somewhere around 512MB.
760 drobbins 1.87 If you're setting up a SCSI system, this partition will likely end up
761     being called <c>/dev/sda2</c>. </p>
762 drobbins 1.86
763     <p>The third partition (<c>/dev/hda3</c>) is quite large and takes up the rest
764     of the disk. This partition is called our "root" partition and will be used to
765     store your main filesystem that houses Gentoo Linux itself. On a SCSI system,
766     this partition would likely end up being <c>/dev/sda3</c>.</p>
767    
768    
769     <p>Before we partition the disk, here's a quick technical overview of the
770     suggested partition and filesystem configuration to use when installing Gentoo
771     Linux:</p>
772    
773     <table>
774     <tr>
775     <th>Partition</th>
776     <th>Size</th>
777     <th>Type</th>
778     <th>example device</th>
779     </tr>
780     <tr>
781     <ti>boot partition, containing kernel(s) and boot information</ti>
782 swift 1.115 <ti>32 Megabytes</ti>
783 swift 1.122 <ti>ext2/3 highly recommended (easiest); if ReiserFS then mount with <c>-o notail</c>. If you will be using ext3 or ReiserFS, you must add the size of the journal to the partitionsize; in these cases 64 Megabytes is recommended</ti>
784 drobbins 1.86 <ti>/dev/hda1</ti>
785     </tr>
786     <tr>
787     <ti>swap partition (no longer a 128 Megabyte limit, now 2GB)</ti>
788 swift 1.142 <ti>Generally, configure a swap area that is between one and two times the size of the physical RAM
789 drobbins 1.86 in your system.</ti>
790     <ti>Linux swap</ti>
791     <ti>/dev/hda2</ti>
792     </tr>
793     <tr>
794     <ti>root partition, containing main filesystem (/usr, /home, etc)</ti>
795     <ti>&gt;=1.5 Gigabytes</ti>
796     <ti>ReiserFS, ext3 recommended; ext2 ok</ti>
797     <ti>/dev/hda3</ti>
798     </tr>
799     </table>
800    
801     <p>OK, now to create the partitions as in the example and table above. First,
802 swift 1.95 enter fdisk by typing <c>fdisk /dev/hda</c> or <c>fdisk /dev/sda</c>,
803 drobbins 1.86 depending on whether you're using IDE or SCSI. Then, type <c>p</c> to view your
804     current partition configuration. Is there anything on the disk that you need
805     to keep? If so, <b>stop now</b>. If you continue with these directions, <b>all
806     existing data on your disk will be erased.</b></p>
807    
808     <impo>Following these instructions below will cause all prior data on your disk
809     to <b>be erased</b>! If there is anything on your drive, please be sure that it
810     is non-critical information that you don't mind losing. Also make sure that you
811     <b>have selected the correct drive</b> so that you don't mistakenly wipe data
812     from the wrong drive.</impo>
813    
814     <p>Now, it's time to delete any existing partitions. To do this, type <c>d</c>
815     and hit Enter. You will then be prompted for the partition number you would like
816     to delete. To delete a pre-existing <c>/dev/hda1</c>, you would type:</p>
817    
818     <pre caption="Deleting a partition">
819     Command (m for help): d
820     Partition number (1-4): 1
821     </pre>
822 zhen 1.54
823 drobbins 1.86 <p>The partition has been scheduled for deletion. It will no longer show up if
824     you type <c>p</c>, but it will not be erased until your changes have been
825     saved. If you made a mistake and want to abort without saving your changes,
826     type <c>q</c> immediately and hit enter and your partition will not be
827     deleted.</p>
828     <p>Now, assuming that you do indeed want to wipe out all the partitions on your
829     system, repeatedly type <c>p</c> to print out a partition listing and then type
830     <c>d</c> and the number of the partition to delete it. Eventually, you'll end up
831     with a partition table with nothing in it:</p>
832    
833     <pre caption="An empty partition table">
834     Disk /dev/hda: 30.0 GB, 30005821440 bytes
835     240 heads, 63 sectors/track, 3876 cylinders
836     Units = cylinders of 15120 * 512 = 7741440 bytes
837    
838     Device Boot Start End Blocks Id System
839    
840     Command (m for help):
841     </pre>
842    
843     <p>Now that the in-memory partition table is empty, we're ready to create a
844     boot partition. To do this, type <c>n</c> to create a new partition, then
845     <c>p</c> to tell fdisk you want a primary partition. Then type <c>1</c> to
846     create the first primary partition. When prompted for the first cylinder, hit
847 swift 1.115 enter. When prompted for the last cylinder, type <c>+32M</c> to create a
848     partition 32MB in size. You can see output from these steps below:</p>
849    
850     <note>
851     Journaled filesystems require extra space for their journal. Default settings
852 swift 1.142 require about 33 Megabytes of space. Therefore, if you are using a journaled
853 swift 1.115 filesystem for <path>/boot</path>, you should type <c>+64M</c> when prompted
854     for the last cylinder.
855     </note>
856 drobbins 1.86
857     <pre caption="Steps to create our boot partition">
858     Command (m for help): n
859     Command action
860     e extended
861     p primary partition (1-4)
862     p
863     Partition number (1-4): 1
864     First cylinder (1-3876, default 1):
865     Using default value 1
866 swift 1.115 Last cylinder or +size or +sizeM or +sizeK (1-3876, default 3876): +32M
867 drobbins 1.86 </pre>
868    
869     <p>Now, when you type <c>p</c>, you should see the following partition printout:</p>
870    
871     <pre caption="Our first partition has been created">
872     Command (m for help): p
873    
874     Disk /dev/hda: 30.0 GB, 30005821440 bytes
875     240 heads, 63 sectors/track, 3876 cylinders
876     Units = cylinders of 15120 * 512 = 7741440 bytes
877    
878     Device Boot Start End Blocks Id System
879     /dev/hda1 1 14 105808+ 83 Linux
880     </pre>
881    
882     <p>Next, let's create the swap partition. To do this, type <c>n</c> to create a
883     new partition, then <c>p</c> to tell fdisk that you want a primary partition. Then
884     type <c>2</c> to create the second primary partition, <c>/dev/hda2</c> in our case.
885     When prompted for the first cylinder, hit enter. When prompted for the last cylinder,
886     type <c>+512M</c> to create a partition 512MB in size. After you've done this, type
887 swift 1.124 <c>t</c> to set the partition type, <c>2</c> to select the partition you just
888     created, and then type in <c>82</c> to set the partition
889 drobbins 1.86 type to "Linux Swap". After completing these steps, typing <c>p</c> should display
890     a partition table that looks similar to this:</p>
891    
892     <pre caption="Our swap partition has been created">
893     Command (m for help): p
894    
895     Disk /dev/hda: 30.0 GB, 30005821440 bytes
896     240 heads, 63 sectors/track, 3876 cylinders
897     Units = cylinders of 15120 * 512 = 7741440 bytes
898    
899     Device Boot Start End Blocks Id System
900     /dev/hda1 1 14 105808+ 83 Linux
901     /dev/hda2 15 81 506520 82 Linux swap
902     </pre>
903    
904     <p>Finally, let's create the root partition. To do this, type <c>n</c> to
905     create a new partition, then <c>p</c> to tell fdisk that you want a primary
906 carl 1.101 partition. Then type <c>3</c> to create the third primary partition,
907 drobbins 1.86 <c>/dev/hda3</c> in our case. When prompted for the first cylinder, hit enter.
908     When prompted for the last cylinder, hit enter to create a partition that takes
909     up the rest of the remaining space on your disk. After completing these steps,
910     typing <c>p</c> should display a partition table that looks similar to
911     this:</p>
912    
913     <pre caption="Our root partition has been created">
914     Command (m for help): p
915    
916     Disk /dev/hda: 30.0 GB, 30005821440 bytes
917     240 heads, 63 sectors/track, 3876 cylinders
918     Units = cylinders of 15120 * 512 = 7741440 bytes
919    
920     Device Boot Start End Blocks Id System
921     /dev/hda1 1 14 105808+ 83 Linux
922     /dev/hda2 15 81 506520 82 Linux swap
923     /dev/hda3 82 3876 28690200 83 Linux
924     </pre>
925    
926     <p>
927     Finally, we need to set the "bootable" flag on our boot partition and then write
928     our changes to disk. To tag <c>/dev/hda1</c> as a "bootable" partition, type
929     <c>a</c> at the menu and then type in <c>1</c> for the partition number. If you
930     type <c>p</c> now, you'll now see that <c>/dev/hda1</c> has a <c>*</c> in the "Boot"
931     column. Now, let's write our changes to disk. To do this, type <c>w</c> and hit
932     enter. Your disk partitions are now properly configured for a Gentoo Linux
933     install.
934     </p>
935    
936     <note>If <c>fdisk</c> or <c>cfdisk</c> instruct you to do so, please reboot to
937     allow your system to detect the new partition configuration.</note>
938     </body>
939     </section>
940     <section>
941     <title>Creating filesystems</title>
942     <body>
943     <p>Now that the partitions have been created, it's time to set up filesystems on
944     the boot and root partitions so that they can be mounted and used to store data.
945     We will also configure the swap partition to serve as swap storage.
946     </p>
947    
948     <p>Gentoo Linux supports a variety of different types of filesystems; each type has
949     its strengths and weaknesses and its own set of performance characteristics. Currently,
950     we support the creation of ext2, ext3, XFS, JFS and ReiserFS filesystems.</p>
951    
952     <p>ext2 is the tried and true Linux filesystem but doesn't have metadata
953     journaling, which means that routine ext2 filesystem checks at startup time can
954     be quite time-consuming. There is now quite a selection of newer-generation
955     <i>journaled</i> filesystems that can be checked for consistency very quickly
956     and are thus generally preferred over their non-journaled counterparts.
957     Journaled filesystems prevent long delays when you boot your system and your
958     filesystem happens to be in an <i>inconsistent</i> state.</p>
959    
960     <p>ext3 is the journaled version of the ext2 filesystem, providing metadata
961     journaling for fast recovery in addition to other enhanced journaling modes
962     like full data and ordered data journaling. ext3 is a very good and reliable
963 drobbins 1.88 filesystem. It offers generally decent performance under most conditions.
964     Because it does not extensively employ the use of "trees" in its internal
965     design, it doesn't scale very well, meaning that it is not an ideal choice for
966     very large filesystems, or situations where you will be handling very large
967     files or large quantities of files in a single directory. But when used within
968     its design parameters, ext3 is an excellent filesystem.</p>
969 drobbins 1.86
970     <p>ReiserFS is a B*-tree based filesystem that has very good overall
971     performance and greatly outperforms both ext2 and ext3 when dealing with small
972     files (files less than 4k), often by a factor of 10x-15x. ReiserFS also scales
973     extremely well and has metadata journaling. As of kernel 2.4.18+, ReiserFS is
974     now rock-solid and highly recommended for use both as a general-purpose
975     filesystem and for extreme cases such as the creation of large filesystems, the
976     use of many small files, very large files, and directories containing tens of
977     thousands of files. ReiserFS is the filesystem we recommend by default for all
978     non-boot partitions.</p>
979    
980     <p>XFS is a filesystem with metadata journaling that is fully supported under
981     Gentoo Linux's <path>xfs-sources</path> kernel. It comes with a robust
982     feature-set and is optimized for scalability. We only recommend using this
983     filesystem on Linux systems with high-end SCSI and/or fibre channel storage and
984     a uninterruptible power supply. Because XFS aggressively caches in-transit data
985     in RAM, improperly designed programs (those that don't take proper precautions
986     when writing files to disk, and there are quite a few of them) can lose a good
987     deal of data if the system goes down unexpectedly.</p>
988    
989 swift 1.142 <p>JFS is IBM's high-performance journaling filesystem. It has recently
990 drobbins 1.86 become production-ready, and there hasn't been a sufficient track record to
991 swift 1.142 comment positively nor negatively on its general stability at this
992 drobbins 1.86 point.</p>
993    
994     <p>If you're looking for the most rugged journaling filesystem, use ext3. If
995     you're looking for a good general-purpose high-performance filesystem with
996     journaling support, use ReiserFS; both ext3 and ReiserFS are mature,
997     refined and recommended for general use.</p>
998    
999     <!-- Corner case, confusing
1000 drobbins 1.70 <p>But before creating filesystems, you may want to initialize the
1001 jhhudso 1.81 beginning of your partition using <c>dd</c> if you are using a pre-existing partition that has been used before.
1002 drobbins 1.70 This is particularly helpful when you're going to create a new XFS filesystem on a partition that previously contained
1003     a ReiserFS filesystem. Doing this will ensure that your new filesystem
1004 seemant 1.78 will not be mis-identified by Linux's filesystem auto-detection code.
1005 drobbins 1.21 This can be done as follows:
1006 zhen 1.6 </p>
1007 jhhudso 1.81 <pre caption="Initializing first 1024 bytes of your partition">
1008     # <c>dd if=/dev/zero of=/dev/hda3 bs=1k count=1</c>
1009     <comment>(Replace /dev/hda3 with the partition you wish to &quot;clean.&quot;)</comment>
1010     </pre>
1011     <warn>The command above will destroy all data from <path>/dev/hda3</path>.
1012 zhware 1.43 Be careful and check twice which partition you specify for zeroing.
1013     If you make a mistake it might result in a loss of data.
1014     </warn>
1015 drobbins 1.86 -->
1016    
1017     <p>Based on our example above, we will use the following commands to initialize
1018     all our partitions for use:</p>
1019    
1020     <pre caption="Initializing our partitions (example)">
1021     # mke2fs -j /dev/hda1
1022     # mkswap /dev/hda2
1023     # mkreiserfs /dev/hda3
1024     </pre>
1025    
1026 drobbins 1.98 <p>We choose ext3 for our <c>/dev/hda1</c> boot partition because it is a
1027     robust journaling filesystem supported by all major boot loaders. We used
1028     <c>mkswap</c> for our <c>/dev/hda2 </c> swap partition -- the choice is obvious
1029     here. And for our main root filesystem on <c>/dev/hda3</c> we choose ReiserFS,
1030     since it is a solid journaling filesystem offering excellent performance. Now,
1031     go ahead and initialize your partitions.</p>
1032    
1033     <p>For your reference, here are the various <c>mkfs</c>-like commands available
1034     during the installation process:</p>
1035 drobbins 1.86
1036 drobbins 1.89 <p><c>mkswap</c> is the command that is used to initialize swap partitions:</p>
1037 jhhudso 1.81 <pre caption="Initializing Swap">
1038 drobbins 1.1 # <c>mkswap /dev/hda2</c>
1039 jhhudso 1.81 </pre>
1040 drobbins 1.89 <p>You can use the <c>mke2fs</c> command to create ext2 filesystems:</p>
1041 jhhudso 1.81 <pre caption="Creating an ext2 Filesystem">
1042 drobbins 1.1 # <i>mke2fs /dev/hda1</i>
1043 jhhudso 1.81 </pre>
1044 drobbins 1.86 <p>If you would like to use ext3, you can create ext3 filesystems using
1045 drobbins 1.89 <c>mke2fs -j</c>:</p>
1046 drobbins 1.86 <pre caption="Creating an ext3 Filesystem">
1047     # <c>mke2fs -j /dev/hda3</c>
1048     </pre>
1049     <note>You can find out more about using ext3 under Linux 2.4 at
1050     <uri>http://www.zip.com.au/~akpm/linux/ext3/ext3-usage.html</uri>.</note>
1051 drobbins 1.89 <p>To create ReiserFS filesystems, use the <c>mkreiserfs</c> command:</p>
1052 drobbins 1.86 <pre caption="Creating a ReiserFS Filesystem">
1053     # <c>mkreiserfs /dev/hda3</c>
1054     </pre>
1055 drobbins 1.89 <p>To create an XFS filesystem, use the <c>mkfs.xfs</c> command:</p>
1056 jhhudso 1.81 <pre caption="Creating a XFS Filesystem">
1057 drobbins 1.1 # <c>mkfs.xfs /dev/hda3</c>
1058 jhhudso 1.81 </pre>
1059     <note>You may want to add a couple of additional flags to the
1060     <c>mkfs.xfs</c> command: <c>-d agcount=3 -l size=32m</c>.
1061     The <c>-d agcount=3</c> command will lower the number of allocation groups.
1062     XFS will insist on using at least 1 allocation group per 4 GB of your
1063     partition, so, for example, if you have a 20 GB partition you will need
1064     a minimum agcount of 5. The <c>-l size=32m</c> command increases the
1065     journal size to 32 Mb, increasing performance.</note>
1066 drobbins 1.86
1067 drobbins 1.89 <p>To create JFS filesystems, use the <c>mkfs.jfs</c> command:</p>
1068 jhhudso 1.81 <pre caption="Creating a JFS Filesystem">
1069 zhen 1.50 # <c>mkfs.jfs /dev/hda3</c>
1070 jhhudso 1.81 </pre>
1071 zhen 1.16 </body>
1072     </section>
1073     </chapter>
1074     <chapter>
1075     <title>Mount Partitions</title>
1076     <section>
1077     <body>
1078 drobbins 1.86 <p>Now, we will activate our newly-initialized swap volume, since we may need the additional virtual memory that it
1079 zhen 1.6 provides later:
1080     </p>
1081 jhhudso 1.81 <pre caption="Activating Swap">
1082 drobbins 1.1 # <c>swapon /dev/hda2</c>
1083 jhhudso 1.81 </pre>
1084 drobbins 1.86
1085 jhhudso 1.75 <p>Next, we will create the <path>/mnt/gentoo</path> and <path>/mnt/gentoo/boot</path> mount points,
1086 zhen 1.93 and we will mount our filesystems to these mount points. Once our boot and root filesystems are
1087 drobbins 1.86 mounted, any files we copy or create inside <path>/mnt/gentoo</path> will be placed on our new filesystems.
1088     Note that if you are setting up Gentoo
1089     Linux with separate <path>/usr</path> or <path>/var</path> filesystems, these would get mounted to
1090     <path>/mnt/gentoo/usr</path> and <path>/mnt/gentoo/var</path> respectively.
1091     </p>
1092    
1093     <impo>If your <e>boot</e> partition (the one holding the kernel) is ReiserFS, be sure to mount it
1094 peesh 1.103 with the <c>-o notail</c> option so GRUB gets properly installed. Make sure
1095 drobbins 1.86 that <c>notail</c> ends up in your new <path>/etc/fstab</path> boot partition entry, too.
1096 drobbins 1.102 We will get to that in a bit. If you are going to use LILO with ReiserFS, then the <c>-o notail</c>
1097     is not needed. It's always safe to specify the <c>-o notail</c> option with ReiserFS if you're
1098     not sure what to do.
1099 drobbins 1.86 </impo>
1100    
1101 jhhudso 1.81 <pre caption="Creating Mount Points">
1102 drobbins 1.1 # <c>mount /dev/hda3 /mnt/gentoo</c>
1103     # <c>mkdir /mnt/gentoo/boot</c>
1104     # <c>mount /dev/hda1 /mnt/gentoo/boot</c>
1105 jhhudso 1.81 </pre>
1106 drobbins 1.86
1107     <impo>If you are having problems mounting your boot partition with ext2, try using
1108 zhen 1.6 <c>mount /dev/hXX /mnt/gentoo/boot -t ext2 </c> </impo>
1109 zhen 1.16 </body>
1110     </section>
1111     </chapter>
1112     <chapter>
1113 drobbins 1.86 <title>Stage tarballs and chroot</title>
1114 zhen 1.16 <section>
1115 drobbins 1.86 <title>Selecting the desired stage tarball</title>
1116 zhen 1.16 <body>
1117 zhen 1.55
1118 drobbins 1.86 <p>
1119     Now, you need to decide which one you would like to use as a
1120 swift 1.142 basis for the install if you haven't already.
1121     The stages on the Live CD are
1122     in <path>/mnt/cdrom/stages/</path>, and you can type <c>ls
1123     /mnt/cdrom/stages/</c>
1124     to see what's available on your CD.</p>
1125 drobbins 1.86
1126 swift 1.142 <p><b>GRP users</b> should use the <path>stage3-xx-yy.tar.bz2</path> tarball.</p>
1127 drobbins 1.86
1128     <p>If you would like to perform an install using a stage tarball that is
1129 swift 1.142 <i>not</i> on your CD (which will likely be the case if you're using our
1130     "basic" Live CD), this is still possible, but you'll need to download the
1131 drobbins 1.86 stage you want using the following instructions. If you already have the stage
1132 swift 1.142 tarball you want to use (which most users will have), then proceed to the
1133     "Extracting the stage tarball" section.</p>
1134 drobbins 1.86
1135 jhhudso 1.81 <pre caption="Downloading Required Stages">
1136 drobbins 1.1 # <c>cd /mnt/gentoo</c>
1137 zhware 1.47 <comment>Use lynx to get the URL for your tarball:</comment>
1138 swift 1.142 # <c>lynx http://gentoo.oregonstate.edu/releases/x86/1.4/</c>
1139 zhware 1.47 <comment>Use <c>Up</c> and <c>Down</c> arrows keys (or the <c>TAB</c> key) to go to the right directory
1140     Highlight the appropriate stage you want to download
1141     Press <c>d</c> which will initiate the download
1142     Save the file and quit the browser
1143    
1144     <b>OR</b> use wget from the command line:</comment>
1145     # <c>wget <comment>insert URL to the required stage tarball here.</comment></c>
1146 jhhudso 1.81 </pre>
1147 zhen 1.16 </body>
1148     </section>
1149     <section>
1150 drobbins 1.86 <title>Extracting the stage tarball</title>
1151 zhen 1.16 <body>
1152 drobbins 1.86
1153     <p>Now it is time to extract the compressed stage tarball of your choice to
1154     <path>/mnt/gentoo/</path>. Remember, you only need to unpack <b>one</b> stage
1155     tarball, either a stage1, stage2 or stage3. So, if you wanted to perform a
1156     stage3 install of Gentoo, then you would just unpack the stage3 tarball.
1157     Unpack the stage tarball as follows:</p>
1158    
1159     <impo>Be sure to use the <c>p</c> option with <c>tar</c>. Forgetting to do this will
1160     cause certain files to have incorrect permissions.</impo>
1161    
1162 jhhudso 1.81 <pre caption="Unpacking the Stages">
1163 drobbins 1.1 # <c>cd /mnt/gentoo</c>
1164 drobbins 1.86 <comment>Change "stage3" to "stage2" or "stage1" if you want to start from these stages instead.</comment>
1165     <comment>If you downloaded your stage tarball, change the path below to begin with "/mnt/gentoo/"
1166 swift 1.142 instead of "/mnt/cdrom/stages/".</comment>
1167     # <c>tar -xvjpf /mnt/cdrom/stages/stage3-*.tar.bz2</c>
1168 drobbins 1.86 </pre>
1169    
1170     <p>If you downloaded your stage tarball to <path>/mnt/gentoo</path>, you can now delete it by typing
1171 drobbins 1.90 <c>rm /mnt/gentoo/stage*.tar.bz2</c>.</p>
1172 drobbins 1.86 </body>
1173     </section>
1174     <section>
1175 swift 1.142 <title>GRP package/snapshot steps</title>
1176     <body>
1177     <impo>The following instructions are for GRP users only.</impo>
1178     <p><b>GRP Users</b>: There is a Portage snapshot on the Live CD. You will
1179     need to use this snapshot so that you can skip the <c>emerge sync</c> step
1180     later in this document, since <c>emerge sync</c> requires a network
1181     connection. Untar this snapshot as follows:</p>
1182     <pre caption="Using Portage snapshot">
1183     <comment>Replace yyyymmdd with the datestamp in the filename.</comment>
1184     # <c>tar -xvjf /mnt/cdrom/snapshots/portage-yyyymmdd.tar.bz2 -C /mnt/gentoo/usr</c>
1185     </pre>
1186     <p>This will extract a snapshot of the Portage tree to your fresh Gentoo
1187     install. Now you won't need to connect to the Internet and use <c>emerge
1188     sync</c> to download a Portage tree. Now, copy distfiles and packages
1189     from the Live CD into place:</p>
1190    
1191     <pre caption="Copying GRP files">
1192     # <c>cp -R /mnt/cdrom/distfiles /mnt/gentoo/usr/portage/distfiles</c>
1193 avenj 1.146 # <c>cp -a /mnt/cdrom/packages/ /mnt/gentoo/usr/portage/packages/</c>
1194 swift 1.142 </pre>
1195    
1196     <p>All relevant files are now in place for using GRP. You should now have
1197     everything copied over and unpacked that you'll need to install Gentoo Linux
1198     -- even without a network connection.</p>
1199    
1200     </body>
1201     </section>
1202     <section>
1203 drobbins 1.86 <title>Entering the chroot</title>
1204     <body>
1205     <p>
1206     Next, we will <c>chroot</c> over to the new Gentoo Linux build installation to &quot;enter&quot; the new
1207     Gentoo Linux system.
1208     </p>
1209 swift 1.112
1210     <note>
1211     You may receive a notice during <c>env-update</c> telling you that
1212 swift 1.113 <path>/etc/make.profile/make.defaults</path> isn't available: ignore it. We are
1213 swift 1.142 going to issue <c>emerge sync</c> later on in this document, which will resolve
1214 swift 1.112 the problem.
1215     </note>
1216 drobbins 1.86
1217     <pre caption="Prepping and entering the chroot environment">
1218 drobbins 1.94 # <c>mount -t proc proc /mnt/gentoo/proc</c>
1219 drobbins 1.1 # <c>cp /etc/resolv.conf /mnt/gentoo/etc/resolv.conf</c>
1220     # <c>chroot /mnt/gentoo /bin/bash</c>
1221     # <c>env-update</c>
1222     Regenerating /etc/ld.so.cache...
1223     # <c>source /etc/profile</c>
1224 swift 1.142 <comment>(The above points your shell to the new paths and updated binaries).</comment>
1225 jhhudso 1.81 </pre>
1226 drobbins 1.86 <p>After you execute these commands, you will be &quot;inside&quot; your new Gentoo Linux environment in <path>/mnt/gentoo</path>.
1227     We can perform the rest of the installation process inside the chroot.
1228     </p>
1229 zhen 1.16 </body>
1230     </section>
1231     </chapter>
1232     <chapter>
1233 jhhudso 1.75 <title>Getting the Current Portage Tree using sync</title>
1234 zhen 1.16 <section>
1235     <body>
1236 swift 1.133
1237     <!-- This is not yet implemented. Uncomment when it is!
1238    
1239 swift 1.132 <p>In order to maximize the downloadspeed, you should now select rsync- and distfiles mirrors. To simplify this task, we have a tool called <c>mirrorselect</c>. Issue the following two commands:</p>
1240    
1241     <pre caption="Selecting a mirror">
1242     <comment>First we have mirrorselect select 5 close mirrors for us.</comment>
1243     # <i>mirrorselect -a -s5</i>
1244     <comment>Now we select an rsync-mirror ourselves:</comment>
1245     # <i>mirrorselect -i -r</i>
1246     </pre>
1247 swift 1.133
1248     -->
1249 swift 1.132
1250 swift 1.142
1251    
1252     <impo>If you doing a GRP install you can ignore the following section on
1253     <c>emerge sync</c>.</impo>
1254    
1255     <p>Now, you will need to run <c>emerge sync</c>. This command tells Portage
1256     to download the most recent copy of the Gentoo Linux Portage tree from the
1257     Internet. If you extracted a Portage tree snapshot from "CD 1" earlier, you
1258     can safely skip this step. The Portage tree contains all the scripts
1259     (called ebuilds) used to build every package under Gentoo Linux. Currently,
1260     we have ebuild scripts for close to 4000 packages. Once <c>emerge sync</c>
1261     completes, you will have a complete Portage tree in
1262     <path>/usr/portage</path>.</p>
1263 drobbins 1.86
1264 jhhudso 1.81 <pre caption="Updating Using sync">
1265 zhen 1.6 # <c>emerge sync</c>
1266 drobbins 1.86 </pre>
1267 zhen 1.60
1268 zhen 1.16 </body>
1269     </section>
1270     </chapter>
1271     <chapter>
1272     <title>Setting Gentoo optimizations (make.conf)</title>
1273     <section>
1274     <body>
1275 drobbins 1.86
1276     <p>Now that you have a working copy of the Portage tree, it is time to
1277     customize the optimization and optional build-time settings to use on your
1278     Gentoo Linux system. Portage will use these settings when compiling any
1279     programs for you. To do this, edit the file <path>/etc/make.conf</path>. In
1280     this file, you should set your <c>USE</c> flags, which specify optional
1281     functionality that you would like to be built into packages if available;
1282     generally, the defaults (an <e>empty</e> or unset <c>USE</c> variable) are
1283     fine. More information on <c>USE</c> flags can be found <uri
1284     link="http://www.gentoo.org/doc/en/use-howto.xml">here</uri>. A complete list
1285     of current USE flags can be found <uri
1286     link="http://www.gentoo.org/dyn/use-index.xml">here</uri>. </p>
1287    
1288 swift 1.142 <p>If you are starting from a stage1 tarball, You also should set appropriate <c>CHOST</c>, <c>CFLAGS</c> and
1289 drobbins 1.86 <c>CXXFLAGS</c> settings for the kind of system that you are creating
1290 swift 1.142 (commented examples can be found further down in the file). If you are using
1291     a stage2 or stage3 tarball, these settings will already be configured
1292     optimally and should not require any modification.</p>
1293    
1294     <impo><b>Advanced users:</b> The <c>CFLAGS</c> and <c>CXXFLAGS</c> settings
1295     settings
1296     are used to tell the C and C++ compiler how to optimize the code that
1297 drobbins 1.86 is generated on your system. It is common for users with Athlon XP processors
1298     to specify a "-march=athlon-xp" setting in their CFLAGS and CXXFLAGS settings
1299     so that all packages built will be optimized for the instruction set and
1300     performance characteristics of their CPU, for example. The <path>/etc/make.conf</path>
1301 swift 1.142 file contains a general guide for the proper settings of CFLAGS and CXXFLAGS.
1302     </impo>
1303    
1304     <!-- needs qa
1305     <note><b>Advanced users:</b>If you are building from a stage1 and don't want
1306     to manually configure CFLAGS and CXXFLAGS, you can use the <c>genflags</c>
1307     utility, which will try to guess accurate flags for your CPU architecture.
1308     Simply type <c>emerge -O genflags</c> and then execute
1309     <c>info2flags</c>. <c>info2flags</c> will suggest CHOST, CFLAGS, and
1310     CXXFLAGS settings, which you can then add to
1311     <path>/etc/make.conf</path>.</note>
1312     -->
1313    
1314 drobbins 1.86 <p>If necessary, you can also set proxy information here if you are behind a
1315     firewall. Use the following command to edit <path>/etc/make.conf</path> using <c>nano</c>,
1316     a simple visual editor.
1317     </p>
1318 jhhudso 1.81 <pre caption="Setting make.conf Options">
1319     # <c>nano -w /etc/make.conf</c>
1320     </pre>
1321 zhen 1.16 <note>
1322 swift 1.142 <b>Advanced users:</b> People who need to substantially customize the build process should take a look at
1323 zhen 1.6 the <path>/etc/make.globals</path> file. This file comprises gentoo defaults and
1324 drobbins 1.70 should never be touched. If the defaults do not suffice, then new values should
1325 zhen 1.6 be put in <path>/etc/make.conf</path>, as entries in <path>make.conf</path>
1326     <comment>override</comment> the entries in <path>make.globals</path>. If you're
1327 jhhudso 1.75 interested in customizing USE settings, look in <path>/etc/make.profile/make.defaults</path>.
1328 zhen 1.16 If you want to turn off any USE settings found here, add an appropriate <c>USE=&quot;-foo&quot;</c>
1329 drobbins 1.86 in <path>/etc/make.conf</path> to turn off any <c>foo</c> USE setting enabled by default
1330     in <path>/etc/make.globals</path> or <path>/etc/make.profile/make.defaults</path>.
1331 zhen 1.6 </note>
1332 swift 1.142 <warn>Make sure not to add '<c>static</c>' to your <c>USE</c> variables until after stage1.</warn>
1333 zhen 1.16 </body>
1334     </section>
1335     </chapter>
1336     <chapter>
1337 zhen 1.18 <title>Starting from Stage1</title>
1338 zhen 1.16 <section>
1339     <body>
1340 drobbins 1.86 <note>If you are not starting from a stage1 tarball, skip this section.</note>
1341 jhhudso 1.75 <p>The stage1 tarball is for complete customization and optimization. If you have picked this tarball,
1342 swift 1.142 you are most likely looking to have an uber-optimized and up-to-date
1343     system. Have fun! Installing from a stage1 takes a lot of time, but the result
1344 drobbins 1.70 is a system that has been optimized from the ground up for your specific machine and needs.
1345 zhen 1.18 </p>
1346 jhhudso 1.75 <p>Now, it is time to start the &quot;bootstrap&quot; process. This process takes about two hours on
1347 peesh 1.99 my 1200MHz AMD Athlon system.
1348 drobbins 1.86 During this time, the GNU C library, compiler suite and other key system programs will be built. Start the bootstrap
1349     as follows:</p>
1350 jhhudso 1.81 <pre caption="Bootstrapping">
1351 drobbins 1.1 # <c>cd /usr/portage</c>
1352     # <c>scripts/bootstrap.sh</c>
1353 jhhudso 1.81 </pre>
1354 antifa 1.125 <p>The &quot;bootstrap&quot; process will now begin.</p>
1355     <note><c>bootstrap.sh</c> now supports the <c>--fetchonly</c> option. Dial-up users will find this especially handy. It will download all bootstrap related files in one go for later compilation. <c>bootstrap.sh -h</c> for more information.</note>
1356 zhen 1.16 <note>
1357 zhen 1.6 Portage by default uses <c>/var/tmp</c> during package building, often
1358     using several hundred megabytes of temporary storage. If you would like to
1359     change where Portage stores these temporary files, set a new PORTAGE_TMPDIR <e>before</e>
1360     starting the bootstrap process, as follows:
1361     </note>
1362 jhhudso 1.81 <pre caption="Changing Portage's Storage Path">
1363 zhen 1.16 # <c>export PORTAGE_TMPDIR=&quot;/otherdir/tmp&quot;</c>
1364 jhhudso 1.81 </pre>
1365 zhen 1.16 <p><c>bootstrap.sh</c> will build <c>binutils</c>, <c>gcc</c>, <c>gettext</c>,
1366 antifa 1.125 and <c>glibc</c>, rebuilding <c>gettext</c>
1367 zhen 1.6 after <c>glibc</c>. Needless to say, this process takes a while.
1368 jhhudso 1.75 Once this process completes, your system will be equivalent to a &quot;stage2&quot; system,
1369 zhen 1.33 which means you can now move on to the stage2 instructions.
1370 zhen 1.6 </p>
1371 zhen 1.16 </body>
1372     </section>
1373     </chapter>
1374     <chapter>
1375 drobbins 1.86 <title>Starting from Stage2 and continuing Stage1</title>
1376 zhen 1.16 <section>
1377     <body>
1378 drobbins 1.86
1379     <note>This section is for those continuing a stage1 install or starting at stage2. If
1380 swift 1.142 this is not you (ie. you're using a stage3), then skip this section.
1381 drobbins 1.86 </note>
1382 swift 1.140
1383     <warn>
1384     If you start from stage2, don't change the CHOST variable in
1385     <path>/etc/make.conf</path>. Doing so results in strange and
1386     broad compilation failures. We are working on fixing this
1387 swift 1.142 of course.
1388 swift 1.140 </warn>
1389 drobbins 1.86
1390     <p>The stage2 tarball already has the bootstrapping done for you. All that you have
1391 zhen 1.18 to do is install the rest of the system.
1392 zhen 1.6 </p>
1393 drobbins 1.108 <note>If you are starting from a pre-built stage2 and want to ensure
1394     that your compiler toolchain is fully up-to-date, add the <c>-u</c>
1395     option to the commands below. If you don't know what this means, it's
1396     safe to skip this suggestion.</note>
1397    
1398 jhhudso 1.81 <pre caption="Installing the Rest of the System">
1399 drobbins 1.1 # <c>emerge -p system</c>
1400 jhhudso 1.81 <comment>(lists the packages to be installed)</comment>
1401 drobbins 1.1 # <c>emerge system</c>
1402 jhhudso 1.81 </pre>
1403 jhhudso 1.75 <p>It is going to take a while
1404 zhen 1.6 to finish building the entire base system. Your reward is that it will be
1405     thoroughly optimized for your system. The drawback is that you have to find a
1406 zhen 1.16 way to keep yourself occupied for some time to come. The author suggests &quot;Star
1407 zhen 1.37 Wars - Super Bombad Racing&quot; for the PS2.
1408     </p>
1409 drobbins 1.108 <p>
1410     Building is now complete. Go ahead and skip down to the "Setting
1411     your time zone" section.
1412 zhen 1.18 </p>
1413     </body>
1414     </section>
1415     </chapter>
1416     <chapter>
1417     <title>Starting from Stage3</title>
1418     <section>
1419     <body>
1420 drobbins 1.86 <note>This section is for those <b>starting</b> with stage3, and not for those who have started
1421 swift 1.142 with stage1 or stage2 who should skip this section. GRP users should skip ahead to the next section.</note>
1422 drobbins 1.108
1423 swift 1.140 <warn>
1424 swift 1.142 Remember, if you start from stage3, don't change the CHOST variable in
1425     <path>/etc/make.conf</path>. Doing so can result in compilation failures.
1426 swift 1.140 </warn>
1427    
1428 swift 1.142 <p>The stage3 tarball provides a fully-functional basic Gentoo system,
1429     so no building is required.</p>
1430    
1431     <note><b>Advanced users:</b>
1432 drobbins 1.86 However, since the stage3 tarball is pre-built, it may be slightly out-of-date. If this is a concern
1433 drobbins 1.108 for you, you can automatically update your existing stage3 to contain the most up-to-date versions of all system packages
1434 swift 1.142 by typing <c>export CONFIG_PROTECT="-* /etc/make.conf" emerge -u
1435     system</c> (this requires a network connection). Note that this could take a long time if your stage3 is very old;
1436 drobbins 1.86 otherwise, this process will generally be quick and will allow you to benefit from the very latest
1437     Gentoo updates and fixes.
1438     In any case, feel free to skip these
1439     steps and proceed to the next section if you like.
1440 swift 1.142 </note>
1441 zhen 1.57
1442 seemant 1.79 </body>
1443     </section>
1444     </chapter>
1445     <chapter>
1446 jhhudso 1.81 <title>Setting your time zone</title>
1447 seemant 1.79 <section>
1448     <body>
1449 jhhudso 1.81 <p>Now you need to set your time zone.</p>
1450     <p>Look for your time zone (or GMT if you are using Greenwich Mean Time)
1451     in <path>/usr/share/zoneinfo</path>. Then, make a symbolic link to
1452     /etc/localtime by typing:</p>
1453     <pre caption="Creating a symbolic link for time zone">
1454 seemant 1.79 # <c>ln -sf /usr/share/zoneinfo/path/to/timezonefile /etc/localtime</c>
1455 jhhudso 1.81 </pre>
1456 zhen 1.16 </body>
1457     </section>
1458     </chapter>
1459     <chapter>
1460 avenj 1.146 <title>Modifying /etc/fstab for your machine</title>
1461     <section>
1462     <body>
1463     <impo>
1464     To edit files, remember to use <c>nano -w "filename"</c>.
1465     </impo>
1466     <p>Your Gentoo Linux system is almost ready for use. All we need to do now is configure
1467     a few important system files and install the boot loader.
1468     The first file we need to
1469     configure is <path>/etc/fstab</path>. Remember that you should use
1470     the <c>notail</c> option for your boot partition if you chose to create a ReiserFS filesystem on it.
1471     Remember to specify <c>ext2</c>, <c>ext3</c> or <c>reiserfs</c> filesystem types as appropriate.
1472     </p>
1473     <p>Use something like the <path>/etc/fstab</path> listed below, but of course be sure to replace &quot;BOOT&quot;,
1474     &quot;ROOT&quot; and &quot;SWAP&quot; with the actual block devices you are using (such as <c>hda1</c>, etc.)</p>
1475     <pre caption="Editing fstab">
1476     <comment># /etc/fstab: static file system information.
1477     #
1478     # noatime turns off atimes for increased performance (atimes normally aren't
1479     # needed; notail increases performance of ReiserFS (at the expense of storage
1480     # efficiency). It is safe to drop the noatime options if you want and to
1481     # switch between notail and tail freely.
1482    
1483     # &lt;fs&gt; &lt;mount point&gt; &lt;type&gt; &lt;opts&gt; &lt;dump/pass&gt;
1484    
1485     # NOTE: If your BOOT partition is ReiserFS, add the notail option to opts.
1486     </comment>
1487     /dev/BOOT /boot ext2 noauto,noatime 1 2
1488     /dev/ROOT / ext3 noatime 0 1
1489     /dev/SWAP none swap sw 0 0
1490     /dev/cdroms/cdrom0 /mnt/cdrom iso9660 noauto,ro 0 0
1491     proc /proc proc defaults 0 0
1492     </pre>
1493     <warn>Please notice that <i>/boot</i> is NOT mounted at boot time.
1494     This is to protect the data in <i>/boot</i> from
1495     corruption. If you need to access <i>/boot</i>, please mount it!
1496     </warn>
1497     </body>
1498     </section>
1499     </chapter>
1500     <chapter>
1501 swift 1.142 <title>Installing the kernel and system logger</title>
1502 zhen 1.16 <section>
1503 swift 1.142 <title>Kernel selections</title>
1504 zhen 1.16 <body>
1505 swift 1.142
1506     <p>There are two options for installing a kernel. You can either configure your own kernel or use the <c>genkernel</c>
1507     utility to configure and compile your kernel automatically.</p>
1508    
1509    
1510     <p>Whether configuring a kernel by hand or using <c>genkernel</c>,
1511     you'll need to merge the Linux kernel sources you'd like to use.
1512 swift 1.122 Gentoo provides several kernel ebuilds; a list can be found
1513     <uri link="/doc/en/gentoo-kernel.xml">here</uri>. If you are uncertain
1514 swift 1.142 which kernel sources to choose, we advise using <c>gentoo-sources</c>.
1515     <!--or <c>vanilla-sources</c>.(2.4.21-vanilla has sound issues)--> If you want XFS support, you should choose
1516     <c>xfs-sources</c> or <c>gs-sources</c>. Gentoo's LiveCD uses
1517     <c>gs-sources</c> and <c>xfs-sources</c>. There is also a
1518     <c>gaming-sources</c> kernel optimized for game-playing
1519     responsiveness that works wonderfully for this purpose when the
1520     "Preemptible kernel" option is enabled.
1521     </p>
1522    
1523    
1524     <p>Choose a kernel and then merge as follows:</p>
1525 jhhudso 1.81 <pre caption="Emerging Kernel Sources">
1526 swift 1.142 # <c>emerge -k sys-kernel/gentoo-sources</c>
1527     </pre>
1528    
1529     <p>The
1530     <path>/usr/src/linux</path> symbolic link will point to your
1531     newly-installed kernel source tree. Portage uses the
1532     <path>/usr/src/linux</path> symbolic link for a special purpose. Any
1533     ebuilds you install that contain kernel modules will be configured
1534     to work with the kernel source tree pointed to by
1535     <path>/usr/src/linux</path>. <path>/usr/src/linux</path> is created
1536     when you emerge your first kernel source package, but after it
1537     exists, Portage does not modify this symbolic link.</p>
1538     </body>
1539     </section>
1540     <section>
1541     <title>Using genkernel to compile your kernel</title>
1542     <body>
1543    
1544     <p>Now that your kernel source tree is installed, it's now time to
1545     compile your kernel. There are two ways to do this. The first way is
1546     to use our new <c>genkernel</c> script to automatically build a kernel
1547     for you. <c>genkernel</c> works by configuring a kernel nearly
1548     identically to the way our LiveCD kernel is configured. This means
1549     that when you use <c>genkernel</c> to build your kernel, your system
1550     will generally detect all your hardware at boot-time, just like our Live
1551     CD does. Because genkernel doesn't require any manual kernel
1552     configuration, it is an ideal solution for those users who may not
1553     be comfortable compiling their own kernels.</p>
1554    
1555     <p>Now, let's see how to use genkernel. First, emerge the genkernel
1556     ebuild:</p>
1557    
1558     <pre caption="Emerging genkernel">
1559     # <c>emerge -k genkernel</c>
1560     </pre>
1561    
1562     <p>Now, compile your kernel sources by running <c>genkernel</c>:</p>
1563    
1564     <note><b>Advanced users:</b> you can type <c>genkernel --config</c> instead,
1565     which will cause genkernel to allow you to tweak the default kernel configuration before
1566     building begins.</note>
1567    
1568    
1569     <pre caption="Running genkernel">
1570 avenj 1.146 <comment>If you're using genkernel 1.2 (included in the 1.4 GRP set), use the following:</comment>
1571     # <c>genkernel gentoo-sources</c>
1572     <comment>If you're using genkernel 1.4, available with an emerge sync, you don't need to specify a kernel:</comment>
1573 swift 1.142 # <c>genkernel</c>
1574     Gentoo Linux genkernel, version 1.4
1575     Copyright 2003 Gentoo Technologies, Inc., Bob Johnson, Daniel Robbins
1576     Distributed under the GNU General Public License version 2
1577    
1578     Settings:
1579     compile optimization: 1 processor(s)
1580     source tree: /usr/src/linux-2.4.20-gaming-r3
1581     config: gentoo (customized)
1582     config loc: /etc/kernels/config-2.4.20-gaming-r3
1583     initrd config: (default) /etc/kernels/settings
1584    
1585     * Running "make oldconfig"... [ ok ]
1586     * Logging to /var/log/genkernel.log... [ ok ]
1587     * Starting 2.4.20-gaming-r3 build... [ ok ]
1588     * Running "make dep"... [ ok ]
1589     * Running "make bzImage"... [ ok ]
1590     * Running "make modules"... [ ok ]
1591     * Running "make modules_install"... [ ok ]
1592     * Moving bzImage to /boot/kernel-2.4.20-gaming-r3... [ ok ]
1593     * Building busybox... [ ok ]
1594     * Creating initrd... [ ok ]
1595    
1596     * Build completed successfully!
1597    
1598     * Please specify /boot/kernel-2.4.20-gaming-r3 and /boot/initrd-2.4.20-gaming-r3
1599     * when customizing your boot loader configuration files.
1600    
1601     #
1602 jhhudso 1.81 </pre>
1603 swift 1.142
1604     <p>Once <c>genkernel</c> completes, a kernel, full set of modules and <i>initial root disk</i> (initrd) will
1605     be created. We will use the kernel and initrd when configuring a boot loader later in this document. The
1606     initrd will be started immediately after booting to perform hardware autodetection (just like on the Live CD)
1607     before your "real" system starts up.</p>
1608    
1609     <p>Now, let's perform one more step to get our system to be more like the Live CD -- let's emerge hotplug.
1610     While the initrd autodetects hardware that is needed to boot your system, hotplug autodetects everything else.
1611     To emerge and enable hotplug, type the following:</p>
1612    
1613     <pre caption="Emerging and enabling hotplug">
1614     # <c>emerge -k hotplug</c>
1615     # <c>rc-update add hotplug default</c>
1616     </pre>
1617    
1618     <p>Finally, you should emerge ebuilds for any additional hardware that is on your system. Here is a list of
1619     kernel-related ebuilds that you could emerge:</p>
1620    
1621     <table>
1622     <tr>
1623     <th>ebuild</th>
1624     <th>purpose</th>
1625     <th>command</th>
1626     </tr>
1627     <tr>
1628     <ti>nvidia-kernel</ti>
1629     <ti>Accelerated NVIDIA graphics for XFree86</ti>
1630     <ti><c>emerge -k nvidia-kernel</c></ti>
1631     </tr>
1632     <tr>
1633     <ti>nforce-net</ti>
1634     <ti>On-board ethernet controller on NVIDIA NForce(2) motherboards</ti>
1635     <ti><c>emerge nforce-net</c></ti>
1636     </tr>
1637     <tr>
1638     <ti>nforce-audio</ti>
1639     <ti>On-board audio on NVIDIA NForce(2) motherboards</ti>
1640     <ti><c>emerge nforce-audio</c></ti>
1641     </tr>
1642     <tr>
1643     <ti>e100</ti>
1644     <ti>Intel e100 Fast Ethernet Adapters</ti>
1645     <ti><c>emerge e100</c></ti>
1646     </tr>
1647     <tr>
1648     <ti>e1000</ti>
1649     <ti>Intel e1000 Gigabit Ethernet Adapters</ti>
1650     <ti><c>emerge e1000</c></ti>
1651     </tr>
1652     <tr>
1653     <ti>emu10k1</ti>
1654     <ti>Creative Sound Blaster Live!/Audigy support</ti>
1655     <ti><c>emerge emu10k1</c></ti>
1656     </tr>
1657     <tr>
1658     <ti>ati-drivers</ti>
1659     <ti>Accelerated ATI Radeon 8500+/FireGL graphics for XFree86</ti>
1660     <ti><c>emerge ati-drivers</c></ti>
1661     </tr>
1662     <tr>
1663     <ti>xfree-drm</ti>
1664     <ti>Accelerated graphics for ATI Radeon up to 9200, Rage128,
1665     Matrox, Voodoo and other cards for XFree86</ti>
1666     <ti><c>VIDEO_CARDS="yourcard" emerge xfree-drm</c></ti>
1667     </tr>
1668     </table>
1669     <p>The nvidia-kernel, ati-drivers and xfree-drm packages will require additional configuration to be enabled.
1670     All other ebuilds listed above should be auto-detected at boot-time by the hotplug package.</p>
1671    
1672     <p>Now that you've run and configured your system to use genkernel, you can skip the "manual kernel configuration"
1673     section below.</p>
1674     </body>
1675     </section>
1676     <section>
1677     <title>Manual kernel configuration</title>
1678     <body>
1679    
1680     <p>If you opted not to use genkernel to compile your kernel, this section
1681     will guide you through the process of configuring and compiling a kernel by
1682     hand. Please note that <path>/usr/src/linux</path> is a symlink to your
1683     current emerged kernel source package, and is set automatically by Portage at
1684     emerge time. If you have multiple kernel source packages, it is necessary to
1685     set the <path>/usr/src/linux</path> symlink to the correct one before
1686     proceeding. </p>
1687    
1688     <warn>
1689     If you are configuring your own kernel, be careful with the <i>grsecurity</i> option. Being too aggressive with your
1690     security settings can cause certain programs (such as X) to not run properly. If in doubt, leave it out.
1691     </warn>
1692    
1693     <note>
1694 swift 1.122 If you want to use the same configuration as the LiveCD kernel or base
1695     your configuration on it, you should execute
1696     <c>cd /usr/src/linux &amp;&amp; cat /proc/config > .config &amp;&amp; make oldconfig</c>.
1697     If you aren't using <c>xfs-sources</c>, this will ask some questions
1698     about differences between your kernelchoice and <c>xfs-sources</c>.
1699     </note>
1700 swift 1.121 <pre caption="Configuring the Linux Kernel">
1701 drobbins 1.1 # <c>cd /usr/src/linux</c>
1702     # <c>make menuconfig</c>
1703 jhhudso 1.81 </pre>
1704 zhen 1.16 <warn>For your kernel to function properly, there are several options that you will
1705 zhen 1.6 need to ensure are in the kernel proper -- that is, they should <i>be enabled and not
1706 jhhudso 1.81 compiled as modules</i>. Be sure to enable &quot;ReiserFS&quot; if you have
1707     any ReiserFS partitions; the same goes for &quot;Ext3&quot;. If you're using XFS, enable the
1708     &quot;SGI XFS filesystem support&quot; option. It's always a good idea to leave ext2
1709     enabled whether you are using it or not. Below are some common options that you will need:</warn>
1710     <pre caption="make menuconfig options">
1711     Code maturity level options ---&gt;
1712     [*] Prompt for development and/or incomplete code/drivers&quot;
1713     <comment>(You need this to enable some of the options below.)</comment>
1714     ...
1715    
1716     File systems ---&gt;
1717     &lt;*&gt; Reiserfs support
1718     <comment>(Only needed if you are using reiserfs.)</comment>
1719     ...
1720     &lt;*&gt; Ext3 journalling file system support
1721     <comment>(Only needed if you are using ext3.)</comment>
1722     ...
1723     [*] Virtual memory file system support (former shm fs)
1724     <comment>(Required for Gentoo Linux.)</comment>
1725     ...
1726     &lt;*&gt; JFS filesystem support
1727     <comment>(Only needed if you are using JFS.)</comment>
1728     ...
1729     [*] /proc file system support
1730     <comment>(Required for Gentoo Linux.)</comment>
1731     [*] /dev file system support (EXPERIMENTAL)
1732     [*] Automatically mount at boot
1733     <comment>(Required for Gentoo Linux.)</comment>
1734     [ ] /dev/pts file system for Unix98 PTYs
1735     <comment>(Uncheck this, it is NOT needed.)</comment>
1736     ...
1737     &lt;*&gt; Second extended fs support
1738     <comment>(Only needed if you are using ext2.)</comment>
1739     ...
1740     &lt;*&gt; XFS filesystem support
1741     <comment>(Only needed if you are using XFS.)</comment>
1742     </pre>
1743 zhen 1.16 <p>If you use PPPoE to connect to Internet, you will need the following
1744 zhen 1.6 options in the kernel (built-in or as preferably as modules) :
1745 zhen 1.16 &quot;PPP (point-to-point protocol) support&quot;, &quot;PPP support for async serial ports&quot;,
1746     &quot;PPP support for sync tty ports&quot;. The two compression options won't harm but
1747     are not definitely needed, neither does the &quot;PPP over Ethernet&quot; option,
1748 zhen 1.6 that might only be used by <i>rp-pppoe</i> when configured to do kernel mode PPPoE.
1749     </p>
1750 zhen 1.16 <p>If you have an IDE cd burner, then you need to enable SCSI emulation in the
1751     kernel. Turn on &quot;ATA/IDE/MFM/RLL support&quot; ---&gt; &quot;IDE, ATA and ATAPI Block
1752     devices&quot; ---&gt; &quot;SCSI emulation support&quot; (I usually make it a module), then
1753     under &quot;SCSI support&quot; enable &quot;SCSI support&quot;, &quot;SCSI CD-ROM support&quot; and
1754     &quot;SCSI generic support&quot; (again, I usually compile them as modules). If you
1755     also choose to use modules, then <c>echo -e &quot;ide-scsi\nsg\nsr_mod&quot;
1756     &gt;&gt; /etc/modules.autoload</c> to have them automatically added at boot time.
1757 zhen 1.6 </p>
1758 peesh 1.130 <p>If you require it, don't forget to include support in the kernel for your ethernet card.</p>
1759 zhen 1.16 <note>
1760 zhen 1.6 For those who prefer it,
1761     it is now possible to install Gentoo Linux with a 2.2 kernel.
1762 drobbins 1.21 However, doing this comes at a price:
1763 zhen 1.6 you will lose many of the nifty features that
1764     are new to the 2.4 series kernels (such as XFS and tmpfs
1765     filesystems, iptables, and more), although the 2.2 kernel sources can be
1766 drobbins 1.21 patched with ReiserFS and devfs support.
1767     Gentoo linux boot scripts require either tmpfs or ramdisk support in the kernel, so
1768 zhen 1.6 2.2 kernel users need to make sure that ramdisk support is compiled in (ie, not a module).
1769     It is <comment>vital</comment> that a <e>gentoo=notmpfs</e> flag be added to the kernel
1770 peesh 1.103 line in <path>/boot/grub/grub.conf</path> or to the append line in <path>/etc/lilo.conf</path> for the 2.2 kernel so
1771 peesh 1.85 that a ramdisk is mounted for the boot scripts instead of tmpfs. If you choose not to use devfs, then
1772 zhen 1.6 <e>gentoo=notmpfs,nodevfs</e> should be used instead.
1773     </note>
1774 swift 1.121
1775     <pre caption = "Compiling and Installing the kernel">
1776     # <c>make dep &amp;&amp; make clean bzImage modules modules_install</c>
1777     # <c>cp /usr/src/linux/arch/i386/boot/bzImage /boot</c>
1778     </pre>
1779 swift 1.142 </body>
1780     </section>
1781     <section>
1782     <title>Installing a system logger</title>
1783     <body>
1784 zhen 1.16 <p>Your new custom kernel (and modules) are now installed. Now you need to choose a system
1785 zhen 1.6 logger that you would like to install. We offer sysklogd, which is the traditional set
1786     of system logging daemons. We also have msyslog and syslog-ng as well as metalog. Power users seem
1787     to gravitate away from sysklogd (not very good performance) and towards the
1788     newer alternatives.
1789     If in doubt, you may want to try metalog, since it seems to be quite popular.
1790 swift 1.142 To merge your logger of choice, type <e>one</e> of the next four
1791     lines. </p>
1792 jhhudso 1.81 <pre caption="Emerging System Logger of Choice">
1793 swift 1.142 # <c>emerge -k app-admin/sysklogd</c>
1794 drobbins 1.1 # <c>rc-update add sysklogd default</c>
1795     <comment>or</comment>
1796 swift 1.142 # <c>emerge -k app-admin/syslog-ng</c>
1797 drobbins 1.1 # <c>rc-update add syslog-ng default</c>
1798     <comment>or</comment>
1799 swift 1.142 # <c>emerge -k app-admin/metalog</c>
1800 drobbins 1.1 # <c>rc-update add metalog default</c>
1801     <comment>or</comment>
1802 swift 1.142 # <c>emerge -k app-admin/msyslog</c>
1803 drobbins 1.1 # <c>rc-update add msyslog default</c>
1804 jhhudso 1.81 </pre>
1805 zhen 1.16 <impo>
1806 zhen 1.6 Metalog flushes output to the disk in blocks, so messages aren't immediately recorded into
1807     the system logs. If you are trying to debug a daemon, this performance-enhancing behavior
1808     is less than helpful. When your Gentoo Linux system is up and running, you can send
1809     metalog a USR1 signal to temporarily turn off this message buffering (meaning that
1810     <i>tail -f <path>/var/log/everything/current</path></i> will now work
1811     in real time, as expected),
1812     and a USR2 signal to turn buffering back on
1813 zhen 1.39 again. If you want to disable buffering permanently, you can change METALOG_OPTS="-B" to METALOG_OPTS="-B -s"
1814     in <path>/etc/conf.d/metalog</path>.
1815 zhen 1.6 </impo>
1816 swift 1.114 <pre caption="Turning metalog buffering on/off">
1817     <codenote>To turn the buffering off:</codenote>
1818     # <c>killall -USR1 metalog</c>
1819     <codenote>To turn the buffering back on:</codenote>
1820     # <c>killall -USR2 metalog</c>
1821     </pre>
1822 jhhudso 1.75 <p>Now, you may optionally choose a cron package that you would like to use.
1823     Right now, we offer dcron, fcron and vcron. If you do not know which one to choose,
1824 swift 1.142 you might as well grab vcron.
1825 zhen 1.6 </p>
1826 jhhudso 1.81 <pre caption="Choosing a CRON Daemon">
1827 swift 1.142 # <c>emerge -k sys-apps/dcron</c>
1828 jhhudso 1.81 # <c>rc-update add dcron default</c>
1829 drobbins 1.1 # <c>crontab /etc/crontab</c>
1830     <comment>or</comment>
1831 swift 1.142 # <c>emerge -k sys-apps/fcron</c>
1832 jhhudso 1.81 # <c>rc-update add fcron default</c>
1833 drobbins 1.1 # <c>crontab /etc/crontab</c>
1834     <comment>or</comment>
1835 swift 1.142 # <c>emerge -k sys-apps/vcron</c>
1836 jhhudso 1.81 # <c>rc-update add vcron default</c>
1837     <comment>You do not need to run <c>crontab /etc/crontab</c> if using vcron.</comment>
1838     </pre>
1839     <p>For more information on starting programs and daemons at startup, see the
1840 drobbins 1.21 <uri link="/doc/en/rc-scripts.xml">rc-script guide</uri>.
1841 zhen 1.6 </p>
1842 zhen 1.16 </body>
1843     </section>
1844     </chapter>
1845     <chapter>
1846 swift 1.117 <title>Installing miscellaneous necessary packages</title>
1847 zhen 1.16 <section>
1848     <body>
1849     <p>If you need rp-pppoe to connect to the net, be aware that at this point
1850 zhen 1.6 it has not been installed. It would be the good time to do it. </p>
1851 jhhudso 1.81 <pre caption="Installing rp-pppoe">
1852 zhen 1.40 # <c>USE="-X" emerge rp-pppoe</c>
1853 swift 1.142 <comment>GRP users should type the following:</comment>
1854     # <c>USE="-X bindist" emerge -K rp-pppoe</c>
1855 jhhudso 1.81 </pre>
1856 zhen 1.40
1857     <note>The <i>USE="-X"</i> prevents pppoe from installing its optional X interface, which is a good thing,
1858     because X and its dependencies would also be emerged. You can always recompile <i>rp-pppoe</i> with
1859     X support later.
1860     </note>
1861 zhen 1.16 <note> Please note that the rp-pppoe is built but not configured.
1862 zhen 1.6 You will have to do it again using <c>adsl-setup</c> when you boot into your Gentoo system
1863     for the first time.
1864     </note>
1865 zhen 1.16 <p>You may need to install some additional packages in the Portage tree
1866 zhen 1.6 if you are using any optional features like XFS, ReiserFS or LVM. If you're
1867 zhen 1.50 using XFS, you should emerge the <c>xfsprogs</c> package:
1868 zhen 1.6 </p>
1869 jhhudso 1.81 <pre caption="Emerging Filesystem Tools">
1870 swift 1.142 # <c>emerge -k sys-apps/xfsprogs</c>
1871 jhhudso 1.75 <comment>If you would like to use ReiserFS, you should emerge the ReiserFS tools: </comment>
1872 swift 1.142 # <c>emerge -k sys-apps/reiserfsprogs</c>
1873 jhhudso 1.75 <comment>If you would like to use JFS, you should emerge the JFS tools: </comment>
1874 swift 1.142 # <c>emerge -k jfsutils</c>
1875 drobbins 1.1 <comment>If you're using LVM, you should emerge the <c>lvm-user</c> package: </comment>
1876 swift 1.142 # <c>emerge -k sys-apps/lvm-user</c>
1877 jhhudso 1.81 </pre>
1878 zhen 1.16 <p>If you're a laptop user and wish to use your PCMCIA slots on your first
1879 jhhudso 1.75 real reboot, you will want to make sure you install the <i>pcmcia-cs</i> package.
1880 zhen 1.6 </p>
1881 jhhudso 1.81 <pre caption="Emerging PCMCIA-cs">
1882 swift 1.142 # <c>emerge -k sys-apps/pcmcia-cs</c>
1883 jhhudso 1.81 </pre>
1884 swift 1.142 <!-- fix the bug or fix the docs, don't send the user in circles
1885     (drobbins)
1886     <warn>You will have to re-emerge <i>pcmcia-cs</i> after installation to get PCMCIA
1887 zhen 1.10 to work.
1888     </warn>
1889 swift 1.142 -->
1890     </body>
1891 zhen 1.16 </section>
1892     </chapter>
1893     <chapter>
1894 swift 1.134 <title>User Management</title>
1895 zhen 1.16 <section>
1896 swift 1.134 <title>Setting a root password</title>
1897 zhen 1.16 <body>
1898     <p>Before you forget, set the root password by typing: </p>
1899 jhhudso 1.81 <pre caption="Setting the root Password">
1900 zhen 1.16 # <c>passwd</c>
1901 jhhudso 1.81 </pre>
1902 swift 1.134 </body>
1903     </section>
1904     <section>
1905     <title>Adding a user for day-to-day use</title>
1906     <body>
1907     <p>Working as root on a Unix/Linux system is <e>dangerous</e> and
1908     should be avoided as much as possible. Therefor it is <e>strongly</e>
1909     recommended to add a user for day-to-day use.</p>
1910     <pre caption = "Adding a user">
1911 swift 1.135 # <i>useradd your_user -m -G users,wheel,audio -s /bin/bash</i>
1912 swift 1.134 # <i>passwd your_user</i></pre>
1913 swift 1.142 <p>Substitute <c>your_user</c> with your username.</p>
1914 swift 1.134 <p>Whenever you need to perform some task that only root can handle,
1915     use <c>su -</c> to change your privileges to root-privileges, or take
1916     a look at the <c>sudo</c> package.</p>
1917 zhen 1.16 </body>
1918     </section>
1919     </chapter>
1920     <chapter>
1921 zhen 1.61 <title>Setting your Hostname</title>
1922 zhen 1.16 <section>
1923     <body>
1924 swift 1.121 <p>
1925     Edit <path>/etc/hostname</path> so that it contains your hostname
1926     on a single line, i.e. <c>mymachine</c>.
1927     </p>
1928 jhhudso 1.81 <pre caption="Configuring Hostname">
1929 swift 1.121 # <i>echo mymachine &gt; /etc/hostname</i>
1930     </pre>
1931     <p>
1932     Then edit <path>/etc/dnsdomainname</path> so that it contains your DNS
1933     domainname, i.e. <c>mydomain.com</c>.
1934     </p>
1935     <pre caption="Configuring Domainname">
1936     # <i>echo mydomain.com &gt; /etc/dnsdomainname</i>
1937     </pre>
1938     <p>
1939     If you have a NIS domain, you should set it in
1940     <path>/etc/nisdomainname</path>.
1941     </p>
1942     <pre caption="Configuring NIS Domainname">
1943     # <i>echo nis.mydomain.com &gt; /etc/nisdomainname</i>
1944 jhhudso 1.81 </pre>
1945 zhen 1.16 </body>
1946     </section>
1947     </chapter>
1948     <chapter>
1949 zhen 1.61 <title>Modifying /etc/hosts</title>
1950 zhen 1.16 <section>
1951     <body>
1952 peesh 1.99 <p>This file contains a list of IP addresses and their associated hostnames.
1953 jhhudso 1.75 It is used by the system to resolve the IP addresses
1954     of any hostnames that may not be in your nameservers. Here is a template for this file:
1955 zhen 1.6 </p>
1956 jhhudso 1.81 <pre caption="Hosts Template">
1957 drobbins 1.1 127.0.0.1 localhost
1958     <comment># the next line contains your IP for your local LAN, and your associated machine name</comment>
1959     192.168.1.1 mymachine.mydomain.com mymachine
1960 jhhudso 1.81 </pre>
1961 swift 1.136 <note>If you are on a DHCP network, it might be helpful to add your
1962     machine's actual hostname after <i>localhost</i>. This will help
1963     GNOME and many other programs in name resolution.
1964     </note>
1965 zhen 1.16 </body>
1966     </section>
1967     </chapter>
1968     <chapter>
1969     <title>Final Network Configuration</title>
1970     <section>
1971     <body>
1972     <p>Add the names of any modules that are necessary for the proper functioning of your system to
1973 zhen 1.6 <path>/etc/modules.autoload</path> file (you can also add any options you
1974     need to the same line.) When Gentoo Linux boots, these modules will be automatically
1975     loaded. Of particular importance is your ethernet card module, if you happened to compile
1976     it as a module:
1977     </p>
1978 jhhudso 1.81 <pre caption="/etc/modules.autoload"><comment>This is assuming that you are using a 3com card.
1979     Check <path>/lib/modules/`uname -r`/kernel/drivers/net</path> for your card. </comment>
1980 drobbins 1.1 3c59x
1981 jhhudso 1.81 </pre>
1982 zhen 1.16 <p>Edit the <path>/etc/conf.d/net</path> script to get your network configured for your
1983 zhen 1.6 first boot: </p>
1984 jhhudso 1.81 <pre caption="Boot time Network Configuration">
1985 drobbins 1.1 # <c>nano -w /etc/conf.d/net</c>
1986     # <c>rc-update add net.eth0 default</c>
1987 jhhudso 1.81 </pre>
1988 swift 1.115 <p>If you have multiple network cards or tokenring interfaces, you need to create additional <path>net.eth<comment>x</comment></path> or <path>net.tr<comment>x</comment></path>
1989     scripts respectively for each one (<comment>x</comment> = 1, 2, ...): </p>
1990 jhhudso 1.81 <pre caption="Multiple Network Interfaces">
1991 drobbins 1.1 # <c>cd /etc/init.d</c>
1992     # <c>cp net.eth0 net.eth<comment>x</comment></c>
1993     # <c>rc-update add net.eth<comment>x</comment> default</c>
1994 jhhudso 1.81 </pre>
1995 zhen 1.16 <p>If you have a PCMCIA card installed, have a quick look into
1996 zhen 1.6 <path>/etc/init.d/pcmcia</path> to verify that things seem all right for your setup,
1997 zhen 1.45 then add this line to the top of <path>/etc/init.d/net.ethx</path>:
1998 zhen 1.6 </p>
1999 jhhudso 1.81 <pre caption="PCMCIA depend in /etc/init.d/net.ethx">
2000 drobbins 1.1 depend() {
2001     need pcmcia
2002     }
2003 jhhudso 1.81 </pre>
2004 zhen 1.16 <p>This makes sure that the PCMCIA drivers are autoloaded whenever your network is loaded.
2005 zhen 1.10 </p>
2006 zhen 1.16 </body>
2007     </section>
2008     </chapter>
2009     <chapter>
2010     <title>Final steps: Configure Basic Settings (including the international keymap setting)</title>
2011     <section>
2012     <body>
2013 jhhudso 1.81 <pre caption="Basic Configuration">
2014 drobbins 1.1 # <c>nano -w /etc/rc.conf</c>
2015 jhhudso 1.81 </pre>
2016 zhen 1.16 <p>Follow the directions in the file to configure the basic settings.
2017 zhen 1.6 All users will want to make sure that <c>CLOCK</c> is set to his/her
2018     liking. International keyboard users will want to set the <c>KEYMAP</c>
2019     variable (browse <path>/usr/share/keymaps</path> to see the various
2020     possibilities).
2021     </p>
2022 zhen 1.16 </body>
2023     </section>
2024     </chapter>
2025     <chapter>
2026 zhen 1.61 <title>Configure a Bootloader</title>
2027 zhen 1.49 <section>
2028     <title>Notes</title>
2029     <body>
2030     <p> In the spirit of Gentoo, users now have more than one bootloader to choose from.
2031     Using our virtual package system, users are now able to choose between both GRUB and
2032 swift 1.142 LILO as their bootloaders.
2033 zhen 1.49 </p>
2034     <p> Please keep in mind that having both bootloaders installed is not necessary.
2035 jhhudso 1.75 In fact, it can be a hindrance, so please only choose one.
2036 zhen 1.49 </p>
2037 swift 1.142 <p>In addition, you will need to configure our bootloader differently depending upon
2038     whether you are using <c>genkernel</c> (with kernel and initrd) or a kernel you
2039     compiled by hand. Be sure to take note of the important differences.</p>
2040    
2041 drobbins 1.69 <impo>If you are installing Gentoo Linux on a system with an NVIDIA nForce or nForce2 chipset
2042     with an integrated GeForce graphics card, you should use LILO and avoid GRUB. With on-board
2043 drobbins 1.70 video enabled, the low memory area of your RAM may be used as video RAM. Since GRUB also uses low
2044     memory at boot time, it may experience an "out of memory" condition. So, if you have an nForce
2045 drobbins 1.69 or potentially other board with on-board video, use LILO. Even if you're using off-board video
2046 jhhudso 1.75 right now, it would be nice to be able to remove the graphics card and use the on-board video in a
2047 drobbins 1.69 pinch, wouldn't it? :)</impo>
2048 zhen 1.49 </body>
2049     </section>
2050 zhen 1.16 <section>
2051 zhen 1.49 <title>Configuring GRUB</title>
2052 zhen 1.16 <body>
2053     <p>The most critical part of understanding GRUB is getting comfortable with how GRUB
2054 zhen 1.6 refers to hard drives and partitions. Your Linux partition <path>/dev/hda1</path> is called
2055     <path>(hd0,0)</path> under GRUB. Notice the parenthesis around the hd0,0 - they are required.
2056 zhen 1.16 Hard drives count from zero rather than &quot;a&quot;, and partitions start at zero rather than one.
2057 swift 1.142 Be aware too that with the hd devices, only hard drives are counted, not atapi-ide devices such as
2058 zhen 1.6 cdrom players, burners, and that the same construct can be used with scsi drives.
2059     (Normally they get higher numbers than ide drives except when the bios is configured
2060 swift 1.142 to boot from scsi devices.) Assuming you have a hard drive on /dev/hda, a cdrom player on /dev/hdb,
2061     a burner on /dev/hdc, a second hard drive on /dev/hdd and no SCSI hard drive,
2062 zhen 1.6 <path>/dev/hdd7</path> gets translated to <path>(hd1,6)</path>.
2063    
2064 swift 1.142 It might sound tricky, and tricky it is indeed, but as we will see, GRUB
2065 zhen 1.6 offers a tab completion mechanism that comes handy for those of you having
2066 swift 1.142 a lot of hard drives and partitions and who are a little lost in the
2067     GRUB numbering scheme. Having gotten the feel for that,
2068 jhhudso 1.75 it is time to install GRUB.
2069 zhen 1.6 </p>
2070 zhen 1.16 <p>The easiest way to install GRUB is to simply type <c>grub</c> at your chrooted shell prompt: </p>
2071 jhhudso 1.81 <pre caption="Installing GRUB">
2072 swift 1.142 # <c>emerge -k grub</c>
2073 drobbins 1.1 # <c>grub</c>
2074 jhhudso 1.81 </pre>
2075 jhhudso 1.75 <p>You will be presented with the <c>grub&gt;</c> grub
2076 zhen 1.6 command-line prompt. Now, you need to type in the
2077     right commands to install the GRUB boot record onto your hard drive. In my example configuration,
2078     I want to install the GRUB boot record on my hard drive's MBR (master boot record), so that
2079     the first thing I see when I turn on the computer is the GRUB prompt. In my case, the commands
2080     I want to type are:
2081     </p>
2082 zhen 1.68
2083 jhhudso 1.81 <pre caption="GRUB on the MBR">
2084 zhen 1.68 grub&gt; <c>root (hd0,0)</c> <codenote>Your boot partition</codenote>
2085     grub&gt; <c>setup (hd0)</c> <codenote>Where the boot record is installed, here, it is the MBR</codenote>
2086 jhhudso 1.81 </pre>
2087 zhen 1.68
2088 jhhudso 1.81 <pre caption="GRUB not on the MBR">
2089 zhen 1.53 <comment>Alternatively, if you wanted to install the bootloader somewhere other than the MBR</comment>
2090 zhen 1.68 grub&gt; <c>root (hd0,0)</c> <codenote>Your boot partition</codenote>
2091     grub&gt; <c>setup (hd0,4)</c> <codenote>Where the boot record is installed, here it is /dev/hda5</codenote>
2092 drobbins 1.1 grub&gt; <c>quit</c>
2093 jhhudso 1.81 </pre>
2094 swift 1.136
2095 jhhudso 1.75 <p>Here is how the two commands work. The first <c>root ( )</c> command tells GRUB
2096 zhen 1.6 the location of your boot partition (in our example, <path>/dev/hda1</path> or
2097     <path>(hd0,0)</path> in GRUB terminology. Then, the second <c>setup ( )
2098     </c> command tells GRUB where to install the
2099     boot record - it will be configured to look for its special files at the <c>root
2100     ( )</c> location that you specified. In my case, I want the boot record on the
2101     MBR of the hard drive, so I simply specify <path>/dev/hda</path> (also known as <path>(hd0)</path>).
2102     If I were using another boot loader and wanted to set up GRUB as a secondary boot-loader, I
2103     could install GRUB to the boot record of a particular partition. In that case,
2104 jhhudso 1.75 I would specify a particular partition rather than the entire disk. Once the GRUB
2105 zhen 1.6 boot record has been successfully installed, you can type <c>quit</c> to quit GRUB.
2106 zhen 1.52 </p>
2107 zhen 1.6
2108 swift 1.142 <note> The tab completion mechanism of GRUB can be used from within GRUB,
2109 zhen 1.6 assuming you wrote <c> root (</c> and that you hit the TAB key, you would
2110 swift 1.142 be prompted with a list of the available devices (not only hard drives),
2111     hitting the TAB key having written <c> root (hd</c>, GRUB would print the
2112     available hard drives and hitting the TAB key after writing <c> root (hd0,</c>
2113     would make GRUB print the list of partitions on the first hard drive.
2114 zhen 1.6
2115 swift 1.142 Checking the syntax of the GRUB location with completion should really help
2116 zhen 1.6 to make the right choice.
2117     </note>
2118    
2119 zhen 1.52 <p>
2120 zhen 1.6 Gentoo Linux is now
2121     installed, but we need to create the <path>/boot/grub/grub.conf</path> file so that
2122 jhhudso 1.75 we get a nice GRUB boot menu when the system reboots. Here is how to do it.
2123 zhen 1.6 </p>
2124 zhen 1.16 <impo>To ensure backwards compatibility with GRUB, make sure to make a link from
2125 zhen 1.6 <i>grub.conf</i> to <i>menu.lst</i>. You can do this by doing
2126 swift 1.142 <c>ln -s /boot/grub/grub.conf /boot/grub/menu.lst</c>. </impo>
2127 zhen 1.16 <p>Now, create the grub.conf file (<c>nano -w /boot/grub/grub.conf</c>), and add the following to it:
2128 zhen 1.6 </p>
2129 swift 1.142 <pre caption="grub.conf for GRUB">
2130 drobbins 1.1 default 0
2131     timeout 30
2132     splashimage=(hd0,0)/boot/grub/splash.xpm.gz
2133    
2134 swift 1.142 <comment>#if you compiled your own kernel, use something like this:</comment>
2135 drobbins 1.1 title=My example Gentoo Linux
2136     root (hd0,0)
2137 zhen 1.51 kernel (hd0,0)/boot/bzImage root=/dev/hda3
2138 drobbins 1.1
2139 swift 1.142 <comment>#if you're using genkernel, use something like this instead:</comment>
2140     title=My example Gentoo Linux (genkernel)
2141     root (hd0,0)
2142     kernel (hd0,0)/boot/kernel-KV root=/dev/hda3
2143     initrd (hd0,0)/boot/initrd-KV
2144    
2145 drobbins 1.1 <comment># Below needed only for people who dual-boot</comment>
2146 jhhudso 1.81 title=Windows XP
2147 drobbins 1.1 root (hd0,5)
2148 zhen 1.67 chainloader (hd0,5)+1
2149 jhhudso 1.81 </pre>
2150 zhen 1.16 <note>
2151 zhen 1.6 (hd0,0) should be written without any spaces inside the parentheses.
2152     </note>
2153 zhen 1.16 <impo>
2154 swift 1.142 If you set up SCSI emulation for an IDE cd burner earlier, then to get it to
2155 zhen 1.16 actually work you need to add an &quot;hdx=ide-scsi&quot; fragment to the kernel
2156     line in grub.conf (where &quot;hdx&quot; should be the device for your cd burner).
2157 zhen 1.6 </impo>
2158 zhen 1.16 <p>After saving this file, Gentoo Linux installation is complete. Selecting the first option will
2159 zhen 1.6 tell GRUB to boot Gentoo Linux without a fuss. The second part of the grub.conf file is optional,
2160     and shows you how to use GRUB to boot a bootable Windows partition.
2161     </p>
2162 zhen 1.16 <note>Above, <path>(hd0,0)</path> should point to your &quot;boot&quot; partition
2163 zhen 1.6 (<path>/dev/hda1</path> in our example config) and <path>/dev/hda3</path> should point to
2164     your root filesystem. <path>(hd0,5)</path> contains the NT boot
2165     loader.
2166 zhware 1.9 </note>
2167 zhen 1.16 <note>
2168 zhware 1.9 The path to the kernel image is relative to the boot partition. If for example you have separated boot partition <path>(hd0,0)</path> and root partition <path>(hd0,1)</path>, all paths in the grub.conf file above will become <path>/bzImage</path>.
2169 zhen 1.6 </note>
2170 zhen 1.16 <p>If you need to pass any additional options to the kernel, simply
2171 zhen 1.6 add them to the end of the <c>kernel</c> command. We're already passing one option
2172     (<c>root=/dev/hda3</c>), but you can pass others as well. In particular, you can
2173     turn off devfs by default (not recommended unless you know what you're doing) by
2174     adding the <c>gentoo=nodevfs</c> option to the <c>kernel</c> command.
2175     </p>
2176 zhen 1.16 <note>Unlike in earlier versions of Gentoo Linux, you no longer have to add
2177 swift 1.142 <c>devfs=mount</c> to the end of the <c>kernel</c> line to enable devfs.
2178     Now devfs is enabled by default.
2179 zhen 1.6 </note>
2180 zhen 1.16 </body>
2181     </section>
2182 zhen 1.49 <section>
2183     <title>Configuring LILO</title>
2184 zhen 1.16 <body>
2185 drobbins 1.21 <p>While GRUB may be the new alternative for most people, it is not always the best choice.
2186 jhhudso 1.75 LILO, the LInuxLOader, is the tried and true workhorse of Linux bootloaders. Here is how to install
2187 drobbins 1.21 LILO if you would like to use it instead of GRUB:
2188 zhen 1.16 </p>
2189     <p>The first step is to emerge LILO:
2190     </p>
2191 jhhudso 1.81 <pre caption="Emerging LILO">
2192 swift 1.142 # <c>emerge -k lilo</c>
2193 jhhudso 1.81 </pre>
2194 zhen 1.82 <p>Now it is time to configure LILO. Here is a sample configuration file <path>/etc/lilo.conf</path>
2195 zhen 1.16 </p>
2196 jhhudso 1.81 <pre caption="Example lilo.conf">
2197 zhen 1.16 boot=/dev/hda
2198     map=/boot/map
2199     install=/boot/boot.b
2200     prompt
2201     timeout=50
2202     lba32
2203     default=linux
2204    
2205 swift 1.142 #use something like the following 4 lines if you compiled your kernel yourself
2206 swift 1.111 image=/boot/bzImage
2207 zhen 1.16 label=linux
2208     read-only
2209 zhen 1.82 root=/dev/hda3
2210 swift 1.142
2211     #if you used genkernel, use something like this:
2212     image=/boot/kernel-KV
2213     label=gk_linux
2214     root=/dev/hda3
2215     initrd=/boot/initrd-KV
2216     append="root=/dev/ram0 init=/linuxrc"
2217    
2218 zhen 1.16
2219     #For dual booting windows/other OS
2220     other=/dev/hda1
2221     label=dos
2222 jhhudso 1.81 </pre>
2223 zhen 1.52 <ul>
2224 zhen 1.16 <li><i>boot=/dev/hda</i> tells LILO to install itself on the first hard disk on the first IDE controller. </li>
2225     <li><i>map=/boot/map</i> states the map file. In normal use, this should not be modified. </li>
2226     <li><i>install=/boot/boot.b</i> tells LILO to install the specified file as the new boot sector.
2227     In normal use, this should not be altered. If the install line is missing, LILO will
2228     assume a default of /boot/boot.b as the file to be used. </li>
2229 zhen 1.83 <li>The existence of <i>prompt</i> tells LILO to display the classic <i>lilo:</i> prompt at bootup.
2230 zhen 1.16 While it is not recommended that you remove the prompt line, if you do remove it, you can still
2231     get a prompt by holding down the [Shift] key while your machine starts to boot. </li>
2232     <li><i>timeout=50</i> sets the amount of time that LILO will wait for user input before proceeding
2233     with booting the default line entry. This is measured in tenths of a second, with 50 as the default. </li>
2234     <li><i>lba32</i> describes the hard disk geometry to LILO. Another common entry here is linear. You should
2235     not change this line unless you are very aware of what you are doing. Otherwise, you could put
2236     your system in an unbootable state. </li>
2237     <li><i>default=linux</i> refers to the default operating system for LILO to boot from the
2238     options listed below this line. The name linux refers to the label line below in each of the boot options. </li>
2239 swift 1.111 <li><i>image=/boot/bzImage</i> specifies the linux kernel to boot with this particular boot option. </li>
2240 zhen 1.16 <li><i>label=linux</i> names the operating system option in the LILO screen. In this case,
2241     it is also the name referred to by the default line. </li>
2242     <li><i>read-only</i> specifies that the root partition (see the root line below) is read-only and cannot be
2243     altered during the boot process. </li>
2244 peesh 1.128 <li><i>root=/dev/hda3</i> tells LILO what disk partition to use as the root partition. </li>
2245 zhen 1.52 </ul>
2246 zhen 1.16 <p>After you have edited your <i>lilo.conf</i> file, it is time to run LILO to load the information
2247     into the MBR:
2248     </p>
2249 jhhudso 1.81 <pre caption="Running LILO">
2250 zhen 1.16 # <c>/sbin/lilo</c>
2251 jhhudso 1.81 </pre>
2252 zhen 1.16 <p>LILO is configured, and now your machine is ready to boot into Gentoo Linux!
2253     </p>
2254     </body>
2255     </section>
2256 swift 1.142 <section>
2257     <title>Using framebuffer</title>
2258     <body>
2259     <p>
2260     People who have selected framebuffer in their kernel should add <c>vga=xxx</c> to their bootloader configuration file. <c>xxx</c> is one of the values in the following table:
2261     </p>
2262     <table>
2263     <tr><ti></ti><th>640x480</th><th>800x600</th><th>1024x768</th><th>1280x1024</th></tr>
2264     <tr><th>8 bpp</th><ti>769</ti><ti>771</ti><ti>773</ti><ti>775</ti></tr>
2265     <tr><th>16 bpp</th><ti>785</ti><ti>788</ti><ti>791</ti><ti>794</ti></tr>
2266     <tr><th>32 bpp</th><ti>786</ti><ti>789</ti><ti>792</ti><ti>795</ti></tr>
2267     </table>
2268     <p>
2269     LILO-users will have to add <c>vga=xxx</c> on top of their configuration
2270     file.
2271     </p>
2272     <p>
2273     GRUB-users will have to append <c>vga=xxx</c> to the <c>kernel
2274     (hd0,0)...</c> line.
2275     </p>
2276     </body>
2277     </section>
2278 zhen 1.16 </chapter>
2279     <chapter>
2280 zhen 1.66 <title>Creating Bootdisks</title>
2281 zhen 1.16 <section>
2282     <title>GRUB Bootdisks</title>
2283     <body>
2284 swift 1.142 <impo>
2285     Don't forget to insert a floppy in your floppydrive
2286     before proceeding.
2287     </impo>
2288 drobbins 1.21 <p>It is always a good idea to make a boot disk the first
2289 zhen 1.16 time you install any Linux distribution. This is a security
2290 swift 1.136 blanket, and generally not a bad thing to do. If your hardware doesn't
2291     let you install a working bootloader from the chrooted environment,
2292     you may <e>need</e> to make a GRUB boot disk.
2293     If you are in this camp, make a GRUB boot disk, and when you reboot
2294     the first time you can install GRUB to the MBR. Make your bootdisks
2295     like this:
2296 zhen 1.6 </p>
2297 jhhudso 1.81 <pre caption="Creating a GRUB Bootdisk">
2298 swift 1.116 # <c>cd /usr/share/grub/i386-pc/</c>
2299     # <c>cat stage1 stage2 > /dev/fd0</c>
2300 jhhudso 1.81 </pre>
2301 zhen 1.26 <p>Now reboot and load the floppy. At the floppy's <c>grub&gt;</c> prompt, you can now execute the necessary <c>root</c>
2302 drobbins 1.21 and <c>setup</c> commands.</p>
2303 zhen 1.16 </body>
2304     </section>
2305     <section>
2306     <title>LILO Bootdisks</title>
2307     <body>
2308 swift 1.142 <impo>
2309     Don't forget to insert a floppy in your floppydrive
2310     before proceeding.
2311     </impo>
2312    
2313 zhen 1.16 <p>If you are using LILO, it is also a good idea to make a bootdisk:
2314     </p>
2315 peesh 1.126 <pre caption="Making a Bootdisk">
2316 zhen 1.18 # <c>dd if=/boot/your_kernel of=/dev/fd0 </c>
2317     <comment>This will only work if your kernel is smaller than 1.4MB</comment>
2318 jhhudso 1.81 </pre>
2319 zhen 1.16 </body>
2320     </section>
2321     </chapter>
2322 swift 1.142
2323     <chapter>
2324     <title>Using GRP</title>
2325     <section>
2326     <body>
2327    
2328     <p>GRP users can, at this point, install binary packages:</p>
2329    
2330     <pre caption="Installing from GRP">
2331     # <c>USE="bindist" emerge -k xfree</c>
2332     <codenote>USE="bindist" must be set while installing GRP packages that use XFree86.</codenote>
2333     </pre>
2334    
2335     <p>CD 1 contains enough applications to install a working system with XFree86.
2336     Additionally, CD2 of the 2-CD GRP set contains other applications including KDE, GNOME, Mozilla, and others.
2337     To install these packages, you will need to reboot into your new Gentoo
2338     system first (covered in the "Installation complete!" section near the end of this document.) After you are running your basic Gentoo system from the hard
2339     drive, you can mount the second CD and copy files:</p>
2340    
2341     <pre caption="Loading binary packages from CD2">
2342     # <c>mount /dev/cdrom /mnt/cdrom</c>
2343     # <c>cp -a /mnt/cdrom/packages/* /usr/portage/packages/</c>
2344     </pre>
2345    
2346     <p>Now various other applications can be installed the same way. For example:</p>
2347    
2348     <pre caption="Installing KDE from GRP">
2349     # <c>USE="bindist" emerge -k kde</c>
2350     </pre>
2351    
2352     </body>
2353     </section>
2354     </chapter>
2355 zhen 1.16 <chapter>
2356     <title>Installation Complete!</title>
2357     <section>
2358     <body>
2359 swift 1.142 <p>Now, Gentoo Linux is installed. The only remaining step is to update necessary configuration files, exit the chrooted shell,
2360 jhhudso 1.75
2361 zhen 1.6 safely unmount your partitions
2362     and reboot the system:
2363     </p>
2364 swift 1.142 <warn>
2365     <c>etc-update</c> can provide you with a list of configuration files
2366     that have newer versions at your disposal. Verify that none of the
2367     configuration files have a big impact (such as <path>/etc/fstab</path>,
2368     <path>/etc/make.conf</path>, <path>/etc/rc.conf</path>, ...). Merge the
2369     files that don't have such a big impact, remove the updates of the
2370     others or view the diff and manually update the configuration file.
2371     </warn>
2372 jhhudso 1.81 <pre caption="Rebooting the System">
2373 drobbins 1.1 # <c>etc-update</c>
2374     # <c>exit</c>
2375 jhhudso 1.81 <comment>(This exits the chrooted shell; you can also type <c>^D</c>)</comment>
2376 drobbins 1.1 # <c>cd / </c>
2377     # <c>umount /mnt/gentoo/boot</c>
2378     # <c>umount /mnt/gentoo/proc</c>
2379     # <c>umount /mnt/gentoo</c>
2380     # <c>reboot</c>
2381 swift 1.142 <comment>(Don't forget to remove the bootable CD)</comment>
2382 jhhudso 1.81 </pre>
2383 zhen 1.16 <note>
2384 zhen 1.6 After rebooting, it is a good idea to run the <c>update-modules</c> command to create
2385     the <path>/etc/modules.conf</path> file. Instead of modifying this file directly, you should
2386     generally make changes to the files in <path>/etc/modules.d</path>.
2387     </note>
2388 zhen 1.16 <p>If you have any questions or would like to get involved with Gentoo Linux development,
2389 zhen 1.6 consider joining our gentoo-user and gentoo-dev mailing lists
2390 seo 1.84 (more information on our <uri link="http://www.gentoo.org/main/en/lists.xml">mailing lists</uri> page).
2391 zhen 1.6 We also have a handy <uri link="http://www.gentoo.org/doc/en/desktop.xml">Desktop configuration guide</uri>
2392     that will
2393     help you to continue configuring your new Gentoo Linux system, and a useful
2394     <uri link="http://www.gentoo.org/doc/en/portage-user.xml">Portage user guide</uri>
2395     to help familiarize you with Portage basics. You can find the rest of the Gentoo Documentation
2396 zhen 1.16 <uri link="http://www.gentoo.org/main/en/docs.xml">here</uri>. If you have any other questions
2397 zhen 1.10 involving installation or anything for that matter, please check the Gentoo Linux
2398 zhen 1.16 <uri link="http://www.gentoo.org/doc/en/faq.xml">FAQ</uri>.
2399 zhen 1.6 Enjoy and welcome to Gentoo Linux!
2400     </p>
2401 zhen 1.16 </body>
2402     </section>
2403     </chapter>
2404     <chapter>
2405     <title>Gentoo-Stats</title>
2406     <section>
2407     <body>
2408     <p>The Gentoo Linux usage statistics program was started as an attempt to give the developers
2409 zhen 1.6 a way to find out about their user base. It collects information about Gentoo Linux usage to help
2410     us in set priorities our development. Installing it is completely optional, and it would be greatly
2411     appreciated if you decide to use it. Compiled statistics can be viewed at <uri>http://stats.gentoo.org/</uri>.
2412     </p>
2413 zhen 1.16 <p>The gentoo-stats server will assign a unique ID to your system.
2414 zhen 1.6 This ID is used to make sure that each system is counted only once. The ID will not be used
2415 peesh 1.99 to individually identify your system, nor will it be matched against an IP address or
2416 zhen 1.6 other personal information. Every precaution has been taken to assure your privacy in the
2417     development of this system. The following are the things that we are monitoring
2418 zhen 1.16 right now through our &quot;gentoo-stats&quot; program:
2419 zhen 1.6 </p>
2420 zhen 1.16 <ul>
2421     <li>installed packages and their version numbers</li>
2422     <li>CPU information: speed (MHz), vendor name, model name, CPU flags (like &quot;mmx&quot; or &quot;3dnow&quot;)</li>
2423     <li>memory information (total available physical RAM, total available swap space)</li>
2424     <li>PCI cards and network controller chips</li>
2425     <li>the Gentoo Linux profile your machine is using (that is, where the /etc/make.profile link is pointing to).</li>
2426     </ul>
2427     <p>We are aware that disclosure of sensitive information is a threat to most Gentoo Linux users
2428 zhen 1.6 (just as it is to the developers).
2429     </p>
2430 zhen 1.16 <ul>
2431     <li>Unless you modify the gentoo-stats program, it will never transmit sensitive
2432 zhen 1.6 information such as your passwords, configuration data, shoe size...</li>
2433 zhen 1.16 <li>Transmission of your e-mail addresses is optional and turned off by default.</li>
2434     <li>The IP address your data transmission originates from will never be logged
2435     in such a way that we can identify you. There are no &quot;IP address/system ID&quot; pairs.</li>
2436     </ul>
2437     <p>The installation is easy - just run the following commands:
2438 zhen 1.6 </p>
2439 jhhudso 1.81 <pre caption="Installing gentoo-stats">
2440 drobbins 1.1 # <c>emerge gentoo-stats</c> <codenote>Installs gentoo-stats</codenote>
2441     # <c>gentoo-stats --new</c> <codenote>Obtains a new system ID</codenote>
2442 jhhudso 1.81 </pre>
2443 zhen 1.16 <p>The second command above will request a new system ID and enter it into
2444 zhen 1.6 <path>/etc/gentoo-stats/gentoo-stats.conf</path> automatically. You can view this file
2445     to see additional configuration options.
2446     </p>
2447 zhen 1.16 <p>After that, the program should be run on a regular schedule
2448 zhen 1.6 (gentoo-stats does not have to be run as root). Add this line to your <path>crontab</path>:
2449     </p>
2450 jhhudso 1.81 <pre caption="Updating gentoo-stats with cron">
2451     <c>0 0 * * 0,4 /usr/sbin/gentoo-stats --update &gt; /dev/null</c>
2452     </pre>
2453 zhen 1.16 <p>The <c>gentoo-stats</c> program is a simple perl script which can be
2454 jhhudso 1.75 viewed with your favorite pager or editor: <path>/usr/sbin/gentoo-stats</path>. </p>
2455 zhen 1.16 </body>
2456     </section>
2457     </chapter>
2458 swift 1.137 <chapter>
2459     <title>Gentoo On Less-Common Hardware</title>
2460     <section>
2461     <title>Hardware ATA RAID</title>
2462     <body>
2463     <p>
2464     Users who want to install Gentoo on Hardware ATA RAID must pay
2465     attention to the next steps in order for them to succesfully
2466     install Gentoo Linux:
2467     </p>
2468     <ul>
2469     <li>Be sure to start the LiveCD with the <c>doataraid</c>
2470     kerneloption.</li>
2471     <li>If you've forgotten to select <c>doataraid</c> during bootup,
2472     or the modules mysteriously didn't load, load them as needed:
2473     <pre caption = "Loading RAID modules">
2474     # <i>modprobe ataraid</i>
2475     <comment>For Promise Raid Controllers:</comment>
2476     # <i>modprobe pdcraid</i>
2477     <comment>For Highpoint Raid Controllers:</comment>
2478 swift 1.138 # <i>modprobe hptraid</i>
2479 swift 1.137 </pre>
2480     </li>
2481     <li>Some ATA RAID Controllers require you to reboot after
2482     partitioning; formatting will otherwise fail.</li>
2483     <li>Before chrooting, mount the devicetree into the new
2484     environment:
2485     <pre caption = "Mounting /dev into /mnt/gentoo/dev">
2486     # <i>mount -o bind /dev /mnt/gentoo/dev</i>
2487     </pre>
2488     </li>
2489     <li>During kernel configuration, select the required RAID options:
2490     <pre caption = "RAID in the Linux Kernel Configuration">
2491     <comment>For Highpoint RAID controllers:</comment>
2492     ATA/IDE/MFM/RLL support ---&gt;
2493     [*] HPT36X/37X chipset support
2494     [*] Support for IDE Raid controllers
2495     [*] Highpoint 370 software RAID
2496     <comment>For Promise RAID controllers:</comment>
2497     ATA/IDE/MFM/RLL support ---&gt;
2498     [*] PROMISE PDC202{46|62|65|67} support
2499     <comment>and/or</comment>
2500     [*] PROMISE PDC202{68|69|70|71|75|76|77} support
2501     [*] Support for IDE Raid controllers
2502     [*] Support Promise software RAID (Fasttrak(tm))
2503     </pre></li>
2504     <li>When using GRUB add <c>--stage2=/boot/grub/stage2</c> when
2505     running <c>grub</c> to the <c>setup</c> command:
2506     <pre caption = "Installing GRUB for Hardware RAID systems">
2507     grub&gt; <i>root (hd0,0)</i>
2508     grub&gt; <i>setup --stage2=/boot/grub/stage2 (hd0)</i>
2509     grub&gt; <i>quit</i>
2510     </pre>
2511     Also, in the GRUB configuration be sure to point the <c>root</c>
2512     to the appropriate RAID device:
2513     <pre caption = "grub.conf for RAID">
2514     title=My Gentoo Linux on RAID
2515     root (hd0,0)
2516     kernel (hd0,0)/boot/bzImage root=/dev/ataraid/dXpY
2517     </pre></li>
2518     <li>LILO users should set the <c>root</c> option to the
2519     appropriate RAID device:
2520     <pre caption = "lilo.conf for RAID">
2521     image=/boot/bzImage
2522     label=linux
2523     read-only
2524     root=/dev/ataraid/dXpY
2525     </pre></li>
2526     </ul>
2527     </body>
2528     </section>
2529     </chapter>
2530 drobbins 1.1 </guide>

  ViewVC Help
Powered by ViewVC 1.1.20