/[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.145 - (hide annotations) (download) (as text)
Wed Aug 6 08:27:07 2003 UTC (14 years, 2 months ago) by avenj
Branch: MAIN
Changes since 1.144: +1 -1 lines
File MIME type: application/xml
----------------------------------------------------------------------
Fixed bug with packages.

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

  ViewVC Help
Powered by ViewVC 1.1.20