/[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.181 - (hide annotations) (download) (as text)
Sat Oct 25 12:00:08 2003 UTC (14 years, 9 months ago) by swift
Branch: MAIN
Changes since 1.180: +7 -7 lines
File MIME type: application/xml
Make the guide more consistent in the used examples

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