/[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.72 - (hide annotations) (download) (as text)
Thu Feb 27 11:43:46 2003 UTC (14 years, 6 months ago) by jhhudso
Branch: MAIN
Changes since 1.71: +2 -1 lines
File MIME type: application/xml
*** empty log message ***

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 drobbins 1.69 <title>Gentoo Linux 1.4_rc2 and 1.4_rc3 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     <author title="Author">
10     <mail link="jerry@gentoo.org">Jerry Alexandratos</mail>
11     </author>
12     <author title="Ghost">
13     <mail link="g2boojum@gentoo.org">Grant Goodyear</mail>
14     </author>
15     <author title="Editor">
16     <mail link="zhen@gentoo.org">John P. Davis</mail>
17     </author>
18     <author title="Editor">
19     <mail link="Pierre-Henri.Jondot@wanadoo.fr">Pierre-Henri Jondot</mail>
20     </author>
21     <author title="Editor">
22     <mail link="stocke2@gentoo.org">Eric Stockbridge</mail>
23     </author>
24     <author title="Editor">
25     <mail link="rajiv@gentoo.org">Rajiv Manglani</mail>
26     </author>
27 seo 1.41 <author title="Editor">
28     <mail link="seo@gentoo.org">Jungmin Seo</mail>
29     </author>
30 zhware 1.43 <author title="Editor">
31     <mail link="zhware@gentoo.org">Stoyan Zhekov</mail>
32     </author>
33 zhen 1.16 <abstract>These instructions step you through the process of installing Gentoo
34 drobbins 1.69 Linux 1.4_rc2 and 1.4_rc3. The Gentoo Linux installation process supports various installation
35 zhen 1.6 approaches, depending upon how much of the system you want to custom-build from
36     scratch.
37     </abstract>
38 drobbins 1.70 <version>2.3.19</version>
39 drobbins 1.69 <date>26 Feb 2003</date>
40 zhen 1.16 <chapter>
41     <title>About the Install</title>
42     <section>
43     <body>
44 zhen 1.26 <p>This new boot CD will boot from nearly any modern IDE CD-ROM drive, as well
45 jhhudso 1.71 as many SCSI CD-ROM drives, assuming that your CD-ROM and BIOS both support booting.
46 drobbins 1.21 Included on the CD-ROM is Linux support for IDE (and PCI IDE) (built-in to the
47     kernel) as well as support for all SCSI devices (available as modules.) In
48     addition, we provide modules for literally every kind of network card that
49     Linux supports, as well as tools to allow you to configure your network and
50     establish outbound (as well as inbound) <c>ssh</c> connections and download
51     files. </p>
52 zhen 1.26 <p>To install from the build CD, you will need to have a 486+ processor and
53 drobbins 1.69 ideally at least 64 Megabytes of RAM. (Gentoo Linux has been successfully
54 drobbins 1.21 built with 64MB of RAM + 64MB of swap space, but the build process is awfully
55     slow under those conditions.)</p>
56 zhen 1.26 <p>Gentoo Linux can be installed using one of three &quot;stage&quot; tarball files. The
57 drobbins 1.21 one you choose depends on how much of the system you want to compile yourself.
58     The stage1 tarball is used when one wants to bootstrap and build the entire
59     system from scratch. The stage2 tarball is used for building the entire system
60     from scratch, except for the bootstrap part which is already performed for you.
61     And the stage3 tarball already contains a basic Gentoo Linux system that has
62     been optimized for your system.</p>
63 drobbins 1.70 <p><b>So, should you choose to start from a stage1, stage2, or stage3 tarball?</b>
64     Starting from a stage1 allows you to have total control over the optimization settings
65     and optional build-time functionality that is initially enabled on your system. This
66     makes stage1 installs good for power users who know what they are doing. stage2 installs
67     allow you to skip the "bootstrap" process, and doing this is fine if you are happy with
68     the optimization settings that we chose for your particular stage2 tarball. Choosing to
69     go with a stage3 allows for the fastest install of Gentoo Linux, but also means that
70     your base system will have the optimization settings that we chose for you. Which may not
71     be a bad thing, as major releases of Gentoo Linux have stage3's specifically optimized for
72     various popular processors. <b>If you're installing Gentoo Linux for the first time, consider
73     using a stage3 tarball for installation.</b></p>
74    
75    
76     <p> So, how does one begin the install process? First, you'll want to decide
77 drobbins 1.21 which one of our LiveCD ISO images to grab from
78 drobbins 1.70 <uri>http://www.ibiblio.org/gentoo/releases/1.4_rc2/x86/</uri> or <uri>http://www.ibiblio.org/gentoo/releases/1.4_rc3/x86/</uri> .
79 drobbins 1.22 In this directory, you'll see several subdirectories such as <c>athlon</c>
80 drobbins 1.24 for each of our various architecture-specific builds. Here's a low-down on
81     each arch directory and what it contains:</p>
82 zhen 1.26 <table>
83     <tr>
84     <th>Architecture</th>
85     <th>Description</th>
86     </tr>
87     <tr>
88     <ti>x86</ti>
89 drobbins 1.70 <ti>Stage 1 tarballs and &quot;gentoo-basic&quot; liveCD -- will work on anything. Some Gentoo Linux
90     "_rc" releases only have these types of stage tarballs.</ti>
91 zhen 1.26 </tr>
92     <tr>
93     <ti>i586</ti>
94     <ti>Stage 2 and 3 tarballs, GRP packages and liveCD for i586+ CPUs</ti>
95     </tr>
96     <tr>
97     <ti>i686</ti>
98     <ti>Stage 2 and 3 tarballs, GRP packages and liveCD for i686+ CPUs</ti>
99     </tr>
100     <tr>
101     <ti>athlon</ti>
102     <ti>Stage 2 and 3 tarballs, GRP packages and liveCD for AMD Athlon CPUs</ti>
103     </tr>
104     <tr>
105     <ti>athlon-xp</ti>
106     <ti>Stage 2 and 3 tarballs, GRP packages and liveCD for AMD Athlon XP CPUs</ti>
107     </tr>
108     <tr>
109     <ti>athlon-mp</ti>
110     <ti>Stage 2 and 3 tarballs, GRP packages and liveCD for AMD Athlon MP CPUs</ti>
111     </tr>
112     <tr>
113     <ti>pentium3</ti>
114     <ti>Stage 2 and 3 tarballs, GRP packages and liveCD for Intel Pentium III and Pentium 4 CPUs</ti>
115     </tr>
116     </table>
117     <p>Inside each of these directories,
118 drobbins 1.22 you'll find a <path>livecd/</path> directory that contains LiveCDs. While these LiveCDs
119     will boot on any architecture, the install-related tarballs are optimized for a particular
120 zhen 1.26 CPU type and will not work on all systems, except for the &quot;gentoo-basic&quot; LiveCD in the <path>x86</path>
121 drobbins 1.24 directory which can be used to install on anything.
122 drobbins 1.22 </p>
123 zhen 1.26 <p> The LiveCDs are full CD images that should be burned to a CDR or CD-RW
124 drobbins 1.24 using CD burning software. Currently, we have two types of LiveCDs. The first
125 zhen 1.26 carries the &quot;gentoo-basic&quot; label, and is approximately 40MB in size and lives
126 drobbins 1.24 in the <path>x86/livecd/</path> directory. This LiveCD is of minimal size to
127     allow for a initial quick download and contains a stage1 tarball that can be
128     found in <path>/mnt/cdrom/gentoo/</path> after the CD has booted.</p>
129 zhen 1.26 <p>The second flavor of LiveCD we currently offer is labelled &quot;livecd-grp.&quot;
130 drobbins 1.24 These CDs (found in their respective <path>arch/livecd</path> directories)
131     contain stage1, 2 and 3 tarballs, and also contain a set of GRP packages
132 zhen 1.50 optimized for a specific architecture. GRP is simply precompiled packages for
133     very large applications, such as XFree86. KDE, GNOME, OpenOffice, etc.
134     Using these LiveCDs, it will be possible
135 drobbins 1.24 for you to install a fully-functional Gentoo Linux system very quickly. The
136     downside is that these ISO images are large -- around 600MB -- so they can take
137 drobbins 1.70 a while to download. <b>Note that some "_rc" releases of Gentoo Linux may not
138     include GRP package sets or LiveCDs.</b></p>
139     <impo>If you encounter a problem with any part of the install and wish to
140 drobbins 1.21 report it as a bug, report it to <uri>http://bugs.gentoo.org</uri>. If the bug
141 drobbins 1.70 needs to be sent upstream to the original software developers (ie the KDE team) the
142     <e>Gentoo Linux developers</e> will take care of that for you.
143     </impo>
144 zhen 1.26 <p>Now, let's quickly review the install process. First, we'll download, burn
145 drobbins 1.21 and boot a LiveCD. After getting a root prompt, we'll create partitions, create
146     our filesystems, and extract either a stage1, stage2 or stage3 tarball. If we
147     are using a stage1 or stage2 tarball, we will take the appropriate steps to get
148     our systems to stage3. Once our systems are at stage3, we can configure them
149     (tweaking config files, installing a bootloader, etc) and boot them and have a
150     fully-functional Gentoo Linux system. Depending on what stage of the build
151     process you're starting from, here's what's required for installation: </p>
152 zhen 1.26 <table>
153 zhen 1.16 <tr>
154     <th>stage tarball</th>
155     <th>requirements for installation</th>
156     </tr>
157     <tr>
158     <ti>1</ti>
159     <ti>partition/filesystem setup, emerge sync, bootstrap, emerge system, emerge linux sources, final configuration</ti>
160     </tr>
161     <tr>
162     <ti>2</ti>
163     <ti>partition/filesystem setup, emerge sync, emerge system, emerge linux sources, final configuration</ti>
164     </tr>
165     <tr>
166     <ti>3</ti>
167     <ti>partition/filesystem setup, emerge sync, final configuration</ti>
168     </tr>
169     </table>
170     </body>
171     </section>
172     </chapter>
173     <chapter>
174     <title>Booting</title>
175     <section>
176     <body>
177 drobbins 1.21 <p>Start by booting the LiveCD. If detected properly, you should see a fancy boot screen
178     with the Gentoo Linux logo on it. At this screen, you can hit Enter to begin the boot process,
179 drobbins 1.70 or boot the LiveCD with custom boot options by typing <c>gentoo opt1 opt2</c> and then hitting Enter. To see
180     a detailed description of available boot options, press F2 to view the help screen.</p>
181    
182     <p>
183 drobbins 1.21 Once you hit Enter, you'll be
184 drobbins 1.70 greeted with a lot of text output (kernel and initrd messages)
185 zhen 1.6 followed by the normal Gentoo Linux boot sequence.
186 drobbins 1.21 You will be automatically logged in as &quot;root&quot; and the root password will be
187 jhhudso 1.72 set to a random string for security purposes. You should change your LiveCD's root password
188     if you think you're going to login again on another virtual console.
189 zhen 1.16 You should have a root (&quot;<c>#</c>&quot;) prompt on the current
190 drobbins 1.21 console, and can also open new root consoles by pressing Alt-F2, Alt-F3 and Alt-F4.
191     Get back to the one you started on by pressing (you guessed it) Alt-F1.
192 drobbins 1.70
193 zhen 1.6 </p>
194 zhen 1.26 <p>You've probably also noticed that above your <c>#</c> prompt is a bunch of help text
195 drobbins 1.70 that explains how to do things like configure your Linux networking and telling you where you can find
196 drobbins 1.21 the Gentoo Linux stage tarballs and packages on your CD.
197 zhen 1.6 </p>
198 zhen 1.16 </body>
199     </section>
200     </chapter>
201     <chapter>
202     <title>Load Kernel Modules</title>
203     <section>
204     <body>
205     <p>If the PCI autodetection missed some of your hardware, you
206 zhen 1.6 will have to load the appropriate modules manually.
207     To view a list of all available network card modules, type <c>ls
208     /lib/modules/*/kernel/drivers/net/*</c>. To load a particular module,
209     type:
210     </p>
211 zhen 1.16 <pre caption="PCI Modules Configuration">
212 drobbins 1.1 # <c>modprobe pcnet32</c>
213 zhen 1.6 <comment>(replace pcnet32 with your NIC module)</comment>
214     </pre>
215 drobbins 1.70 <p>Likewise, if you want to be able to access any SCSI hardware that wasn't detected
216 drobbins 1.21 during the initial boot autodetection process, you'll need to load the appropriate
217 zhen 1.6 modules from /lib/modules, again using <c>modprobe</c>:
218     </p>
219 zhen 1.16 <pre caption="Loading SCSI Modules">
220 drobbins 1.1 # <c>modprobe aic7xxx</c>
221     # <c>modprobe sd_mod</c>
222 zhen 1.6 </pre>
223 zhen 1.52 <p><c>aic7xxx</c> supports your SCSI controller and <c>sd_mod</c> supports SCSI hard disks. </p>
224 zhen 1.6 <note>
225 drobbins 1.21 Support for a SCSI CD-ROMs and disks are built-in in the kernel.
226 zhen 1.52 </note>
227 drobbins 1.21 <p>If you are using hardware RAID, you'll need to load the
228 zhen 1.6 ATA-RAID modules for your RAID controller.
229     </p>
230 zhen 1.16 <pre caption="Loading RAID Modules">
231 zhen 1.33 # <c>modprobe ataraid</c>
232     # <c>modprobe pdcraid</c>
233 drobbins 1.1 <comment>(Promise Raid Controller)</comment>
234 zhen 1.33 # <c>modprobe hptraid</c>
235 drobbins 1.1 <comment>(Highpoint Raid Controller)</comment>
236 zhen 1.6 </pre>
237 zhen 1.16 <p>The Gentoo LiveCD should have enabled DMA on your disks, but if it did not,
238 zhen 1.6 <c>hdparm</c> can be used to set DMA on your drives. </p>
239 zhen 1.26 <pre caption="Setting DMA"><comment>Replace hdX with your disk device.</comment>
240 drobbins 1.21 # hdparm -d 1 /dev/hdX <comment>Enables DMA </comment>
241 zhware 1.48 # hdparm -d1 -A1 -m16 -u1 -a64 /dev/hdX <comment>Enables DMA and other safe performance-enhancing options</comment>
242 zhen 1.26 # hdparm -X66 /dev/hdX <comment>Force-enables Ultra-DMA -- dangerous -- may cause some drives to mess up</comment></pre>
243 zhen 1.16 </body>
244     </section>
245     </chapter>
246 drobbins 1.70 <!-- THIS SECTION SHOULD BE DEPRECATED WITH HOTPLUG ENABLED IN 1.4_rc3 (drobbins)
247 zhen 1.16 <chapter>
248     <title>Loading PCMCIA Kernel Modules</title>
249     <section>
250     <body>
251 drobbins 1.70 <p>If you have a PCMCIA network card, you will need to perform a few extra steps.
252 zhen 1.6 </p>
253 zhen 1.16 <warn>To avoid problems with <c>cardmgr</c>, you <e>must</e> run it <e>before</e> you enter the chroot
254 zhen 1.6 portion of the install. </warn>
255 zhen 1.16 <pre caption="Loading PCMCIA Modules">
256 zhen 1.33 # <i>modprobe pcmcia_core</i>
257     # <i>modprobe i82365</i>
258     # <i>modprobe ds</i>
259 drobbins 1.1 # <i>cardmgr -f</i>
260 zhen 1.6 </pre>
261 drobbins 1.21 <p>As <c>cardmgr</c> detects which hardware is present, your speaker should emit a
262 zhen 1.6 few reassuring beeps, and your PCMCIA network card should hum to life. You can
263 drobbins 1.21 of course insert the PCMCIA card after loading <c>cardmgr</c> too, if that's
264 zhen 1.6 preferable. (Technically, you need not run
265 drobbins 1.21 <c>cardmgr</c> if you know exactly which module your PCMCIA card requires.
266 zhen 1.6 But if you don't, loading all PCMCIA modules and see which sticks won't work,
267     as all PCMCIA modules load obligingly and hang around for a PCMCIA card to
268 drobbins 1.21 drop by. <c>cardmgr</c> will also unload the module(s) for any card when you
269 zhen 1.6 remove it). </p>
270 zhen 1.16 </body>
271     </section>
272     </chapter>
273 drobbins 1.70 -->
274 zhen 1.16 <chapter>
275     <title>Configuring Networking</title>
276 drobbins 1.70 <section>
277     <title>Maybe it just works?</title>
278     <body>
279     <p>If you're using a 1.4_rc3 or later LiveCD, it's possible that your networking has already been
280     configured automatically for you. If so, you should be able to take advantage of the many included
281     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>,
282     among others.</p>
283    
284     <p>If networking has been configured for you, the <c>/sbin/ifconfig</c> command should
285     list some internet interfaces besides <c>lo</c>, such as <c>eth0</c>:
286     </p>
287     <pre caption="/sbin/ifconfig for a working network card">
288     eth0 Link encap:Ethernet HWaddr 00:50:BA:8F:61:7A
289     inet addr:192.168.0.2 Bcast:192.168.0.255 Mask:255.255.255.0
290     inet6 addr: fe80::50:ba8f:617a/10 Scope:Link
291     UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
292     RX packets:1498792 errors:0 dropped:0 overruns:0 frame:0
293     TX packets:1284980 errors:0 dropped:0 overruns:0 carrier:0
294     collisions:1984 txqueuelen:100
295     RX bytes:485691215 (463.1 Mb) TX bytes:123951388 (118.2 Mb)
296     Interrupt:11
297     </pre>
298     <p>You may want to also try pinging your ISP's DNS server (found in <path>/etc/resolv.conf</path>),
299     and a Web site of choice, just to make sure that your packets are reaching the net, DNS name
300     resolution is working correctly, etc.
301     </p>
302     <pre caption="Further Network Testing">
303     # <c>ping www.some_website.com </c>
304     </pre>
305     <p>Are you able to use your network? If so, you can skip the rest of this section.</p>
306     </body>
307     </section>
308 zhen 1.16 <section>
309     <title> PPPoE configuration</title>
310     <body>
311 drobbins 1.70 <p>Assuming you need PPPoE to connect to the internet, the LiveCD (any version) has
312 drobbins 1.21 made things easy for you by including <c>rp-pppoe</c>. Use the provided <c>adsl-setup</c>
313 zhen 1.6 script to configure your connection. You will be prompted for the ethernet
314     device that is connected to your adsl modem, your username and password,
315     the IPs of your DNS servers, and if you need a basic firewall or not. </p>
316 zhen 1.16 <pre caption="Configuring PPPoE">
317 zhen 1.6 # <c> adsl-setup </c>
318     # <c> adsl-start </c>
319     </pre>
320 drobbins 1.70 <p>If something goes wrong, double-check that you correctly typed
321 zhen 1.6 your username and password by looking at <path>/etc/ppp/pap-secrets</path> or
322     <path>/etc/ppp/chap-secrets</path>, and make sure you are using the right ethernet device. </p>
323 zhen 1.16 </body>
324     </section>
325     <section>
326     <title> Automatic Network Configuration </title>
327     <body>
328 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>
329 zhen 1.16 <pre caption="Net-Setup Script">
330 drobbins 1.1 # <c>net-setup eth0</c>
331 zhen 1.6 </pre>
332 drobbins 1.70 <p>Of course, if you prefer, you may still set up networking manually. This is covered next.</p>
333 zhen 1.16 </body>
334     </section>
335     <section>
336     <title>Manual DHCP Configuration</title>
337     <body>
338     <p>Network configuration is simple with DHCP; If your ISP is not using
339     DHCP, skip down to the static configuration section below. </p>
340     <pre caption="Network configuration with DHCP">
341 drobbins 1.1 # <c>dhcpcd eth0</c>
342 zhen 1.6 </pre>
343 zhen 1.16 <note>Some ISPs require you to provide a hostname. To do that,
344 zhen 1.6 add a <c>-h myhostname</c> flag to the dhcpcd command line above.
345     </note>
346 zhen 1.16 <p>If you receive <i>dhcpConfig</i> warnings, don't panic; the errors
347 zhen 1.6 are most likely cosmetic. Skip down to Network testing below.</p>
348 zhen 1.16 </body>
349     </section>
350     <section>
351     <title>Manual Static Configuration</title>
352     <body>
353     <p>We need to setup just enough networking so that we can download
354 zhen 1.6 sources for the system build, as well as the required localhost interface.
355     Type in the following commands, replacing
356     $IFACE with your network interface (typically <c>eth0</c>), $IPNUM
357     with your IP address, $BCAST with your broadcast address, and $NMASK
358     with your network mask. For the <c>route</c> command, replace
359     $GTWAY with your default gateway.
360     </p>
361 zhen 1.16 <pre caption="Static IP Network Configuration">
362 drobbins 1.1 # <c>ifconfig $IFACE $IPNUM broadcast $BCAST netmask $NMASK</c>
363     # <c>/sbin/route add -net default gw $GTWAY netmask 0.0.0.0 metric 1</c>
364 zhen 1.6 </pre>
365 zhen 1.16 <p>Now it's time to create the <path>/etc/resolv.conf</path>
366 zhen 1.6 file so that name resolution (finding Web/FTP sites by name, rather than just by IP address) will work.</p>
367 zhen 1.16 <p>Here's a template to follow for creating your /etc/resolv.conf file: </p>
368     <pre caption="/etc/resolv.conf template">
369 drobbins 1.1 domain mydomain.com
370     nameserver 10.0.0.1
371     nameserver 10.0.0.2
372 zhen 1.6 </pre>
373 zhen 1.16 <p>Replace <c>10.0.0.1</c> and <c>10.0.0.2</c> with the IP addresses of your
374 zhen 1.6 primary and secondary DNS servers respectively.</p>
375 zhen 1.16 </body>
376     </section>
377     <section>
378     <title>Proxy Configuration</title>
379     <body>
380     <p>If you are behind a proxy, it is necessary to configure your proxy before
381 zhen 1.6 you continue. We will export some variables to set up the proxy accordingly.
382     </p>
383 zhen 1.16 <pre caption="Setting a Proxy">
384     # <c>export http_proxy=&quot;machine.company.com:1234&quot; </c>
385 seo 1.42 # <c>export ftp_proxy=&quot;$http_proxy&quot; </c>
386     # <c>export RSYNC_PROXY=&quot;$http_proxy&quot; </c>
387 zhen 1.6 </pre>
388 zhen 1.16 </body>
389     </section>
390 drobbins 1.70 <section>
391 zhen 1.16 <title>Networking is go!</title>
392     <body>
393     <p>Networking should now be configured and useable. You should be able to use the included
394 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>
395 zhen 1.16 </body>
396     </section>
397     </chapter>
398     <chapter>
399     <title>Partition Configuration</title>
400     <section>
401     <body>
402     <p>Now that the kernel can see the network card and disk controllers, it's time
403 zhen 1.6 to set up disk partitions for Gentoo Linux.
404     </p>
405 drobbins 1.70
406     <p>Here's a quick overview of the standard Gentoo Linux partition layout.
407 zhen 1.6 We're going to create at least three partitions: a swap partition, a root
408     partition (to hold the bulk of Gentoo Linux), and a special boot partition.
409     The boot partition is designed to hold the GRUB or LILO boot loader information as well as
410     your Linux kernel(s). The boot partition gives us a safe place to store
411     everything related to booting Linux. During normal day-to-day Gentoo Linux use,
412     your boot partition should remain <e>unmounted</e>. This prevents your kernel
413     from being made unavailable to GRUB (due to filesystem corruption) in the event
414     of a system crash, preventing the chicken-and-egg problem where GRUB can't read
415     your kernel (since your filesystem isn't consistent) but you can't bring your
416     filesystem back to a consistent state (since you can't boot!)
417     </p>
418 zhen 1.50 <p>Now, on to filesystem types. Right now, you have five filesystem options:
419     XFS, ext2, ext3 (journaling), jfs, and ReiserFS. ext2 is the tried and true Linux
420 zhen 1.6 filesystem but doesn't have metadata journaling. ext3 is the new version of
421     ext2 with both metadata journaling and ordered data writes, effectively
422     providing data journaling as well. ReiserFS is a B*-tree based filesystem
423     that has very good small file performance, and greatly outperforms both ext2 and
424     ext3 when dealing with small files (files less than 4k), often by a factor of
425     10x-15x. ReiserFS also scales extremely well and has metadata journaling.
426     As of kernel 2.4.18+, ReiserFS is finally rock-solid and highly recommended.
427     XFS is a filesystem with metadata journaling that
428 drobbins 1.21 is fully supported under Gentoo Linux's <path>xfs-sources</path> kernel, but
429     is generally not recommended due to its tendency to lose recently-modified
430     data if your system locks up or unexpectedly reboots (due to a power failure, for instance.)
431 zhen 1.50 Finially, jfs is IBM's own high performance journaling filesystem. Since it is obscure, we cannot comment either positvely nor negatively on its stability.</p>
432 zhen 1.16 <p>If you're looking for the most standard filesystem, use ext2. If you're looking
433 zhen 1.6 for the most rugged journalled filesystem, use ext3. If you're looking for a
434     high-performance filesystem with journaling support, use ReiserFS; both ext3 and ReiserFS are
435 drobbins 1.21 mature and refined.
436 zhen 1.6 Here are our basic recommended filesystem
437     sizes and types:
438     </p>
439 zhen 1.16 <table>
440     <tr>
441     <th>Partition</th>
442     <th>Size</th>
443     <th>Type</th>
444     <th>example device</th>
445     </tr>
446     <tr>
447     <ti>boot partition, containing kernel(s) and boot information</ti>
448     <ti>100 Megabytes</ti>
449     <ti>ext2/3 highly recommended (easiest); if ReiserFS then mount with <c>-o notail</c></ti>
450     <ti>/dev/hda1</ti>
451     </tr>
452     <tr>
453 drobbins 1.70 <ti>swap partition (no longer a 128 Megabyte limit, now 2GB)</ti>
454     <ti>Generally, configure a swap area that's between one to two times the size of the physical RAM
455     in your system.</ti>
456 zhen 1.16 <ti>Linux swap</ti>
457     <ti>/dev/hda2</ti>
458     </tr>
459     <tr>
460     <ti>root partition, containing main filesystem (/usr, /home, etc)</ti>
461     <ti>&gt;=1.5 Gigabytes</ti>
462     <ti>ReiserFS, ext3 recommended; ext2 ok</ti>
463     <ti>/dev/hda3</ti>
464     </tr>
465     </table>
466 zhen 1.54
467 drobbins 1.70
468     <p>At this point, create your partitions using <c>fdisk</c>. Note that your partitions
469     should be of type 82 if swap and 83 for regular filesystems (whether ReiserFS, ext2/3 or other). </p>
470     <note><c>cfdisk</c> is included on the install CD, and it is <i>considerably</i> easier to use than
471     <c>fdisk</c>. Just type <c>cfdisk</c> to run it; by default, cfdisk will work with <b>/dev/hda</b>. If /dev/hda is not the hard disk you want to partition, give the right value to cfdisk as a parameter. For example: <c>cfdisk /dev/hde</c></note>
472     <note>If <c>fdisk</c> or <c>cfdisk</c> instruct you to do so, please reboot to allow your system to detect the
473     new partition configuration.</note>
474     <note>If you are using RAID your partitions will be a little different. You
475     will have the partitions like this: <path>/dev/ataraid/discX/partY</path> X is
476     the arrays you have made, so if you only have made 1 array, then it will be
477     disc0.Y is the partition number as in <path>/dev/hdaY</path> </note>
478     <p>Once you've created your partitions, it's time to initialize
479     the filesystems that will be used to house our data.</p>
480    
481     <p>But before creating filesystems, you may want to initialize the
482     beginning of your HD using <c>dd</c> if you are using a pre-existing partition that has been used before.
483     This is particularly helpful when you're going to create a new XFS filesystem on a partition that previously contained
484     a ReiserFS filesystem. Doing this will ensure that your new filesystem
485     will not be mis-indentified by Linux's filesystem auto-detection code.
486 drobbins 1.21 This can be done as follows:
487 zhen 1.6 </p>
488 zhen 1.16 <pre caption="Initializing first 1024 Sectors of HD">
489 zhen 1.34 # <c>dd if=/dev/zero of=/dev/hdxy bs=1K count=1</c>
490 zhen 1.26 <comment>Replace /dev/hdxy with the device you wish to &quot;clean.&quot;</comment>
491 zhen 1.6 </pre>
492 zhware 1.43 <warn>The command above will destroy all data from <path>/dev/hdxy</path>.
493     Be careful and check twice which partition you specify for zeroing.
494     If you make a mistake it might result in a loss of data.
495     </warn>
496 drobbins 1.70 <p>Now, initialize your swap partition as follows:</p>
497     <pre caption="Initializing Swap">
498 drobbins 1.1 # <c>mkswap /dev/hda2</c>
499 zhen 1.6 </pre>
500 zhen 1.16 <p>You can use the <c>mke2fs</c> command to create ext2 filesystems.</p>
501     <pre caption="Creating an ext2 Filesystem">
502 drobbins 1.1 # <i>mke2fs /dev/hda1</i>
503 zhen 1.6 </pre>
504 zhen 1.16 <p>To create an XFS filesystem, use the <c>mkfs.xfs</c> command.</p>
505     <pre caption="Creating a XFS Filesystem">
506 drobbins 1.1 # <c>mkfs.xfs /dev/hda3</c>
507 zhen 1.6 </pre>
508 zhen 1.16 <note>
509 zhen 1.6 You may want to add a couple of additional flags to the <c>mkfs.xfs</c> command: <c>-d agcount=3 -l size=32m</c>.
510     The <c>-d agcount=3</c> command will lower
511     the number of allocation groups. XFS will insist on using at least 1 allocation group per 4 GB of your partition,
512     so, for example, if you hava a 20 GB partition you will need a minimum agcount of 5.
513     The <c>-l size=32m</c> command increases the journal size to 32 Mb, increasing performance.
514     </note>
515 zhen 1.16 <p>If you'd like to use ext3, you can create ext3 filesystems using <c>mke2fs -j</c>.</p>
516     <pre caption="Creating an ext3 Filesystem">
517 drobbins 1.1 # <c>mke2fs -j /dev/hda3</c>
518 zhen 1.6 </pre>
519 seo 1.32 <note>You can find out more about using ext3 under Linux 2.4 at
520     <uri>http://www.zip.com.au/~akpm/linux/ext3/ext3-usage.html</uri>.
521     </note>
522 zhen 1.16 <p>To create ReiserFS filesystems, use the <c>mkreiserfs</c> command.</p>
523     <pre caption="Creating a ReiserFS Filesystem">
524 drobbins 1.1 # <c>mkreiserfs /dev/hda3</c>
525 zhen 1.6 </pre>
526 zhen 1.50
527     <p>To create JFS filesystems, use the <c>mkfs.jfs</c> comamnd.</p>
528     <pre caption="Creating a JFS Filesystem">
529     # <c>mkfs.jfs /dev/hda3</c>
530     </pre>
531    
532 zhen 1.16 </body>
533     </section>
534     </chapter>
535     <chapter>
536     <title>Mount Partitions</title>
537     <section>
538     <body>
539 drobbins 1.70 <p>Now, we'll activate our new swap, since we may need the additional virtual memory that it
540 zhen 1.6 provides later:
541     </p>
542 zhen 1.16 <pre caption="Activating Swap">
543 drobbins 1.1 # <c>swapon /dev/hda2</c>
544 zhen 1.6 </pre>
545 zhen 1.16 <p>Next, we'll create the <path>/mnt/gentoo</path> and <path>/mnt/gentoo/boot</path> mountpoints,
546 zhen 1.6 and we'll mount our filesystems to these mountpoints. </p>
547 zhen 1.16 <pre caption="Creating Mount Points">
548 drobbins 1.1 # <c>mkdir /mnt/gentoo</c>
549     # <c>mount /dev/hda3 /mnt/gentoo</c>
550     # <c>mkdir /mnt/gentoo/boot</c>
551     # <c>mount /dev/hda1 /mnt/gentoo/boot</c>
552 zhen 1.6 </pre>
553 zhen 1.26 <p>
554 zhen 1.6 If you are setting up Gentoo
555     Linux with a separate <path>/usr</path> or <path>/var</path>, these would get mounted to
556     <path>/mnt/gentoo/usr</path> and <path>/mnt/gentoo/var</path>, respectively.
557     </p>
558 zhen 1.27 <impo>If your <e>boot</e> partition (the one holding the kernel) is ReiserFS, be sure to mount it
559 zhen 1.6 with the <c>-o notail</c> option so GRUB gets properly installed. Make sure
560     that <c>notail</c> ends up in your new <path>/etc/fstab</path> boot partition entry, too.
561     We'll get to that in a bit.
562     </impo>
563 zhen 1.16 <impo>If you are having problems mounting your boot partition with ext2, try using
564 zhen 1.6 <c>mount /dev/hXX /mnt/gentoo/boot -t ext2 </c> </impo>
565 zhen 1.16 </body>
566     </section>
567     </chapter>
568     <chapter>
569     <title>Obtaining the Desired 'stage-x' Tarball</title>
570     <section>
571     <body>
572 zhen 1.59 <p>If you are using a GRP CD to install, you already have all of the stage
573     tarballs available on the CD.
574     If this is the case, copy the tarball of your choice to <mnt>/mnt/gentoo</mnt>
575     </p>
576 zhen 1.55
577 zhen 1.59 <p>Alternatively, if you do not have a GRP CD, the stage1 tarball is still available on
578     the CD in <path>/mnt/cdrom/gentoo</path>. You will have to download the other stages though,
579     and the best place to download those to is <path>/mnt/gentoo</path>.
580     </p>
581    
582 zhen 1.16 <pre caption="Downloading Required Stages">
583 drobbins 1.1 # <c>cd /mnt/gentoo</c>
584 zhware 1.47 <comment>Use lynx to get the URL for your tarball:</comment>
585 drobbins 1.21 # <c>lynx http://www.ibiblio.org/pub/Linux/distributions/gentoo/releases/1.4_rc2/x86/</c>
586 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
587     Highlight the appropriate stage you want to download
588     Press <c>d</c> which will initiate the download
589     Save the file and quit the browser
590    
591     <b>OR</b> use wget from the command line:</comment>
592     # <c>wget <comment>insert URL to the required stage tarball here.</comment></c>
593 zhen 1.6 </pre>
594 zhen 1.16 </body>
595     </section>
596     </chapter>
597     <chapter>
598     <title>Unpacking the Stage Tarballs</title>
599     <section>
600     <body>
601     <p>Now it's time to extract the compressed stage tarball of your choice to <path>/mnt/gentoo</path>.
602 zhen 1.26 Then, we'll <c>chroot</c> over to the new Gentoo Linux build installation to &quot;enter&quot; the new
603 drobbins 1.21 Gentoo Linux system.
604 zhen 1.6 </p>
605 zhen 1.16 <impo>Be sure to use the <c>p</c> option with <c>tar</c>. Forgetting to do this will
606 drobbins 1.21 cause certain files to have incorrect permissions.</impo>
607 zhen 1.16 <p>If you are using the &quot;from scratch, build everything&quot; install method,
608 zhen 1.6 you will want to use the <path>stage1-ix86-1.4_beta.tbz2</path> image.
609     If you're using one of our bigger CDs, you'll also have a choice of a stage2 and stage3 image.
610     These images allow you to save time at the expense of configurability (we've already chosen
611 zhen 1.12 compiler optimizations and default USE variables for you.)
612 zhen 1.6 </p>
613 zhen 1.16 <pre caption="Unpacking the Stages">
614 drobbins 1.1 # <c>cd /mnt/gentoo</c>
615 drobbins 1.21 # <c>tar -xvjpf /mnt/cdrom/gentoo/stage?-*.tbz2</c>
616 drobbins 1.1 # <c>mount -o bind /proc /mnt/gentoo/proc</c>
617 zhen 1.44
618     <!--# <c>mount -o bind /dev /mnt/gentoo/dev</c>
619 drobbins 1.35 <comment>The /dev bind-mount is required for perl to build properly for some people.</comment>
620 zhen 1.44 -->
621 drobbins 1.1 # <c>cp /etc/resolv.conf /mnt/gentoo/etc/resolv.conf</c>
622 zhen 1.6 </pre>
623 zhen 1.30 <p>If you are going to use GRP, now would be a good time to execute the following commands:
624     </p>
625    
626     <pre caption="Getting ready for GRP">
627     # <c>mkdir /mnt/gentoo/GRP</c>
628     # <c>mount -o bind /mnt/cdrom/gentoo/packages /mnt/gentoo/GRP</c>
629     </pre>
630    
631 zhen 1.16 <pre caption="Entering the chroot Environment">
632 drobbins 1.1 # <c>chroot /mnt/gentoo /bin/bash</c>
633     # <c>env-update</c>
634     Regenerating /etc/ld.so.cache...
635     # <c>source /etc/profile</c>
636 zhen 1.49 <comment>The above points your shell to the new paths and updated binaries. </comment>
637 zhen 1.6 </pre>
638 zhen 1.16 <p>After you execute these commands, you'll be &quot;inside&quot; your new Gentoo Linux environment.
639 zhen 1.6 </p>
640 zhen 1.16 </body>
641     </section>
642     </chapter>
643     <chapter>
644     <title>Getting the Current Portage Tree using Rsync</title>
645     <section>
646     <body>
647     <p>Now, you'll need to run <c>emerge sync</c>. This will make sure that
648 zhen 1.6 you have the most current copy of the Portage tree. </p>
649 zhen 1.16 <pre caption="Updating Using Rsync">
650 zhen 1.60
651 zhen 1.6 # <c>emerge sync</c>
652 carpaski 1.64 # <c>export CONFIG_PROTECT="-*"</c>
653     # <c>export USE="-* bootstrap build"</c>
654     # <c>emerge portage</c>
655     # <c>unset USE</c>
656 zhen 1.60 </pre>
657 zhen 1.16 <p>The Portage tree will be downloaded and stored in <path>/usr/portage</path>;
658 zhen 1.6 it's about 90Mb in size without tarballs.
659     </p>
660 zhen 1.60 <note>The <c>export CONFIG_PROTECT=&quot;-*&quot;</c> line ensures that any new scripts
661     installed to <path>/etc</path> will overwrite the old scripts (stored in
662     <path>sys-apps/baselayout</path>), bypassing Portage's new config file
663     management support. Type <c>emerge --help config</c> for more details.</note>
664    
665 zhen 1.16 </body>
666     </section>
667     </chapter>
668     <chapter>
669     <title>Setting Gentoo optimizations (make.conf)</title>
670     <section>
671     <body>
672 drobbins 1.70 <p>Now that you have a working copy of the Portage tree,
673     it's time to customize the optimization and optional build-time settings to use
674     on your Gentoo Linux system. First
675 zhen 1.6 edit the file <path>/etc/make.conf</path>. In this file, you should set your
676     <c>USE</c> flags, which specify optional functionality that you would
677 drobbins 1.70 like to be built into packages if available; generally, the defaults (an <e>empty</e>
678 zhen 1.6 or unset <c>USE</c> variable) are fine.
679     More information on <c>USE</c> flags can be found
680     <uri link="http://www.gentoo.org/doc/en/use-howto.xml">here</uri>.
681 zhen 1.38 A complete list of current USE flags can be found
682     <uri link="http://www.gentoo.org/dyn/use-index.xml">here</uri>.
683 zhen 1.6 </p>
684 zhen 1.16 <p>You also should set appropriate <c>CHOST</c>, <c>CFLAGS</c> and
685 zhen 1.6 <c>CXXFLAGS</c> settings for the kind of system that you are creating
686 drobbins 1.70 (commented examples can be found further down in the file.) These settings
687     will be used to tell the C and C++ compiler how to optimize the code that
688     is generated on your system. It is common for users with Athlon XP processors
689     to specify a "-march=athlon-xp" setting in their CFLAGS and CXXFLAGS settings
690     so that all packages built will be optimized for the instruction set and
691     performance characteristics of their CPU, for example. The <path>/etc/make.conf</path>
692     file contains a general guide for the proper settings of CFLAGS and CXXFLAGS.</p>
693    
694 zhen 1.16 <p>If necessary, you can also set proxy information here if you are behind a
695 zhen 1.6 firewall.
696     </p>
697 zhen 1.16 <pre caption="Setting make.conf Options">
698 drobbins 1.1 # <c>nano -w /etc/make.conf</c> <comment>(Adjust these settings)</comment>
699 zhen 1.6 </pre>
700 zhen 1.16 <note>
701 zhen 1.6 People who need to substantially tweak the build process should take a look at
702     the <path>/etc/make.globals</path> file. This file comprises gentoo defaults and
703 drobbins 1.70 should never be touched. If the defaults do not suffice, then new values should
704 zhen 1.6 be put in <path>/etc/make.conf</path>, as entries in <path>make.conf</path>
705     <comment>override</comment> the entries in <path>make.globals</path>. If you're
706     interested in tweaking USE settings, look in <path>/etc/make.profile/make.defaults</path>.
707 zhen 1.16 If you want to turn off any USE settings found here, add an appropriate <c>USE=&quot;-foo&quot;</c>
708 zhen 1.6 in /etc/make.conf (to turn off the <c>foo</c> USE setting.)
709     </note>
710 zhen 1.16 </body>
711     </section>
712     </chapter>
713     <chapter>
714 zhen 1.18 <title>Starting from Stage1</title>
715 zhen 1.16 <section>
716     <body>
717 zhen 1.18 <p>The stage1 tarball is for ultimate tweakage. If you have picked this tarball,
718     you are most likely looking to have an uber-optimized system. Have fun, because optimization
719 drobbins 1.70 is what Gentoo Linux is all about! Installing from a stage1 takes a lot of time, but the result
720     is a system that has been optimized from the ground up for your specific machine and needs.
721 zhen 1.18 </p>
722 zhen 1.16 <p>Now, it's time to start the &quot;bootstrap&quot; process. This process takes about two hours on
723 zhen 1.6 my 1200Mhz AMD Athlon system. During this time, the extracted build image will be prepped
724 zhen 1.18 for compiling the rest of the system. The GNU compiler suite will be built, as well as the GNU C library.
725 zhen 1.6 These are time consuming builds and make up the bulk of the bootstrap process.
726     </p>
727 zhen 1.16 <pre caption="Bootstrapping">
728 drobbins 1.1 # <c>cd /usr/portage</c>
729     # <c>scripts/bootstrap.sh</c>
730 zhen 1.6 </pre>
731 zhen 1.16 <p>The &quot;bootstrap&quot; process will now begin.
732 zhen 1.6 </p>
733 zhen 1.16 <note>
734 zhen 1.6 Portage by default uses <c>/var/tmp</c> during package building, often
735     using several hundred megabytes of temporary storage. If you would like to
736     change where Portage stores these temporary files, set a new PORTAGE_TMPDIR <e>before</e>
737     starting the bootstrap process, as follows:
738     </note>
739 zhen 1.16 <pre caption="Changing Portage's Storage Path">
740     # <c>export PORTAGE_TMPDIR=&quot;/otherdir/tmp&quot;</c>
741 zhen 1.6 </pre>
742 zhen 1.16 <p><c>bootstrap.sh</c> will build <c>binutils</c>, <c>gcc</c>, <c>gettext</c>,
743 zhen 1.6 and <c>glibc</c>, rebuilding <c>binutils</c>, <c>gcc</c>, and <c>gettext</c>
744     after <c>glibc</c>. Needless to say, this process takes a while.
745 zhen 1.27 Have a nice nap. Once this process completes, your system will be equivalent to a &quot;stage2&quot; system,
746 zhen 1.33 which means you can now move on to the stage2 instructions.
747 zhen 1.6 </p>
748 zhen 1.16 </body>
749     </section>
750     </chapter>
751     <chapter>
752 zhen 1.18 <title>Starting from Stage2</title>
753 zhen 1.16 <section>
754     <body>
755 zhen 1.18 <p>The stage2 tarball already has the bootstrapping done for you. All that you have
756     to do is install the rest of the system.
757 zhen 1.6 </p>
758 zhen 1.16 <note>
759 zhen 1.6 If you haven't done so, please edit <path>/etc/make.conf</path> to your flavor.
760     </note>
761 zhen 1.16 <pre caption="Installing the Rest of the System">
762 drobbins 1.1 # <c>emerge -p system</c>
763     <comment>[lists the packages to be installed]</comment>
764     # <c>emerge system</c>
765 zhen 1.6 </pre>
766 zhen 1.60 <p>It's going to take a while
767 zhen 1.6 to finish building the entire base system. Your reward is that it will be
768     thoroughly optimized for your system. The drawback is that you have to find a
769 zhen 1.16 way to keep yourself occupied for some time to come. The author suggests &quot;Star
770 zhen 1.37 Wars - Super Bombad Racing&quot; for the PS2.
771     </p>
772     <p>When this process completes, your system will be the equivalent of a stage3 system. You have
773     a couple of choices on how to continue
774     at this point. You can move onto the stage3 instructions and complete those. Doing that will
775     get your system right up to date with what is in the current Portage tree. This is not necessary,
776     but it is highly recommended. If you do not choose to get up to date with the stage3 instructions,
777     you can move onto the GRP install section. If you do not wish to use GRP, you can move
778     onto <uri link="http://www.gentoo.org/doc/en/gentoo-x86-install.xml#doc_chp16">Chapter 16: Final Steps</uri>.
779 zhen 1.18 </p>
780     </body>
781     </section>
782     </chapter>
783     <chapter>
784     <title>Starting from Stage3</title>
785     <section>
786     <body>
787     <p>The stage3 tarball is already configured for your system. There is not much to do for this stage,
788     but it is a very good idea to update your system to the newest available packages. </p>
789 zhen 1.57
790 zhen 1.18 <note>If you have not already edited <path>/etc/make.conf</path> to fit your specifications,
791     now would be a good time to do so. </note>
792     <pre caption="Getting up-to-date">
793     # <c>emerge sync</c>
794     # <c>emerge -up world</c>
795     <comment>lists [<i>packages</i>] to be installed</comment>
796     # <c>emerge -u world</c>
797     </pre>
798 zhen 1.37 <p>Once you complete this step, you have some options on how to continue. If you are going to be using GRP,
799     please move onto the GRP section. If you are not going to use GRP, you may continue onto
800     <uri link="http://www.gentoo.org/doc/en/gentoo-x86-install.xml#doc_chp16">Chapter 16: Final Steps</uri>.
801 zhen 1.27 </p>
802 zhen 1.18 </body>
803     </section>
804     </chapter>
805     <chapter>
806 zhen 1.26 <title>Using GRP</title>
807     <section>
808     <body>
809 zhen 1.28 <p>You can take advantage of pre-built GRP package sets to avoid compiling certain popular and large packages. Currently, we provide full builds of everything you need for <c>openoffice-bin</c>,
810 zhen 1.27 <c>GNOME</c>, <c>KDE</c> and <c>xfree</c>.
811     </p>
812 seo 1.41 <p>First, you will need to <c>cd</c> to the location of the packages directory. We have already
813     mounted the directory at <path>/GRP</path>. In that directory you
814 zhen 1.27 will find the <c>grp-install.sh</c> script, an <i>All</i> directory that contains all of the binary
815     packages, and a list of available GRP packages. To install any/all of these
816     package sets you should do the following: </p>
817 zhen 1.26 <pre caption="Using GRP">
818 seo 1.41 # <c>cd /GRP</c>
819 zhen 1.27 # <c>sh grp-install.sh &lt;list of package lists&gt;</c>
820     <comment>where &lt;list of package lists&gt; may be any of the *-list.txt files found in the same directory.</comment>
821 drobbins 1.21 </pre>
822 zhen 1.27 <p><c>grp-install.sh</c> can be run multiple times without replacing existing installations. You can
823     do a <c>sh grp-install.sh</c> for a basic usage description if you are still a bit foggy.
824     </p>
825 zhen 1.26 </body>
826     </section>
827     </chapter>
828 drobbins 1.21 <chapter>
829 zhen 1.61 <title>Setting your Timezone</title>
830 zhen 1.18 <section>
831     <body>
832     <p>At this point, you should have system that's ready for final configuration.
833     We'll start the configuration process by setting the timezone. By setting the timezone before building
834     the kernel we ensure that users get reasonable <c>uname -a</c> output.
835     </p>
836     <p>Look for your timezone (or GMT if you using Greenwich Mean Time) in
837     <path>/usr/share/zoneinfo</path>. Then, make a symbolic link by typing:
838     </p>
839     <pre caption="Creating a symbolic link for timezome">
840     # <c>ln -sf /usr/share/zoneinfo/path/to/timezonefile /etc/localtime</c>
841     </pre>
842     <p>You might also want to check <path>/etc/rc.conf</path> to make sure your timezone settings
843     are correct.
844 zhen 1.6 </p>
845 zhen 1.16 </body>
846     </section>
847     </chapter>
848     <chapter>
849 zhen 1.61 <title>Installing the kernel and a System Logger</title>
850 zhen 1.16 <section>
851     <body>
852     <note>
853 zhen 1.6 If you haven't done so, please edit <path>/etc/make.conf</path> to your flavor.
854     </note>
855 zhen 1.16 <p>You now need to merge Linux source ebuilds. Here are the ones we currently
856 zhen 1.6 offer:
857     </p>
858 zhen 1.16 <table>
859     <tr>
860     <th>ebuild</th>
861     <th>description</th>
862     </tr>
863     <tr>
864     <ti>
865     <path>gentoo-sources</path>
866     </ti>
867 drobbins 1.21 <ti>Our own performance and functionality-enhanced kernel does not include XFS support.</ti>
868 zhen 1.16 </tr>
869     <tr>
870     <ti>
871     <path>xfs-sources</path>
872     </ti>
873 drobbins 1.21 <ti>Highly-compatible kernel with XFS support.</ti>
874 zhen 1.16 </tr>
875     <tr>
876     <ti>
877     <path>openmosix-sources</path>
878     </ti>
879     <ti>A stock Linux kernel source tree patched with support for the GPL <uri link="http://www.openmosix.com">openMosix</uri> load-balancing/clustering technology</ti>
880     </tr>
881     <tr>
882     <ti>
883     <path>usermode-sources</path>
884     </ti>
885     <ti>A stock Linux kernel source tree patched with support for User-Mode Linux. (&quot;Linux inside Linux&quot; technology)</ti>
886     </tr>
887     <tr>
888     <ti>
889     <path>vanilla-sources</path>
890     </ti>
891     <ti>A stock Linux kernel source tree, just like you'd get from kernel.org</ti>
892     </tr>
893     </table>
894 drobbins 1.21 <warn>
895     If you are configuring your own kernel, be careful with the <i>grsecurity</i> option. Being too aggressive with your
896     security settings can cause certain programs (such as X) to not run properly. If in doubt, leave it out.
897 zhen 1.6 </warn>
898 drobbins 1.21 <p>Choose a kernel and then merge as follows:</p>
899 zhen 1.16 <pre caption="Emerging Kernel Sources">
900 drobbins 1.1 # <c>emerge sys-kernel/gentoo-sources</c>
901 zhen 1.6 </pre>
902 zhen 1.16 <p>Once you have a Linux kernel source tree available, it's time to compile your own custom kernel.
903 zhen 1.6 </p>
904 zhen 1.38 <p>Please note that <path>/usr/src/linux</path> is a symlink to your current emerged kernel source package,
905     which is set automatically by Portage at emerge time.
906     If you have multiple kernel source packages, it is necessary to set the <path>/usr/src/linux</path> symlink
907     to the correct one before proceeding.
908     </p>
909 zhen 1.16 <pre caption="Compiling the Linux Kernel">
910 drobbins 1.1 # <c>cd /usr/src/linux</c>
911 zhen 1.46 # <c>source /etc/profile</c>
912 zhen 1.49 <comment>Again, this updates your paths. If you get an error saying gcc is not found,
913     this is what you may have to do. </comment>
914 drobbins 1.1 # <c>make menuconfig</c>
915     # <c>make dep &amp;&amp; make clean bzImage modules modules_install</c>
916     # <c>mv /boot/bzImage /boot/bzImage.orig</c>
917     <comment>[if bzImage already exists]</comment>
918     # <c>cp /usr/src/linux/arch/i386/boot/bzImage /boot</c>
919 zhen 1.6 </pre>
920 zhen 1.16 <warn>For your kernel to function properly, there are several options that you will
921 zhen 1.6 need to ensure are in the kernel proper -- that is, they should <i>be enabled and not
922 zhen 1.16 compiled as modules</i>. You will need to enable the <i>&quot;Code maturity
923     level options --&gt; Prompt for development and/or incomplete code/drivers&quot;</i>
924 zhen 1.6 option to see several of these selections.
925 zhen 1.50 Under the &quot;File systems&quot; section, be sure to enable the <i>&quot;/dev&quot; file system support</i> (note that
926 zhen 1.16 you <e>don't</e> need to enable the &quot;/dev/pts file system support&quot; option). You'll also
927     need to enable the <i>&quot;Virtual Memory Filesystem&quot;</i>. Be sure to enable &quot;ReiserFS&quot; if you have
928     any ReiserFS partitions; the same goes for &quot;Ext3&quot;. If you're using XFS, enable the
929     &quot;SGI XFS filesystem support&quot;
930 zhen 1.6 option. It's always a good idea to leave ext2
931     enabled whether you are using it or not. Also, most people using IDE hard drives will
932 zhen 1.16 want to enable the &quot;USE DMA by default&quot; option; otherwise, your IDE drives may perform
933     very poorly. Of course, remember to enable &quot;IDE disk&quot; support as well -- otherwise your
934 zhen 1.6 kernel won't be able to see your IDE disks.
935     </warn>
936 zhen 1.16 <p>If you are using hardware RAID you will need to enable a couple more options in the kernel:
937 zhen 1.6 For Highpoint RAID controllers select hpt366 chipset support, support for IDE RAID controllers and Highpoint
938     370 software RAID.For Promise RAID controllers select PROMISE PDC202{46|62|65|67|68|69|70} support,
939     support for IDE RAID
940     controllers and Support Promise software RAID (Fasttrak(tm))
941     </p>
942 zhen 1.16 <p>If you use PPPoE to connect to Internet, you will need the following
943 zhen 1.6 options in the kernel (built-in or as preferably as modules) :
944 zhen 1.16 &quot;PPP (point-to-point protocol) support&quot;, &quot;PPP support for async serial ports&quot;,
945     &quot;PPP support for sync tty ports&quot;. The two compression options won't harm but
946     are not definitely needed, neither does the &quot;PPP over Ethernet&quot; option,
947 zhen 1.6 that might only be used by <i>rp-pppoe</i> when configured to do kernel mode PPPoE.
948     </p>
949 zhen 1.16 <p>If you have an IDE cd burner, then you need to enable SCSI emulation in the
950     kernel. Turn on &quot;ATA/IDE/MFM/RLL support&quot; ---&gt; &quot;IDE, ATA and ATAPI Block
951     devices&quot; ---&gt; &quot;SCSI emulation support&quot; (I usually make it a module), then
952     under &quot;SCSI support&quot; enable &quot;SCSI support&quot;, &quot;SCSI CD-ROM support&quot; and
953     &quot;SCSI generic support&quot; (again, I usually compile them as modules). If you
954     also choose to use modules, then <c>echo -e &quot;ide-scsi\nsg\nsr_mod&quot;
955     &gt;&gt; /etc/modules.autoload</c> to have them automatically added at boot time.
956 zhen 1.6 </p>
957 zhen 1.16 <note>
958 zhen 1.6 For those who prefer it,
959     it is now possible to install Gentoo Linux with a 2.2 kernel.
960 drobbins 1.21 However, doing this comes at a price:
961 zhen 1.6 you will lose many of the nifty features that
962     are new to the 2.4 series kernels (such as XFS and tmpfs
963     filesystems, iptables, and more), although the 2.2 kernel sources can be
964 drobbins 1.21 patched with ReiserFS and devfs support.
965     Gentoo linux boot scripts require either tmpfs or ramdisk support in the kernel, so
966 zhen 1.6 2.2 kernel users need to make sure that ramdisk support is compiled in (ie, not a module).
967     It is <comment>vital</comment> that a <e>gentoo=notmpfs</e> flag be added to the kernel
968     line in <path>/boot/grub/grub.conf</path> for the 2.2 kernel so that a ramdisk is mounted
969     for the bootscripts instead of tmpfs. If you choose not to use devfs, then
970     <e>gentoo=notmpfs,nodevfs</e> should be used instead.
971     </note>
972 zhen 1.16 <p>Your new custom kernel (and modules) are now installed. Now you need to choose a system
973 zhen 1.6 logger that you would like to install. We offer sysklogd, which is the traditional set
974     of system logging daemons. We also have msyslog and syslog-ng as well as metalog. Power users seem
975     to gravitate away from sysklogd (not very good performance) and towards the
976     newer alternatives.
977     If in doubt, you may want to try metalog, since it seems to be quite popular.
978     To merge your logger of choice, type <e>one</e> of the next four lines:
979     </p>
980 zhen 1.16 <pre caption="Emerging System Logger of Choice">
981 drobbins 1.1 # <c>emerge app-admin/sysklogd</c>
982     # <c>rc-update add sysklogd default</c>
983     <comment>or</comment>
984     # <c>emerge app-admin/syslog-ng</c>
985     # <c>rc-update add syslog-ng default</c>
986     <comment>or</comment>
987     # <c>emerge app-admin/metalog</c>
988     # <c>rc-update add metalog default</c>
989     <comment>or</comment>
990     # <c>emerge app-admin/msyslog</c>
991     # <c>rc-update add msyslog default</c>
992 zhen 1.6 </pre>
993 zhen 1.16 <warn>
994 zhen 1.6 In the case of syslog-ng you need to create
995     <path>/etc/syslog-ng/syslog-ng.conf</path>.
996     See <path>/etc/syslog-ng</path>
997     for a sample configuration file.
998     </warn>
999 zhen 1.16 <impo>
1000 zhen 1.6 Metalog flushes output to the disk in blocks, so messages aren't immediately recorded into
1001     the system logs. If you are trying to debug a daemon, this performance-enhancing behavior
1002     is less than helpful. When your Gentoo Linux system is up and running, you can send
1003     metalog a USR1 signal to temporarily turn off this message buffering (meaning that
1004     <i>tail -f <path>/var/log/everything/current</path></i> will now work
1005     in real time, as expected),
1006     and a USR2 signal to turn buffering back on
1007 zhen 1.39 again. If you want to disable buffering permanently, you can change METALOG_OPTS="-B" to METALOG_OPTS="-B -s"
1008     in <path>/etc/conf.d/metalog</path>.
1009 zhen 1.6 </impo>
1010 zhen 1.16 <p>Now, you may optionally choose a cron package that you'd like to use.
1011 zhen 1.6 Right now, we offer dcron, fcron and vcron. If you don't know which one to choose,
1012     you might as well grab vcron. They can be installed as follows:
1013     </p>
1014 zhen 1.16 <pre caption="Choosing a CRON Daemon">
1015 drobbins 1.1 # <c>emerge sys-apps/dcron</c>
1016     # <c>crontab /etc/crontab</c>
1017     <comment>or</comment>
1018     # <c>emerge sys-apps/fcron</c>
1019     # <c>crontab /etc/crontab</c>
1020     <comment>or</comment>
1021     # <c>emerge sys-apps/vcron</c>
1022 zhen 1.2 <comment>You do not need to run <c>crontab /etc/crontab</c> if using vcron. </comment>
1023 drobbins 1.1 <comment>Don't forget to add your *cron to the proper init level. </comment>
1024     # <c>rc-update add *cron default </c>
1025 zhen 1.6 </pre>
1026 zhen 1.26 <!--<p>For more information how how cron works under Gentoo Linux,
1027 drobbins 1.21 see <uri link="http://lists.gentoo.org/pipermail/gentoo-announce/2002-April/000151.html">this announcement</uri>.</p>-->
1028 zhen 1.16 <p>For more information on starting programs and daemons at startup, see the
1029 drobbins 1.21 <uri link="/doc/en/rc-scripts.xml">rc-script guide</uri>.
1030 zhen 1.6 </p>
1031 zhen 1.16 </body>
1032     </section>
1033     </chapter>
1034     <chapter>
1035 zhen 1.61 <title>Installing miscellany necessary packages</title>
1036 zhen 1.16 <section>
1037     <body>
1038     <p>If you need rp-pppoe to connect to the net, be aware that at this point
1039 zhen 1.6 it has not been installed. It would be the good time to do it. </p>
1040 zhen 1.16 <pre caption="Installing rp-pppoe">
1041 zhen 1.40 # <c>USE="-X" emerge rp-pppoe</c>
1042 zhen 1.6 </pre>
1043 zhen 1.40
1044     <note>The <i>USE="-X"</i> prevents pppoe from installing its optional X interface, which is a good thing,
1045     because X and its dependencies would also be emerged. You can always recompile <i>rp-pppoe</i> with
1046     X support later.
1047     </note>
1048 zhen 1.16 <note> Please note that the rp-pppoe is built but not configured.
1049 zhen 1.6 You will have to do it again using <c>adsl-setup</c> when you boot into your Gentoo system
1050     for the first time.
1051     </note>
1052 zhen 1.16 <p>You may need to install some additional packages in the Portage tree
1053 zhen 1.6 if you are using any optional features like XFS, ReiserFS or LVM. If you're
1054 zhen 1.50 using XFS, you should emerge the <c>xfsprogs</c> package:
1055 zhen 1.6 </p>
1056 zhen 1.16 <pre caption="Emerging Filesystem Tools">
1057 drobbins 1.1 # <c>emerge sys-apps/xfsprogs</c>
1058     <comment>If you'd like to use ReiserFS, you should emerge the ReiserFS tools: </comment>
1059 zhen 1.50 # <c>emerge sys-apps/reiserfsprogs</c>
1060     <comment>If you'd like to use JFS, you should emerge the JFS tools: </comment>
1061     # <c>emerge jfsutils</c>
1062 drobbins 1.1 <comment>If you're using LVM, you should emerge the <c>lvm-user</c> package: </comment>
1063 drobbins 1.21 # <c>emerge sys-apps/lvm-user</c>
1064 zhen 1.6 </pre>
1065 zhen 1.16 <p>If you're a laptop user and wish to use your PCMCIA slots on your first
1066 zhen 1.6 real reboot, you'll want to make sure you install the <i>pcmcia-cs</i> package.
1067     </p>
1068 zhen 1.16 <pre caption="Emerging PCMCIA-cs">
1069 drobbins 1.1 # <c>emerge sys-apps/pcmcia-cs</c>
1070 zhen 1.6 </pre>
1071 zhen 1.16 <warn>You will have to re-emerge <i>pcmcia-cs</i> after installation to get PCMCIA
1072 zhen 1.10 to work.
1073     </warn>
1074 zhen 1.16 </body>
1075     </section>
1076     </chapter>
1077     <chapter>
1078 zhen 1.61 <title>Modifying /etc/fstab for your machine</title>
1079 zhen 1.16 <section>
1080     <body>
1081     <p>Your Gentoo Linux system is almost ready for use. All we need to do now is configure
1082 zhen 1.6 a few important system files and install the GRUB boot loader.
1083     The first file we need to
1084     configure is <path>/etc/fstab</path>. Remember that you should use
1085     the <c>notail</c> option for your boot partition if you chose to create a ReiserFS filesystem on it.
1086     Remember to specify <c>ext2</c>, <c>ext3</c> or <c>reiserfs</c> filesystem types as appropriate.
1087     </p>
1088 zhen 1.16 <p>Use something like the <path>/etc/fstab</path> listed below, but of course be sure to replace &quot;BOOT&quot;,
1089     &quot;ROOT&quot; and &quot;SWAP&quot; with the actual block devices you are using (such as <c>hda1</c>, etc.)</p>
1090     <pre caption="Editing fstab"><comment>
1091 drobbins 1.1 # /etc/fstab: static file system information.
1092     #
1093 zhware 1.31 # noatime turns off atimes for increased performance (atimes normally aren't
1094 drobbins 1.1 # needed; notail increases performance of ReiserFS (at the expense of storage
1095     # efficiency). It's safe to drop the noatime options if you want and to
1096     # switch between notail and tail freely.
1097    
1098     # &lt;fs&gt; &lt;mountpoint&gt; &lt;type&gt; &lt;opts&gt; &lt;dump/pass&gt;
1099    
1100     # NOTE: If your BOOT partition is ReiserFS, add the notail option to opts.
1101     </comment>
1102     /dev/BOOT /boot ext2 noauto,noatime 1 2
1103     /dev/ROOT / ext3 noatime 0 1
1104     /dev/SWAP none swap sw 0 0
1105     /dev/cdroms/cdrom0 /mnt/cdrom iso9660 noauto,ro 0 0
1106     proc /proc proc defaults 0 0
1107 zhen 1.6 </pre>
1108 zhen 1.16 <warn>Please notice that <i>/boot</i> is NOT mounted at boottime.
1109 zhen 1.6 This is to protect the data in <i>/boot</i> from
1110     corruption. If you need to access <i>/boot</i>, please mount it!
1111     </warn>
1112 zhen 1.16 </body>
1113     </section>
1114     </chapter>
1115     <chapter>
1116 zhen 1.61 <title>Setting the Root Password</title>
1117 zhen 1.16 <section>
1118     <body>
1119     <p>Before you forget, set the root password by typing: </p>
1120     <pre caption="Setting the root Password">
1121     # <c>passwd</c>
1122 zhen 1.56 </pre>
1123    
1124     <p>You will also want to add a non-root user for everyday use. Please consult
1125     the <uri link="http://www.gentoo.org/doc/en/faq.xml">Gentoo FAQ</uri>.
1126     </p>
1127 zhen 1.16 </body>
1128     </section>
1129     </chapter>
1130     <chapter>
1131 zhen 1.61 <title>Setting your Hostname</title>
1132 zhen 1.16 <section>
1133     <body>
1134     <p>Edit this file so that it contains your fully-qualified domain name on a single line,
1135 zhen 1.6 i.e. <c>mymachine.mydomain.com</c>.
1136     </p>
1137 zhen 1.16 <pre caption="Configuring Hostname">
1138     # <c>echo mymachine.mydomain.com &gt; /etc/hostname</c>
1139 zhen 1.6 </pre>
1140 zhen 1.16 </body>
1141     </section>
1142     </chapter>
1143     <chapter>
1144 zhen 1.61 <title>Modifying /etc/hosts</title>
1145 zhen 1.16 <section>
1146     <body>
1147     <p>This file contains a list of ip addresses and their associated hostnames.
1148 zhen 1.6 It's used by the system to resolve the IP addresses
1149     of any hostnames that may not be in your nameservers. Here's a template for this file:
1150     </p>
1151 zhen 1.16 <pre caption="Hosts Template">
1152 drobbins 1.1 127.0.0.1 localhost
1153     <comment># the next line contains your IP for your local LAN, and your associated machine name</comment>
1154     192.168.1.1 mymachine.mydomain.com mymachine
1155 zhen 1.6 </pre>
1156 zhen 1.16 <note>If you are on a DHCP network, it might be helpful to set <i>localhost</i> to your machine's
1157 zhen 1.6 actual hostname. This will help GNOME and many other programs in name resolution.
1158     </note>
1159 zhen 1.16 </body>
1160     </section>
1161     </chapter>
1162     <chapter>
1163     <title>Final Network Configuration</title>
1164     <section>
1165     <body>
1166     <p>Add the names of any modules that are necessary for the proper functioning of your system to
1167 zhen 1.6 <path>/etc/modules.autoload</path> file (you can also add any options you
1168     need to the same line.) When Gentoo Linux boots, these modules will be automatically
1169     loaded. Of particular importance is your ethernet card module, if you happened to compile
1170     it as a module:
1171     </p>
1172 stocke2 1.29 <pre caption="/etc/modules.autoload"><comment>This is assuming that you are using a 3com card.
1173     Check <path>/lib/modules/`uname -r`/kernel/drivers/net</path> for your card. </comment>
1174 drobbins 1.1 3c59x
1175 zhen 1.6 </pre>
1176 zhen 1.16 <p>Edit the <path>/etc/conf.d/net</path> script to get your network configured for your
1177 zhen 1.6 first boot: </p>
1178 zhen 1.16 <pre caption="Boottime Network Configuration">
1179 drobbins 1.1 # <c>nano -w /etc/conf.d/net</c>
1180     # <c>rc-update add net.eth0 default</c>
1181 zhen 1.6 </pre>
1182 zhen 1.16 <p>If you have multiple network cards you need to create additional <path>net.eth<comment>x</comment></path>
1183 zhen 1.6 scripts for each one (<comment>x</comment> = 1, 2, ...): </p>
1184 zhen 1.16 <pre caption="Multiple Network Interfaces">
1185 drobbins 1.1 # <c>cd /etc/init.d</c>
1186     # <c>cp net.eth0 net.eth<comment>x</comment></c>
1187     # <c>rc-update add net.eth<comment>x</comment> default</c>
1188 zhen 1.6 </pre>
1189 zhen 1.16 <p>If you have a PCMCIA card installed, have a quick look into
1190 zhen 1.6 <path>/etc/init.d/pcmcia</path> to verify that things seem all right for your setup,
1191 zhen 1.45 then add this line to the top of <path>/etc/init.d/net.ethx</path>:
1192 zhen 1.6 </p>
1193 zhen 1.16 <pre caption="PCMCIA depend in /etc/init.d/net.ethx">
1194 drobbins 1.1 depend() {
1195     need pcmcia
1196     }
1197 zhen 1.6 </pre>
1198 zhen 1.16 <p>This makes sure that the PCMCIA drivers are autoloaded whenever your network is loaded.
1199 zhen 1.10 </p>
1200 zhen 1.16 </body>
1201     </section>
1202     </chapter>
1203     <chapter>
1204     <title>Final steps: Configure Basic Settings (including the international keymap setting)</title>
1205     <section>
1206     <body>
1207     <pre caption="Basic Configuration">
1208 drobbins 1.1 # <c>nano -w /etc/rc.conf</c>
1209 zhen 1.6 </pre>
1210 zhen 1.16 <p>Follow the directions in the file to configure the basic settings.
1211 zhen 1.6 All users will want to make sure that <c>CLOCK</c> is set to his/her
1212     liking. International keyboard users will want to set the <c>KEYMAP</c>
1213     variable (browse <path>/usr/share/keymaps</path> to see the various
1214     possibilities).
1215     </p>
1216 zhen 1.16 </body>
1217     </section>
1218     </chapter>
1219     <chapter>
1220 zhen 1.61 <title>Configure a Bootloader</title>
1221 zhen 1.49 <section>
1222     <title>Notes</title>
1223     <body>
1224     <p> In the spirit of Gentoo, users now have more than one bootloader to choose from.
1225     Using our virtual package system, users are now able to choose between both GRUB and
1226     LILO as their bootloaders.
1227     </p>
1228     <p> Please keep in mind that having both bootloaders installed is not necessary.
1229     In fact, it can be a hinderance, so please only choose one.
1230     </p>
1231 drobbins 1.69 <impo>If you are installing Gentoo Linux on a system with an NVIDIA nForce or nForce2 chipset
1232     with an integrated GeForce graphics card, you should use LILO and avoid GRUB. With on-board
1233 drobbins 1.70 video enabled, the low memory area of your RAM may be used as video RAM. Since GRUB also uses low
1234     memory at boot time, it may experience an "out of memory" condition. So, if you have an nForce
1235 drobbins 1.69 or potentially other board with on-board video, use LILO. Even if you're using off-board video
1236     right now, it'd be nice to be able to remove the graphics card and use the on-board video in a
1237     pinch, wouldn't it? :)</impo>
1238    
1239 zhen 1.49 </body>
1240     </section>
1241 zhen 1.16 <section>
1242 zhen 1.49 <title>Configuring GRUB</title>
1243 zhen 1.16 <body>
1244     <p>The most critical part of understanding GRUB is getting comfortable with how GRUB
1245 zhen 1.6 refers to hard drives and partitions. Your Linux partition <path>/dev/hda1</path> is called
1246     <path>(hd0,0)</path> under GRUB. Notice the parenthesis around the hd0,0 - they are required.
1247 zhen 1.16 Hard drives count from zero rather than &quot;a&quot;, and partitions start at zero rather than one.
1248 zhen 1.6 Be aware too that with the hd devices, only harddrives are counted, not atapi-ide devices such as
1249     cdrom players, burners, and that the same construct can be used with scsi drives.
1250     (Normally they get higher numbers than ide drives except when the bios is configured
1251     to boot from scsi devices.) Assuming you have a harddrive on /dev/hda, a cdrom player on /dev/hdb,
1252     a burner on /dev/hdc and a second hardrive on /dev/hdd, for example, and no scsi harddrive
1253     <path>/dev/hdd7</path> gets translated to <path>(hd1,6)</path>.
1254    
1255     It might sound tricky, and tricky it is indeed, but as we will see, grub
1256     offers a tab completion mechanism that comes handy for those of you having
1257     a lot of harddrives and partitions and who are a little lost in the
1258     grub numbering scheme. Having gotten the feel for that,
1259     it's time to install GRUB.
1260     </p>
1261 zhen 1.16 <p>The easiest way to install GRUB is to simply type <c>grub</c> at your chrooted shell prompt: </p>
1262     <pre caption="Installing GRUB">
1263 zhen 1.51 # <c>emerge grub</c>
1264 drobbins 1.1 # <c>grub</c>
1265 zhen 1.6 </pre>
1266 zhen 1.16 <impo>If you are using hardware RAID this part will not work at
1267 zhen 1.6 this time.
1268     Skip to the section on making your <path>grub.conf</path>. After that we will complete the
1269     grub setup for RAID controllers
1270     </impo>
1271 zhen 1.16 <p>You'll be presented with the <c>grub&gt;</c> grub
1272 zhen 1.6 command-line prompt. Now, you need to type in the
1273     right commands to install the GRUB boot record onto your hard drive. In my example configuration,
1274     I want to install the GRUB boot record on my hard drive's MBR (master boot record), so that
1275     the first thing I see when I turn on the computer is the GRUB prompt. In my case, the commands
1276     I want to type are:
1277     </p>
1278 zhen 1.68
1279     <pre caption="GRUB on the MBR">
1280     grub&gt; <c>root (hd0,0)</c> <codenote>Your boot partition</codenote>
1281     grub&gt; <c>setup (hd0)</c> <codenote>Where the boot record is installed, here, it is the MBR</codenote>
1282     </pre>
1283    
1284     <pre caption="GRUB not on the MBR">
1285 zhen 1.53 <comment>Alternatively, if you wanted to install the bootloader somewhere other than the MBR</comment>
1286 zhen 1.68 grub&gt; <c>root (hd0,0)</c> <codenote>Your boot partition</codenote>
1287     grub&gt; <c>setup (hd0,4)</c> <codenote>Where the boot record is installed, here it is /dev/hda5</codenote>
1288 drobbins 1.1 grub&gt; <c>quit</c>
1289 zhen 1.68 </pre>
1290    
1291     <p>Here's how the two commands work. The first <c>root ( )</c> command tells GRUB
1292 zhen 1.6 the location of your boot partition (in our example, <path>/dev/hda1</path> or
1293     <path>(hd0,0)</path> in GRUB terminology. Then, the second <c>setup ( )
1294     </c> command tells GRUB where to install the
1295     boot record - it will be configured to look for its special files at the <c>root
1296     ( )</c> location that you specified. In my case, I want the boot record on the
1297     MBR of the hard drive, so I simply specify <path>/dev/hda</path> (also known as <path>(hd0)</path>).
1298     If I were using another boot loader and wanted to set up GRUB as a secondary boot-loader, I
1299     could install GRUB to the boot record of a particular partition. In that case,
1300     I'd specify a particular partition rather than the entire disk. Once the GRUB
1301     boot record has been successfully installed, you can type <c>quit</c> to quit GRUB.
1302 zhen 1.52 </p>
1303 zhen 1.6
1304     <note> The tab completion mechanism of grub can be used from within grub,
1305     assuming you wrote <c> root (</c> and that you hit the TAB key, you would
1306     be prompted with a list of the available devices (not only harddrives),
1307     hitting the TAB key having written <c> root (hd</c>, grub would print the
1308     available harddrives and hitting the TAB key after writing <c> root (hd0,</c>
1309     would make grub print the list of partitions on the first harddrive.
1310    
1311     Checking the syntax of the grub location with completion should really help
1312     to make the right choice.
1313     </note>
1314    
1315 zhen 1.52 <p>
1316 zhen 1.6 Gentoo Linux is now
1317     installed, but we need to create the <path>/boot/grub/grub.conf</path> file so that
1318     we get a nice GRUB boot menu when the system reboots. Here's how to do it.
1319     </p>
1320 zhen 1.16 <impo>To ensure backwards compatibility with GRUB, make sure to make a link from
1321 zhen 1.6 <i>grub.conf</i> to <i>menu.lst</i>. You can do this by doing
1322     <c>ln -s /boot/grub/grub.conf /boot/grub/menu.lst </c>. </impo>
1323 zhen 1.16 <p>Now, create the grub.conf file (<c>nano -w /boot/grub/grub.conf</c>), and add the following to it:
1324 zhen 1.6 </p>
1325 zhen 1.16 <pre caption="Grub.conf for GRUB">
1326 drobbins 1.1 default 0
1327     timeout 30
1328     splashimage=(hd0,0)/boot/grub/splash.xpm.gz
1329    
1330     title=My example Gentoo Linux
1331     root (hd0,0)
1332 zhen 1.51 kernel (hd0,0)/boot/bzImage root=/dev/hda3
1333 drobbins 1.1
1334     <comment> #Below is for setup using hardware RAID</comment>
1335     title=My Gentoo Linux on RAID
1336     root (hd0,0)
1337 zhen 1.63 kernel (hd0,0)/boot/bzImage root=/dev/ataraid/dXpY
1338 drobbins 1.1
1339     <comment># Below needed only for people who dual-boot</comment>
1340     title=Windows NT Workstation
1341     root (hd0,5)
1342 zhen 1.67 chainloader (hd0,5)+1
1343 zhen 1.6 </pre>
1344 zhen 1.16 <note>
1345 zhen 1.6 (hd0,0) should be written without any spaces inside the parentheses.
1346     </note>
1347 zhen 1.16 <impo>
1348 zhen 1.6 If you set up scsi emulation for an IDE cd burner earlier, then to get it to
1349 zhen 1.16 actually work you need to add an &quot;hdx=ide-scsi&quot; fragment to the kernel
1350     line in grub.conf (where &quot;hdx&quot; should be the device for your cd burner).
1351 zhen 1.6 </impo>
1352 zhen 1.16 <p>After saving this file, Gentoo Linux installation is complete. Selecting the first option will
1353 zhen 1.6 tell GRUB to boot Gentoo Linux without a fuss. The second part of the grub.conf file is optional,
1354     and shows you how to use GRUB to boot a bootable Windows partition.
1355     </p>
1356 zhen 1.16 <note>Above, <path>(hd0,0)</path> should point to your &quot;boot&quot; partition
1357 zhen 1.6 (<path>/dev/hda1</path> in our example config) and <path>/dev/hda3</path> should point to
1358     your root filesystem. <path>(hd0,5)</path> contains the NT boot
1359     loader.
1360 zhware 1.9 </note>
1361 zhen 1.16 <note>
1362 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>.
1363 zhen 1.6 </note>
1364 zhen 1.16 <p>If you need to pass any additional options to the kernel, simply
1365 zhen 1.6 add them to the end of the <c>kernel</c> command. We're already passing one option
1366     (<c>root=/dev/hda3</c>), but you can pass others as well. In particular, you can
1367     turn off devfs by default (not recommended unless you know what you're doing) by
1368     adding the <c>gentoo=nodevfs</c> option to the <c>kernel</c> command.
1369     </p>
1370 zhen 1.16 <note>Unlike in earlier versions of Gentoo Linux, you no longer have to add
1371 zhen 1.6 <c>devfs=mount</c> to the end of the <c>kernel</c> line to enable devfs. In rc6
1372     devfs is enabled by default.
1373     </note>
1374 zhen 1.16 </body>
1375     </section>
1376 zhen 1.49 <section>
1377     <title>Configuring LILO</title>
1378 zhen 1.16 <body>
1379 drobbins 1.21 <p>While GRUB may be the new alternative for most people, it is not always the best choice.
1380     LILO, the LInuxLOader, is the tried and true workhorse of Linux bootloaders. Here's how to install
1381     LILO if you would like to use it instead of GRUB:
1382 zhen 1.16 </p>
1383     <p>The first step is to emerge LILO:
1384     </p>
1385     <pre caption="Emerging LILO">
1386     # <c>emerge lilo</c>
1387     </pre>
1388     <p>Now it is time to configure LILO. I will give you a small <i>lilo.conf</i> to use, and I will explain
1389     the different parts of the file.
1390     </p>
1391     <pre caption="Example lilo.conf">
1392     boot=/dev/hda
1393     map=/boot/map
1394     install=/boot/boot.b
1395     prompt
1396     timeout=50
1397     message=/boot/message
1398     lba32
1399     default=linux
1400    
1401     image=/boot/vmlinuz-2.4.20
1402     label=linux
1403     read-only
1404     root=/dev/hda5
1405    
1406     #For dual booting windows/other OS
1407     other=/dev/hda1
1408     label=dos
1409    
1410     </pre>
1411 zhen 1.52 <ul>
1412 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>
1413     <li><i>map=/boot/map</i> states the map file. In normal use, this should not be modified. </li>
1414     <li><i>install=/boot/boot.b</i> tells LILO to install the specified file as the new boot sector.
1415     In normal use, this should not be altered. If the install line is missing, LILO will
1416     assume a default of /boot/boot.b as the file to be used. </li>
1417     <li>The existence of <i>prompt</i> tells LILO to show you whatever is referenced in the message line.
1418     While it is not recommended that you remove the prompt line, if you do remove it, you can still
1419     get a prompt by holding down the [Shift] key while your machine starts to boot. </li>
1420     <li><i>timeout=50</i> sets the amount of time that LILO will wait for user input before proceeding
1421     with booting the default line entry. This is measured in tenths of a second, with 50 as the default. </li>
1422     <li><i>message=/boot/message</i> refers to the screen that LILO displays to let you select the
1423     operating system or kernel to boot. </li>
1424     <li><i>lba32</i> describes the hard disk geometry to LILO. Another common entry here is linear. You should
1425     not change this line unless you are very aware of what you are doing. Otherwise, you could put
1426     your system in an unbootable state. </li>
1427     <li><i>default=linux</i> refers to the default operating system for LILO to boot from the
1428     options listed below this line. The name linux refers to the label line below in each of the boot options. </li>
1429     <li><i>image=/boot/vmlinuz-2.4.20</i> specifies the linux kernel to boot with this particular boot option. </li>
1430     <li><i>label=linux</i> names the operating system option in the LILO screen. In this case,
1431     it is also the name referred to by the default line. </li>
1432     <li><i>read-only</i> specifies that the root partition (see the root line below) is read-only and cannot be
1433     altered during the boot process. </li>
1434     <li><i>root=/dev/hda5</i> tells LILO what disk partition to use as the root partition. </li>
1435 zhen 1.52 </ul>
1436 zhen 1.16 <note>Thanks to <uri link="http://www.redhat.com">Redhat.com</uri> for this information.
1437     </note>
1438     <p>After you have edited your <i>lilo.conf</i> file, it is time to run LILO to load the information
1439     into the MBR:
1440     </p>
1441     <pre caption="Running LILO">
1442     # <c>/sbin/lilo</c>
1443     </pre>
1444     <p>LILO is configured, and now your machine is ready to boot into Gentoo Linux!
1445     </p>
1446     </body>
1447     </section>
1448     </chapter>
1449     <chapter>
1450 zhen 1.66 <title>Creating Bootdisks</title>
1451 zhen 1.16 <section>
1452     <title>GRUB Bootdisks</title>
1453     <body>
1454 drobbins 1.21 <p>It is always a good idea to make a boot disk the first
1455 zhen 1.16 time you install any Linux distribution. This is a security
1456 drobbins 1.21 blanket, and generally not a bad thing to do. If you are using some kinds of hardware RAID, you may <e>need</e> make a GRUB boot
1457     disk. With these types of hardware RAID,
1458     if you try to install grub from your chrooted shell it will fail. If you are in this camp,
1459     make a GRUB
1460     boot disk, and when you reboot the first time you can install GRUB
1461 zhen 1.6 to the MBR. Make your
1462     bootdisk like this:
1463     </p>
1464 zhen 1.16 <pre caption="Creating a GRUB Bootdisk">
1465 drobbins 1.1 # <c>mke2fs /dev/fd0</c>
1466     # <c>mount /dev/fd0 /mnt/floppy</c>
1467     # <c>mkdir -p /mnt/floppy/boot/grub</c>
1468     # <c>cp /usr/share/grub/i386-pc/stage1 /mnt/floppy/boot/grub/</c>
1469     # <c>cp /usr/share/grub/i386-pc/stage2 /mnt/floppy/boot/grub/</c>
1470 zhen 1.66 # <c>umount /mnt/floppy</c>
1471 drobbins 1.1 # <c>grub</c>
1472    
1473     grub&gt; <c>root (fd0)</c>
1474     grub&gt; <c>setup (fd0)</c>
1475     grub&gt; <c>quit</c>
1476 zhen 1.6 </pre>
1477 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>
1478 drobbins 1.21 and <c>setup</c> commands.</p>
1479 zhen 1.16 </body>
1480     </section>
1481     <section>
1482     <title>LILO Bootdisks</title>
1483     <body>
1484     <p>If you are using LILO, it is also a good idea to make a bootdisk:
1485     </p>
1486 zhen 1.18 <pre caption="Making a LILO Bootdisk">
1487     # <c>dd if=/boot/your_kernel of=/dev/fd0 </c>
1488     <comment>This will only work if your kernel is smaller than 1.4MB</comment>
1489     </pre>
1490 zhen 1.16 </body>
1491     </section>
1492     </chapter>
1493     <chapter>
1494     <title>Installation Complete!</title>
1495     <section>
1496     <body>
1497     <p>Now, Gentoo Linux is installed. The only remaining step is to exit the chrooted shell,
1498 stocke2 1.65 update necessary configuration files,
1499 zhen 1.6 safely unmount your partitions
1500     and reboot the system:
1501     </p>
1502 zhen 1.16 <pre caption="Rebooting the System">
1503 drobbins 1.1 # <c>etc-update</c>
1504     # <c>exit</c>
1505     <codenote>This exits the chrooted shell; you can also type <c>^D</c></codenote>
1506     # <c>cd / </c>
1507     # <c>umount /mnt/gentoo/boot</c>
1508     # <c>umount /mnt/gentoo/proc</c>
1509 drobbins 1.36 # <c>umount /mnt/gentoo/dev</c>
1510 drobbins 1.1 # <c>umount /mnt/gentoo</c>
1511     # <c>reboot</c>
1512 zhen 1.6 </pre>
1513 zhen 1.16 <note>
1514 zhen 1.6 After rebooting, it is a good idea to run the <c>update-modules</c> command to create
1515     the <path>/etc/modules.conf</path> file. Instead of modifying this file directly, you should
1516     generally make changes to the files in <path>/etc/modules.d</path>.
1517     </note>
1518 zhen 1.16 <impo>Remember if you are running hardware RAID, you must
1519 zhen 1.6 use the bootdisk for the first reboot.
1520     then go back and install grub the way everyone else did the first
1521 drobbins 1.21 time. You are done -- congratulations!</impo>
1522 zhen 1.16 <p>If you have any questions or would like to get involved with Gentoo Linux development,
1523 zhen 1.6 consider joining our gentoo-user and gentoo-dev mailing lists
1524 zhen 1.16 (there's a &quot;click to subscribe&quot; link on our <uri link="http://www.gentoo.org">main page</uri>).
1525 zhen 1.6 We also have a handy <uri link="http://www.gentoo.org/doc/en/desktop.xml">Desktop configuration guide</uri>
1526     that will
1527     help you to continue configuring your new Gentoo Linux system, and a useful
1528     <uri link="http://www.gentoo.org/doc/en/portage-user.xml">Portage user guide</uri>
1529     to help familiarize you with Portage basics. You can find the rest of the Gentoo Documentation
1530 zhen 1.16 <uri link="http://www.gentoo.org/main/en/docs.xml">here</uri>. If you have any other questions
1531 zhen 1.10 involving installation or anything for that matter, please check the Gentoo Linux
1532 zhen 1.16 <uri link="http://www.gentoo.org/doc/en/faq.xml">FAQ</uri>.
1533 zhen 1.6 Enjoy and welcome to Gentoo Linux!
1534     </p>
1535 zhen 1.16 </body>
1536     </section>
1537     </chapter>
1538     <chapter>
1539     <title>Gentoo-Stats</title>
1540     <section>
1541     <body>
1542     <p>The Gentoo Linux usage statistics program was started as an attempt to give the developers
1543 zhen 1.6 a way to find out about their user base. It collects information about Gentoo Linux usage to help
1544     us in set priorities our development. Installing it is completely optional, and it would be greatly
1545     appreciated if you decide to use it. Compiled statistics can be viewed at <uri>http://stats.gentoo.org/</uri>.
1546     </p>
1547 zhen 1.16 <p>The gentoo-stats server will assign a unique ID to your system.
1548 zhen 1.6 This ID is used to make sure that each system is counted only once. The ID will not be used
1549     to individually identify your system, nor will it be mached against an IP address or
1550     other personal information. Every precaution has been taken to assure your privacy in the
1551     development of this system. The following are the things that we are monitoring
1552 zhen 1.16 right now through our &quot;gentoo-stats&quot; program:
1553 zhen 1.6 </p>
1554 zhen 1.16 <ul>
1555     <li>installed packages and their version numbers</li>
1556     <li>CPU information: speed (MHz), vendor name, model name, CPU flags (like &quot;mmx&quot; or &quot;3dnow&quot;)</li>
1557     <li>memory information (total available physical RAM, total available swap space)</li>
1558     <li>PCI cards and network controller chips</li>
1559     <li>the Gentoo Linux profile your machine is using (that is, where the /etc/make.profile link is pointing to).</li>
1560     </ul>
1561     <p>We are aware that disclosure of sensitive information is a threat to most Gentoo Linux users
1562 zhen 1.6 (just as it is to the developers).
1563     </p>
1564 zhen 1.16 <ul>
1565     <li>Unless you modify the gentoo-stats program, it will never transmit sensitive
1566 zhen 1.6 information such as your passwords, configuration data, shoe size...</li>
1567 zhen 1.16 <li>Transmission of your e-mail addresses is optional and turned off by default.</li>
1568     <li>The IP address your data transmission originates from will never be logged
1569     in such a way that we can identify you. There are no &quot;IP address/system ID&quot; pairs.</li>
1570     </ul>
1571     <p>The installation is easy - just run the following commands:
1572 zhen 1.6 </p>
1573 zhen 1.16 <pre caption="Installing gentoo-stats">
1574 drobbins 1.1 # <c>emerge gentoo-stats</c> <codenote>Installs gentoo-stats</codenote>
1575     # <c>gentoo-stats --new</c> <codenote>Obtains a new system ID</codenote>
1576 zhen 1.6 </pre>
1577 zhen 1.16 <p>The second command above will request a new system ID and enter it into
1578 zhen 1.6 <path>/etc/gentoo-stats/gentoo-stats.conf</path> automatically. You can view this file
1579     to see additional configuration options.
1580     </p>
1581 zhen 1.16 <p>After that, the program should be run on a regular schedule
1582 zhen 1.6 (gentoo-stats does not have to be run as root). Add this line to your <path>crontab</path>:
1583     </p>
1584 zhen 1.16 <pre caption="Updating gentoo-stats with cron">
1585     <c>0 0 * * 0,4 /usr/sbin/gentoo-stats --update &gt; /dev/null</c>
1586     </pre>
1587     <p>The <c>gentoo-stats</c> program is a simple perl script which can be
1588 zhen 1.6 viewed with your favortive pager or editor: <path>/usr/sbin/gentoo-stats</path>. </p>
1589 zhen 1.16 </body>
1590     </section>
1591     </chapter>
1592 drobbins 1.1 </guide>

  ViewVC Help
Powered by ViewVC 1.1.20