/[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.193 - (hide annotations) (download) (as text)
Sun Jan 18 11:01:12 2004 UTC (14 years, 1 month ago) by swift
Branch: MAIN
Changes since 1.192: +22 -7 lines
File MIME type: application/xml
Updates on installation doc

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