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

Parent Directory Parent Directory | Revision Log Revision Log

Revision 1.96 - (show annotations) (download) (as text)
Tue Mar 25 01:57:42 2003 UTC (14 years, 6 months ago) by peesh
Branch: MAIN
Changes since 1.95: +2 -6 lines
File MIME type: application/xml
fixed bug 17384 - removed warning about syslog-ng not having a default
syslog-ng since this is not true as of 1.6.0

1 <?xml version="1.0" encoding="UTF-8"?>
2 <!DOCTYPE guide SYSTEM "/dtd/guide.dtd">
3 <guide link="/doc/en/gentoo-x86-install.xml">
4 <title>Gentoo Linux 1.4_rc3 Installation Instructions</title>
5 <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 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 <author title="Editor">
28 <mail link="seo@gentoo.org">Jungmin Seo</mail>
29 </author>
30 <author title="Editor">
31 <mail link="zhware@gentoo.org">Stoyan Zhekov</mail>
32 </author>
33 <author title="Editor">
34 <mail link="jhhudso@gentoo.org">Jared Hudson</mail>
35 </author>
36 <author title="Editor">
37 <mail link="">Colin Morey</mail>
38 <author title="Editor">
39 <mail link="peesh@gentoo.org">Jorge Paulo</mail>
40 </author>
41 <abstract>These instructions step you through the process of installing Gentoo
42 Linux 1.4_rc3. The Gentoo Linux installation process supports various installation
43 approaches, depending upon how much of the system you want to custom-build from
44 scratch.
45 </abstract>
46 <version>2.6</version>
47 <date>20 March 2003</date>
48 <chapter>
49 <title>About the Install</title>
50 <section>
51 <body>
52 <p>This new boot CD will boot from nearly any modern IDE CD-ROM drive, as well
53 as many SCSI CD-ROM drives, assuming that your CD-ROM and BIOS both support booting.
54 Included on the CD-ROM is Linux support for IDE (and PCI IDE) (built-in to the
55 kernel) as well as support for all SCSI devices (available as modules.) In
56 addition, we provide modules for literally every kind of network card that
57 Linux supports, as well as tools to allow you to configure your network and
58 establish outbound (as well as inbound) <c>ssh</c> connections and to download
59 files. </p>
60 <p>To install from the build CD, you will need to have a 486+ processor and
61 ideally at least 64 Megabytes of RAM. (Gentoo Linux has been successfully
62 built with 64MB of RAM + 64MB of swap space, but the build process is awfully
63 slow under those conditions.)</p>
64 <p>Gentoo Linux can be installed using one of three &quot;stage&quot; tarball files. The
65 one you choose depends on how much of the system you want to compile yourself.
66 The stage1 tarball is used when you want to bootstrap and build the entire
67 system from scratch. The stage2 tarball is used for building the entire system
68 from a bootstrapped state. The stage3 tarball already contains a basic Gentoo Linux system.</p>
69 <p><b>So, should you choose to start from a stage1, stage2, or stage3 tarball?</b>
70 Starting from a stage1 allows you to have total control over the optimization settings
71 and optional build-time functionality that is initially enabled on your system. This
72 makes stage1 installs good for power users who know what they are doing. Stage2 installs
73 allow you to skip the bootstrap process, and doing this is fine if you are happy with
74 the optimization settings that we chose for your particular stage2 tarball. Choosing to
75 go with a stage3 allows for the fastest install of Gentoo Linux, but also means that
76 your base system will have the optimization settings that we chose for you. Since major
77 releases of Gentoo Linux have stage3's specifically optimized for various popular processors,
78 this may be sufficient for you. <b>If you're installing Gentoo Linux for the first time, consider
79 using a stage3 tarball for installation.</b></p>
82 <p> So, how does one begin the install process? First, you will want to decide which one of our LiveCD ISO images to grab from
83 <uri>http://www.ibiblio.org/gentoo/releases/1.4_rc3/x86/</uri> .
84 </p>
85 <p> The LiveCDs are full CD images that should be burned to a CDR or CD-RW
86 using CD burning software. Currently, we have two types of LiveCDs. The first
87 carries the &quot;gentoo-basic&quot; label, and is approximately 40MB in size, contains only the stage 1 tarball and lives
88 in the <path>x86/livecd/</path> directory. This LiveCD is of minimal size to
89 allow for a initial quick download and contains a stage1 tarball that can be
90 found in <path>/mnt/cdrom/gentoo/</path> after the CD has booted.</p>
91 <p>The second flavor of LiveCD we currently offer is labeled &quot;gentoo-3stages.&quot;
92 This CD is also found in <path>x86/livecd</path>. It
93 contains stage 1, 2 and 3 tarballs. Using this LiveCD, it will be possible
94 for you to install a fully-functional Gentoo Linux system very quickly.</p>
95 <p><b>What happened to i686, pentium3, athlon, athlon-mp stages, LiveCDs and GRP (Gentoo Reference Platform)?</b>
96 Gentoo 1.4_rc3 is meant to be a minimal release candidate only. 1.4_rc4 will contain all the usual x86 architectures and GRP. If you want to install stages optimized for these other x86 architectures or GRP, use the 1.4_rc2 documentation, which can be found at <uri>http://www.gentoo.org/doc/en/gentoo-x86-1.4_rc2-install.xml</uri>
97 </p>
98 <impo>If you encounter a problem with any part of the install and wish to
99 report it as a bug, report it to <uri>http://bugs.gentoo.org</uri>. If the bug
100 needs to be sent upstream to the original software developers (eg the KDE team) the
101 <e>Gentoo Linux developers</e> will take care of that for you.
102 </impo>
103 <p>Now, let us quickly review the install process. First, we will download, burn
104 and boot a LiveCD. After getting a root prompt, we will create partitions, create
105 our filesystems, and extract either a stage1, stage2 or stage3 tarball. If we
106 are using a stage1 or stage2 tarball, we will take the appropriate steps to get
107 our system to stage3. Once our system is at stage3, we can configure it
108 (customize configuration files, install a boot loader, etc) and boot it and have a
109 fully-functional Gentoo Linux system. Depending on what stage of the build
110 process you're starting from, here is what is required for installation: </p>
111 <table>
112 <tr>
113 <th>stage tarball</th>
114 <th>requirements for installation</th>
115 </tr>
116 <tr>
117 <ti>1</ti>
118 <ti>partition/filesystem setup, emerge sync, bootstrap, emerge system, emerge kernel sources, final configuration</ti>
119 </tr>
120 <tr>
121 <ti>2</ti>
122 <ti>partition/filesystem setup, emerge sync, emerge system, emerge kernel sources, final configuration</ti>
123 </tr>
124 <tr>
125 <ti>3</ti>
126 <ti>partition/filesystem setup, emerge sync, final configuration</ti>
127 </tr>
128 </table>
129 </body>
130 </section>
131 </chapter>
132 <chapter>
133 <title>Booting</title>
134 <section>
135 <body>
136 <p>Start by booting the LiveCD. You should see a fancy boot screen
137 with the Gentoo Linux logo on it. At this screen, you can hit Enter to begin the boot process,
138 or boot the LiveCD with custom boot options by typing <c>gentoo opt1 opt2</c> and then hitting Enter. To see
139 a detailed description of available boot options, press F2 to view the help screen.</p>
141 <p> Once you hit Enter, you will be greeted with the standard kernel
142 booting output, kernel and initrd messages, followed by the normal Gentoo
143 Linux boot sequence. You will be automatically logged in as
144 &quot;<c>root</c>&quot; and the root password will be set to a random string
145 for security purposes. You should have a root (&quot;<c>#</c>&quot;) prompt
146 on the current console, and can also switch to other consoles by pressing
147 Alt-F2, Alt-F3 and Alt-F4. Get back to the one you started on by pressing
148 Alt-F1. At this point you should set the root password, type passwd and
149 follow the prompts.
150 </p>
151 <p>You've probably also noticed that above your <c>#</c> prompt is a bunch of help text
152 that explains how to do things like configure your Linux networking and telling you where you can find
153 the Gentoo Linux stage tarballs and packages on your CD.
154 </p>
155 </body>
156 </section>
157 </chapter>
158 <chapter>
159 <title>Load Kernel Modules</title>
160 <section>
161 <body>
162 <p>If the PCI autodetection missed some of your hardware, you
163 will have to load the appropriate kernel modules manually.
164 To view a list of all available network card modules, type <c>ls
165 /lib/modules/*/kernel/drivers/net/*</c>. To load a particular module,
166 type:
167 </p>
168 <pre caption="PCI Modules Configuration">
169 # <c>modprobe pcnet32</c>
170 <comment>(replace pcnet32 with your NIC module)</comment>
171 </pre>
172 <p>Likewise, if you want to be able to access any SCSI hardware that wasn't detected
173 during the initial boot autodetection process, you will need to load the appropriate
174 modules from /lib/modules, again using <c>modprobe</c>:
175 </p>
176 <pre caption="Loading SCSI Modules">
177 # <c>modprobe aic7xxx</c>
178 <comment>(replace aic7xxx with your SCSI adapter module)</comment>
179 # <c>modprobe sd_mod</c>
180 <comment>(sd_mod is the module for SCSI disk support)</comment>
181 </pre>
182 <note>
183 Support for a SCSI CD-ROMs and disks are built-in in the kernel.
184 </note>
185 <p>If you are using hardware RAID, you will need to load the
186 ATA-RAID modules for your RAID controller.
187 </p>
188 <pre caption="Loading RAID Modules">
189 # <c>modprobe ataraid</c>
190 # <c>modprobe pdcraid</c>
191 <comment>(Promise Raid Controller)</comment>
192 # <c>modprobe hptraid</c>
193 <comment>(Highpoint Raid Controller)</comment>
194 </pre>
195 <p>The Gentoo LiveCD should have enabled DMA on your disks, but if it did not,
196 <c>hdparm</c> can be used to set DMA on your drives. </p>
197 <pre caption="Setting DMA">
198 <comment>Replace hdX with your disk device.</comment>
199 # hdparm -d 1 /dev/hdX <comment>Enables DMA </comment>
200 # hdparm -d1 -A1 -m16 -u1 -a64 /dev/hdX
201 <comment>(Enables DMA and other safe performance-enhancing options)</comment>
202 # hdparm -X66 /dev/hdX
203 <comment>(Force-enables Ultra-DMA -- dangerous -- may cause some drives to mess up)</comment>
204 </pre>
205 </body>
206 </section>
207 </chapter>
209 <chapter>
210 <title>Loading PCMCIA Kernel Modules</title>
211 <section>
212 <body>
213 <p>If you have a PCMCIA network card, you will need to perform a few extra steps.
214 </p>
215 <warn>To avoid problems with <c>cardmgr</c>, you <e>must</e> run it <e>before</e> you enter the chroot
216 portion of the install. </warn>
217 <pre caption="Loading PCMCIA Modules">
218 # <i>modprobe pcmcia_core</i>
219 # <i>modprobe i82365</i>
220 # <i>modprobe ds</i>
221 # <i>cardmgr -f</i>
222 </pre>
223 <p>As <c>cardmgr</c> detects which hardware is present, your speaker should emit a
224 few reassuring beeps, and your PCMCIA network card should be active. You can
225 of course insert the PCMCIA card after loading <c>cardmgr</c> too, if that is
226 preferable. (Technically, you need not run
227 <c>cardmgr</c> if you know exactly which module your PCMCIA card requires.
228 But if you don't, loading all PCMCIA modules and see which sticks won't work,
229 as all PCMCIA modules load obligingly and hang around for a PCMCIA card to
230 drop by. <c>cardmgr</c> will also unload the module(s) for any card when you
231 remove it). </p>
232 </body>
233 </section>
234 </chapter>
235 -->
236 <chapter>
237 <title>Configuring Networking</title>
238 <section>
239 <title>Maybe it just works?</title>
240 <body>
241 <p>If you're using a 1.4_rc3 or later LiveCD, it is possible that your networking has already been
242 configured automatically for you. If so, you should be able to take advantage of the many included
243 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>,
244 among others.</p>
246 <p>If networking has been configured for you, the <c>/sbin/ifconfig</c> command should
247 list some internet interfaces besides <c>lo</c>, such as <c>eth0</c>:
248 </p>
249 <pre caption="/sbin/ifconfig for a working network card">
250 eth0 Link encap:Ethernet HWaddr 00:50:BA:8F:61:7A
251 inet addr: Bcast: Mask:
252 inet6 addr: fe80::50:ba8f:617a/10 Scope:Link
254 RX packets:1498792 errors:0 dropped:0 overruns:0 frame:0
255 TX packets:1284980 errors:0 dropped:0 overruns:0 carrier:0
256 collisions:1984 txqueuelen:100
257 RX bytes:485691215 (463.1 Mb) TX bytes:123951388 (118.2 Mb)
258 Interrupt:11
259 </pre>
260 <p>You may want to also try pinging your ISP's DNS server (found in <path>/etc/resolv.conf</path>),
261 and a Web site of choice, just to make sure that your packets are reaching the net, DNS name
262 resolution is working correctly, etc.
263 </p>
264 <pre caption="Further Network Testing">
265 # <c>ping -c 3 www.yahoo.com </c>
266 </pre>
267 <p>Are you able to use your network? If so, you can skip the rest of this section.</p>
268 </body>
269 </section>
270 <section>
271 <title> PPPoE configuration</title>
272 <body>
273 <p>Assuming you need PPPoE to connect to the internet, the LiveCD (any version) has
274 made things easy for you by including <c>rp-pppoe</c>. Use the provided <c>adsl-setup</c>
275 script to configure your connection. You will be prompted for the ethernet
276 device that is connected to your adsl modem, your username and password,
277 the IPs of your DNS servers, and if you need a basic firewall or not. </p>
278 <pre caption="Configuring PPPoE">
279 # <c> adsl-setup </c>
280 # <c> adsl-start </c>
281 </pre>
282 <p>If something goes wrong, double-check that you correctly typed
283 your username and password by looking at <path>/etc/ppp/pap-secrets</path> or
284 <path>/etc/ppp/chap-secrets</path>, and make sure you are using the right ethernet device. </p>
285 </body>
286 </section>
287 <section>
288 <title> Automatic Network Configuration </title>
289 <body>
290 <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>
291 <pre caption="Net-Setup Script">
292 # <c>net-setup eth0</c>
293 </pre>
294 <p>Of course, if you prefer, you may still set up networking manually. This is covered next.</p>
295 </body>
296 </section>
297 <section>
298 <title>Manual DHCP Configuration</title>
299 <body>
300 <p>Network configuration is simple with DHCP; If your ISP is not using
301 DHCP, skip down to the static configuration section below. </p>
302 <pre caption="Network configuration with DHCP">
303 # <c>dhcpcd eth0</c>
304 </pre>
305 <note>Some ISPs require you to provide a hostname. To do that,
306 add a <c>-h myhostname</c> flag to the dhcpcd command line above.
307 </note>
308 <p>If you receive <i>dhcpConfig</i> warnings, don't panic; the errors
309 are most likely cosmetic. Skip down to Network testing below.</p>
310 </body>
311 </section>
312 <section>
313 <title>Manual Static Configuration</title>
314 <body>
315 <p>We need to setup just enough networking so that we can download
316 sources for the system build, as well as the required localhost interface.
317 Type in the following commands, replacing
318 $IFACE with your network interface (typically <c>eth0</c>), $IPNUM
319 with your IP address, $BCAST with your broadcast address, and $NMASK
320 with your network mask. For the <c>route</c> command, replace
321 $GTWAY with your default gateway.
322 </p>
323 <pre caption="Static IP Network Configuration">
324 # <c>ifconfig $IFACE $IPNUM broadcast $BCAST netmask $NMASK</c>
325 # <c>/sbin/route add -net default gw $GTWAY netmask metric 1</c>
326 </pre>
327 <p>Now it is time to create the <path>/etc/resolv.conf</path>
328 file so that name resolution (finding Web/FTP sites by name, rather than just by IP address) will work.</p>
329 <p>Here is a template to follow for creating your /etc/resolv.conf file: </p>
330 <pre caption="/etc/resolv.conf template">
331 domain mydomain.com
332 nameserver
333 nameserver
334 </pre>
335 <p>Replace <c></c> and <c></c> with the IP addresses of your
336 primary and secondary DNS servers respectively.</p>
337 </body>
338 </section>
339 <section>
340 <title>Proxy Configuration</title>
341 <body>
342 <p>If you are behind a proxy, it is necessary to configure your proxy before
343 you continue. We will export some variables to set up the proxy accordingly.
344 </p>
345 <pre caption="Setting a Proxy">
346 # <c>export http_proxy=&quot;machine.company.com:1234&quot; </c>
347 # <c>export ftp_proxy=&quot;$http_proxy&quot; </c>
348 # <c>export RSYNC_PROXY=&quot;$http_proxy&quot; </c>
349 </pre>
350 </body>
351 </section>
352 <section>
353 <title>Networking is go!</title>
354 <body>
355 <p>Networking should now be configured and usable. You should be able to use the included
356 <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>
357 </body>
358 </section>
359 </chapter>
360 <chapter>
361 <title>Setting your system's date and time</title>
362 <section>
363 <body>
364 <p>Now you need to set your system's date and time.
365 You can do this using the <c>date</c> command.</p>
366 <pre caption="Setting your system's date">
367 # <c>date</c>
368 Thu Feb 27 09:04:42 CST 2003
369 <comment>(If your date is wrong, set your date with this next command)</comment>
370 # <c>date 022709042003</c>
371 <comment>(date MMDDhhmmCCYY)</comment>
372 </pre>
373 </body>
374 </section>
375 </chapter>
376 <chapter>
377 <title>Filesystems, partitions and block devices</title>
378 <section>
379 <title>Introduction to block devices</title>
380 <body>
381 <p>
382 In this section, we'll take a good look at disk-oriented aspects of Gentoo Linux and Linux in general, including
383 Linux filesystems, partitions and block devices. Then, once you're familar with the ins and outs of disks and
384 filesystems, you'll be guided through the process of setting up partitions and filesystems for your Gentoo Linux
385 install.
386 </p>
387 <p>
388 To begin, I'll introduce "block devices". The most famous block device is
389 probably the one that represents the first IDE drive in a Linux system:
390 </p>
391 <pre caption="/dev/hda, the block device representing the primary master IDE drive in your system">
392 /dev/hda
393 </pre>
395 <p>
396 If your system uses SCSI drives, then your first hard drive will be:
397 </p>
399 <pre caption="/dev/sda, the block device representing the first logical SCSI drive in your system">
400 /dev/sda
401 </pre>
403 <p>The block devices above represent an <i>abstract</i> interface to the disk.
404 User programs can use these block devices to interact with your disk without
405 worrying about whether your drivers are IDE, SCSI or something else. The
406 program can simply address the storage on the disk as a bunch of contiguous,
407 randomly-accessible 512-byte blocks. </p>
408 </body>
409 </section>
410 <section>
411 <title>Partitions and fdisk</title>
412 <body>
413 <p> Under Linux, we create filesystems by using a special command called
414 <c>mkfs</c> (or <c>mke2fs</c>, <c>mkreiserfs</c>, etc,) specifying a particular
415 block device as a command-line argument. </p>
417 <p> However, although it is theoretically possible to use a "whole disk" block
418 device (one that represents the <i>entire</i> disk) like <c>/dev/hda</c> or
419 <c>/dev/sda</c> to house a single filesystem, this is almost never done in
420 practice. Instead, full disk block devices are split up into smaller, more
421 manageable block devices called "partititons". Partitions are created using a
422 tool called <c>fdisk</c>, which is used to create and edit the partition table
423 that's stored on each disk. The partition table defines exactly how to split
424 up the full disk. </p>
426 <p> We can take a look at a disk's partition table by running <c>fdisk</c>,
427 specifying a block device that represents a full disk as an argument: </p>
429 <note>Alternate interfaces to the disk's partition table include <c>cfdisk</c>,
430 <c>parted</c> and <c>partimage</c></note>
432 <pre caption="Starting up fdisk">
433 # fdisk /dev/hda
434 </pre>
435 <p>
436 or
437 </p>
438 <pre caption="Starting up fdisk to look at the partition table on /dev/sda">
439 # fdisk /dev/sda
440 </pre>
442 <impo>
443 <b>Note that you should <i>not</i> save or make any changes to a disk's
444 partition table if any of its partitions contain filesystems that are in use or
445 contain important data. Doing so will generally cause data on the disk to be
446 lost.</b>
447 </impo>
449 <p>
450 Once in fdisk, you'll be greeted with a prompt that looks like this:
451 </p>
453 <pre caption="The fdisk prompt">
454 Command (m for help):
455 </pre>
458 <p>
459 Type <c>p</c> to display your disk's current partition configuration:
460 </p>
462 <pre caption="An example partition configuration">
463 Command (m for help): p
465 Disk /dev/hda: 240 heads, 63 sectors, 2184 cylinders
466 Units = cylinders of 15120 * 512 bytes
468 Device Boot Start End Blocks Id System
469 /dev/hda1 1 14 105808+ 83 Linux
470 /dev/hda2 15 49 264600 82 Linux swap
471 /dev/hda3 50 70 158760 83 Linux
472 /dev/hda4 71 2184 15981840 5 Extended
473 /dev/hda5 71 209 1050808+ 83 Linux
474 /dev/hda6 210 348 1050808+ 83 Linux
475 /dev/hda7 349 626 2101648+ 83 Linux
476 /dev/hda8 627 904 2101648+ 83 Linux
477 /dev/hda9 905 2184 9676768+ 83 Linux
479 Command (m for help):
480 </pre>
482 <p> This particular disk is configured to house seven Linux filesystems (each
483 with a corresponding partition listed as "Linux") as well as a swap partition
484 (listed as "Linux swap"). </p>
486 <p>
487 Notice the name of the corresponding partition block
488 devices on the left hand side, starting with <c>/dev/hda1</c> and going up to
489 <c>/dev/hda9</c>. In the early days of the PC, partitioning software only
490 allowed a maximum of four partitions (called "primary" partitions). This was
491 too limiting, so a workaround called an <i>extended partitioning</i> was
492 created. An extended partition is very similar to a primary partition, and
493 counts towards the primary partition limit of four. However, extended
494 partitions can hold any number of so-called <i>logical</i> partitions inside
495 them, providing an effective means of working around the four partition limit.
496 </p>
498 <p>
499 All partitions <c>hda5</c> and higher are logical partitions. The numbers 1
500 through 4 are reserved for primary or extended partitions. </p>
502 <p> So, In our example, <c>hda1</c> through <c>hda3</c> are primary partitions.
503 <c>hda4</c> is an extended partition that contains logical partitions
504 <c>hda5</c> through <c>hda9</c>. You would never actually
505 <i>use</i> <c>/dev/hda4</c> for storing any filesystems directly -- it simply
506 acts as a container for partitions <c>hda5</c> through <c>hda9</c>. </p>
508 <p> Also, notice that each partition has an "Id", also called a "partition
509 type". Whenever you create a new partition, you should ensure that the
510 partition type is set correctly. '83' is the correct partition type for
511 partitions that will be housing Linux filesystems, and '82' is the correct
512 partition type for Linux swap partitions. You set the partition type using the
513 <c>t</c> option in <c>fdisk</c>. The Linux kernel uses the partition type
514 setting to auto-detect fileystems and swap devices on the disk at boot-time.
515 </p>
516 </body>
517 </section>
518 <section>
519 <title>Using fdisk to set up partitions</title>
520 <body>
522 <p>Now that you've had your introduction to the way disk partitioning is
523 done under Linux, it's time to walk you through the process of setting up disk
524 partitions for your Gentoo Linux installation. After we walk you through the
525 process of creating partitions on your disk, your partition configuration will
526 look like this: </p>
528 <pre caption="The partition configuration that you will have after following these steps">
529 Disk /dev/hda: 30.0 GB, 30005821440 bytes
530 240 heads, 63 sectors/track, 3876 cylinders
531 Units = cylinders of 15120 * 512 = 7741440 bytes
533 Device Boot Start End Blocks Id System
534 /dev/hda1 * 1 14 105808+ 83 Linux
535 /dev/hda2 15 81 506520 82 Linux swap
536 /dev/hda3 82 3876 28690200 83 Linux
538 Command (m for help):
539 </pre>
541 <p>In our suggested "newbie" partition configuration, we have three partitions.
542 The first one (<c>/dev/hda1</c>) at the beginning of the disk is a small
543 partition called a boot partition. The boot partition's purpose is to hold all
544 the critical data related to booting -- GRUB boot loader information (if you
545 will be using GRUB) as well as your Linux kernel(s). The boot partition gives
546 us a safe place to store everything related to booting Linux. During normal
547 day-to-day Gentoo Linux use, your boot partition should remain <e>unmounted</e>
548 for safety. If you are setting up a SCSI system, your boot partition will
549 likely end up being <c>/dev/sda1</c>.</p>
551 <p>The second partition (<c>/dev/hda2</c>) is used to for swap space. The
552 kernel uses swap space as virtual memory when RAM becomes low. This partition,
553 relatively speaking, isn't very big either, typically somewhere around 512MB.
554 If you're setting up a SCSI system, this partition will likely end up
555 being called <c>/dev/sda2</c>. </p>
557 <p>The third partition (<c>/dev/hda3</c>) is quite large and takes up the rest
558 of the disk. This partition is called our "root" partition and will be used to
559 store your main filesystem that houses Gentoo Linux itself. On a SCSI system,
560 this partition would likely end up being <c>/dev/sda3</c>.</p>
563 <p>Before we partition the disk, here's a quick technical overview of the
564 suggested partition and filesystem configuration to use when installing Gentoo
565 Linux:</p>
567 <table>
568 <tr>
569 <th>Partition</th>
570 <th>Size</th>
571 <th>Type</th>
572 <th>example device</th>
573 </tr>
574 <tr>
575 <ti>boot partition, containing kernel(s) and boot information</ti>
576 <ti>100 Megabytes</ti>
577 <ti>ext2/3 highly recommended (easiest); if ReiserFS then mount with <c>-o notail</c></ti>
578 <ti>/dev/hda1</ti>
579 </tr>
580 <tr>
581 <ti>swap partition (no longer a 128 Megabyte limit, now 2GB)</ti>
582 <ti>Generally, configure a swap area that is between one to two times the size of the physical RAM
583 in your system.</ti>
584 <ti>Linux swap</ti>
585 <ti>/dev/hda2</ti>
586 </tr>
587 <tr>
588 <ti>root partition, containing main filesystem (/usr, /home, etc)</ti>
589 <ti>&gt;=1.5 Gigabytes</ti>
590 <ti>ReiserFS, ext3 recommended; ext2 ok</ti>
591 <ti>/dev/hda3</ti>
592 </tr>
593 </table>
595 <p>OK, now to create the partitions as in the example and table above. First,
596 enter fdisk by typing <c>fdisk /dev/hda</c> or <c>fdisk /dev/sda</c>,
597 depending on whether you're using IDE or SCSI. Then, type <c>p</c> to view your
598 current partition configuration. Is there anything on the disk that you need
599 to keep? If so, <b>stop now</b>. If you continue with these directions, <b>all
600 existing data on your disk will be erased.</b></p>
602 <impo>Following these instructions below will cause all prior data on your disk
603 to <b>be erased</b>! If there is anything on your drive, please be sure that it
604 is non-critical information that you don't mind losing. Also make sure that you
605 <b>have selected the correct drive</b> so that you don't mistakenly wipe data
606 from the wrong drive.</impo>
608 <p>Now, it's time to delete any existing partitions. To do this, type <c>d</c>
609 and hit Enter. You will then be prompted for the partition number you would like
610 to delete. To delete a pre-existing <c>/dev/hda1</c>, you would type:</p>
612 <pre caption="Deleting a partition">
613 Command (m for help): d
614 Partition number (1-4): 1
615 </pre>
617 <p>The partition has been scheduled for deletion. It will no longer show up if
618 you type <c>p</c>, but it will not be erased until your changes have been
619 saved. If you made a mistake and want to abort without saving your changes,
620 type <c>q</c> immediately and hit enter and your partition will not be
621 deleted.</p>
622 <!-- NOTE: THis is not sufficient documentation to cover ATA Raid and I just
623 find it confusing, so I'm commenting it out (drobbins)
624 <note>If you are using RAID your partitions will be a little different. You
625 will have the partitions like this: <path>/dev/ataraid/discX/partY</path> X are
626 the arrays you have made, so if you only have made 1 array, then it will be
627 disc0.Y is the partition number as in <path>/dev/hdaY</path> </note>
628 -->
629 <p>Now, assuming that you do indeed want to wipe out all the partitions on your
630 system, repeatedly type <c>p</c> to print out a partition listing and then type
631 <c>d</c> and the number of the partition to delete it. Eventually, you'll end up
632 with a partition table with nothing in it:</p>
634 <pre caption="An empty partition table">
635 Disk /dev/hda: 30.0 GB, 30005821440 bytes
636 240 heads, 63 sectors/track, 3876 cylinders
637 Units = cylinders of 15120 * 512 = 7741440 bytes
639 Device Boot Start End Blocks Id System
641 Command (m for help):
642 </pre>
644 <p>Now that the in-memory partition table is empty, we're ready to create a
645 boot partition. To do this, type <c>n</c> to create a new partition, then
646 <c>p</c> to tell fdisk you want a primary partition. Then type <c>1</c> to
647 create the first primary partition. When prompted for the first cylinder, hit
648 enter. When prompted for the last cylinder, type <c>+100M</c> to create a
649 partition 100MB in size. You can see output from these steps below:</p>
651 <pre caption="Steps to create our boot partition">
652 Command (m for help): n
653 Command action
654 e extended
655 p primary partition (1-4)
656 p
657 Partition number (1-4): 1
658 First cylinder (1-3876, default 1):
659 Using default value 1
660 Last cylinder or +size or +sizeM or +sizeK (1-3876, default 3876): +100M
661 </pre>
663 <p>Now, when you type <c>p</c>, you should see the following partition printout:</p>
665 <pre caption="Our first partition has been created">
666 Command (m for help): p
668 Disk /dev/hda: 30.0 GB, 30005821440 bytes
669 240 heads, 63 sectors/track, 3876 cylinders
670 Units = cylinders of 15120 * 512 = 7741440 bytes
672 Device Boot Start End Blocks Id System
673 /dev/hda1 1 14 105808+ 83 Linux
674 </pre>
676 <p>Next, let's create the swap partition. To do this, type <c>n</c> to create a
677 new partition, then <c>p</c> to tell fdisk that you want a primary partition. Then
678 type <c>2</c> to create the second primary partition, <c>/dev/hda2</c> in our case.
679 When prompted for the first cylinder, hit enter. When prompted for the last cylinder,
680 type <c>+512M</c> to create a partition 512MB in size. After you've done this, type
681 <c>t</c> to set the partition type, and then type in <c>82</c> to set the partition
682 type to "Linux Swap". After completing these steps, typing <c>p</c> should display
683 a partition table that looks similar to this:</p>
685 <pre caption="Our swap partition has been created">
686 Command (m for help): p
688 Disk /dev/hda: 30.0 GB, 30005821440 bytes
689 240 heads, 63 sectors/track, 3876 cylinders
690 Units = cylinders of 15120 * 512 = 7741440 bytes
692 Device Boot Start End Blocks Id System
693 /dev/hda1 1 14 105808+ 83 Linux
694 /dev/hda2 15 81 506520 82 Linux swap
695 </pre>
697 <p>Finally, let's create the root partition. To do this, type <c>n</c> to
698 create a new partition, then <c>p</c> to tell fdisk that you want a primary
699 partition. Then type <c>2</c> to create the second primary partition,
700 <c>/dev/hda3</c> in our case. When prompted for the first cylinder, hit enter.
701 When prompted for the last cylinder, hit enter to create a partition that takes
702 up the rest of the remaining space on your disk. After completing these steps,
703 typing <c>p</c> should display a partition table that looks similar to
704 this:</p>
706 <pre caption="Our root partition has been created">
707 Command (m for help): p
709 Disk /dev/hda: 30.0 GB, 30005821440 bytes
710 240 heads, 63 sectors/track, 3876 cylinders
711 Units = cylinders of 15120 * 512 = 7741440 bytes
713 Device Boot Start End Blocks Id System
714 /dev/hda1 1 14 105808+ 83 Linux
715 /dev/hda2 15 81 506520 82 Linux swap
716 /dev/hda3 82 3876 28690200 83 Linux
717 </pre>
719 <p>
720 Finally, we need to set the "bootable" flag on our boot partition and then write
721 our changes to disk. To tag <c>/dev/hda1</c> as a "bootable" partition, type
722 <c>a</c> at the menu and then type in <c>1</c> for the partition number. If you
723 type <c>p</c> now, you'll now see that <c>/dev/hda1</c> has a <c>*</c> in the "Boot"
724 column. Now, let's write our changes to disk. To do this, type <c>w</c> and hit
725 enter. Your disk partitions are now properly configured for a Gentoo Linux
726 install.
727 </p>
729 <note>If <c>fdisk</c> or <c>cfdisk</c> instruct you to do so, please reboot to
730 allow your system to detect the new partition configuration.</note>
731 </body>
732 </section>
733 <section>
734 <title>Creating filesystems</title>
735 <body>
736 <p>Now that the partitions have been created, it's time to set up filesystems on
737 the boot and root partitions so that they can be mounted and used to store data.
738 We will also configure the swap partition to serve as swap storage.
739 </p>
741 <p>Gentoo Linux supports a variety of different types of filesystems; each type has
742 its strengths and weaknesses and its own set of performance characteristics. Currently,
743 we support the creation of ext2, ext3, XFS, JFS and ReiserFS filesystems.</p>
745 <p>ext2 is the tried and true Linux filesystem but doesn't have metadata
746 journaling, which means that routine ext2 filesystem checks at startup time can
747 be quite time-consuming. There is now quite a selection of newer-generation
748 <i>journaled</i> filesystems that can be checked for consistency very quickly
749 and are thus generally preferred over their non-journaled counterparts.
750 Journaled filesystems prevent long delays when you boot your system and your
751 filesystem happens to be in an <i>inconsistent</i> state.</p>
753 <p>ext3 is the journaled version of the ext2 filesystem, providing metadata
754 journaling for fast recovery in addition to other enhanced journaling modes
755 like full data and ordered data journaling. ext3 is a very good and reliable
756 filesystem. It offers generally decent performance under most conditions.
757 Because it does not extensively employ the use of "trees" in its internal
758 design, it doesn't scale very well, meaning that it is not an ideal choice for
759 very large filesystems, or situations where you will be handling very large
760 files or large quantities of files in a single directory. But when used within
761 its design parameters, ext3 is an excellent filesystem.</p>
763 <p>ReiserFS is a B*-tree based filesystem that has very good overall
764 performance and greatly outperforms both ext2 and ext3 when dealing with small
765 files (files less than 4k), often by a factor of 10x-15x. ReiserFS also scales
766 extremely well and has metadata journaling. As of kernel 2.4.18+, ReiserFS is
767 now rock-solid and highly recommended for use both as a general-purpose
768 filesystem and for extreme cases such as the creation of large filesystems, the
769 use of many small files, very large files, and directories containing tens of
770 thousands of files. ReiserFS is the filesystem we recommend by default for all
771 non-boot partitions.</p>
773 <p>XFS is a filesystem with metadata journaling that is fully supported under
774 Gentoo Linux's <path>xfs-sources</path> kernel. It comes with a robust
775 feature-set and is optimized for scalability. We only recommend using this
776 filesystem on Linux systems with high-end SCSI and/or fibre channel storage and
777 a uninterruptible power supply. Because XFS aggressively caches in-transit data
778 in RAM, improperly designed programs (those that don't take proper precautions
779 when writing files to disk, and there are quite a few of them) can lose a good
780 deal of data if the system goes down unexpectedly.</p>
782 <p>JFS is IBM's own high performance journaling filesystem. It has recently
783 become production-ready, and there hasn't been a sufficient track record to
784 comment either positively nor negatively on its general stability at this
785 point.</p>
787 <p>If you're looking for the most rugged journaling filesystem, use ext3. If
788 you're looking for a good general-purpose high-performance filesystem with
789 journaling support, use ReiserFS; both ext3 and ReiserFS are mature,
790 refined and recommended for general use.</p>
792 <!-- Corner case, confusing
793 <p>But before creating filesystems, you may want to initialize the
794 beginning of your partition using <c>dd</c> if you are using a pre-existing partition that has been used before.
795 This is particularly helpful when you're going to create a new XFS filesystem on a partition that previously contained
796 a ReiserFS filesystem. Doing this will ensure that your new filesystem
797 will not be mis-identified by Linux's filesystem auto-detection code.
798 This can be done as follows:
799 </p>
800 <pre caption="Initializing first 1024 bytes of your partition">
801 # <c>dd if=/dev/zero of=/dev/hda3 bs=1k count=1</c>
802 <comment>(Replace /dev/hda3 with the partition you wish to &quot;clean.&quot;)</comment>
803 </pre>
804 <warn>The command above will destroy all data from <path>/dev/hda3</path>.
805 Be careful and check twice which partition you specify for zeroing.
806 If you make a mistake it might result in a loss of data.
807 </warn>
808 -->
810 <p>Based on our example above, we will use the following commands to initialize
811 all our partitions for use:</p>
813 <pre caption="Initializing our partitions (example)">
814 # mke2fs -j /dev/hda1
815 # mkswap /dev/hda2
816 # mkreiserfs /dev/hda3
817 </pre>
819 <p>We choose ext3 for our <c>/dev/hda1</c> boot partition because it is a robust journaling
820 filesystem supported by all major boot loaders. We used <c>mkswap</c> for our <c>/dev/hda2
821 </c> swap partition -- the choice is obvious here. And for our main root filesystem on
822 <c>/dev/hda3</c> we choose ReiserFS, since it is a solid journaling filesystem offering excellent
823 performance. Now, go ahead and initialize your partitions. Here are the various commands
824 available to create various filesystem types:</p>
826 <p><c>mkswap</c> is the command that is used to initialize swap partitions:</p>
827 <pre caption="Initializing Swap">
828 # <c>mkswap /dev/hda2</c>
829 </pre>
830 <p>You can use the <c>mke2fs</c> command to create ext2 filesystems:</p>
831 <pre caption="Creating an ext2 Filesystem">
832 # <i>mke2fs /dev/hda1</i>
833 </pre>
834 <p>If you would like to use ext3, you can create ext3 filesystems using
835 <c>mke2fs -j</c>:</p>
836 <pre caption="Creating an ext3 Filesystem">
837 # <c>mke2fs -j /dev/hda3</c>
838 </pre>
839 <note>You can find out more about using ext3 under Linux 2.4 at
840 <uri>http://www.zip.com.au/~akpm/linux/ext3/ext3-usage.html</uri>.</note>
841 <p>To create ReiserFS filesystems, use the <c>mkreiserfs</c> command:</p>
842 <pre caption="Creating a ReiserFS Filesystem">
843 # <c>mkreiserfs /dev/hda3</c>
844 </pre>
845 <p>To create an XFS filesystem, use the <c>mkfs.xfs</c> command:</p>
846 <pre caption="Creating a XFS Filesystem">
847 # <c>mkfs.xfs /dev/hda3</c>
848 </pre>
849 <note>You may want to add a couple of additional flags to the
850 <c>mkfs.xfs</c> command: <c>-d agcount=3 -l size=32m</c>.
851 The <c>-d agcount=3</c> command will lower the number of allocation groups.
852 XFS will insist on using at least 1 allocation group per 4 GB of your
853 partition, so, for example, if you have a 20 GB partition you will need
854 a minimum agcount of 5. The <c>-l size=32m</c> command increases the
855 journal size to 32 Mb, increasing performance.</note>
857 <p>To create JFS filesystems, use the <c>mkfs.jfs</c> command:</p>
858 <pre caption="Creating a JFS Filesystem">
859 # <c>mkfs.jfs /dev/hda3</c>
860 </pre>
861 </body>
862 </section>
863 </chapter>
864 <chapter>
865 <title>Mount Partitions</title>
866 <section>
867 <body>
868 <p>Now, we will activate our newly-initialized swap volume, since we may need the additional virtual memory that it
869 provides later:
870 </p>
871 <pre caption="Activating Swap">
872 # <c>swapon /dev/hda2</c>
873 </pre>
875 <p>Next, we will create the <path>/mnt/gentoo</path> and <path>/mnt/gentoo/boot</path> mount points,
876 and we will mount our filesystems to these mount points. Once our boot and root filesystems are
877 mounted, any files we copy or create inside <path>/mnt/gentoo</path> will be placed on our new filesystems.
878 Note that if you are setting up Gentoo
879 Linux with separate <path>/usr</path> or <path>/var</path> filesystems, these would get mounted to
880 <path>/mnt/gentoo/usr</path> and <path>/mnt/gentoo/var</path> respectively.
881 </p>
883 <impo>If your <e>boot</e> partition (the one holding the kernel) is ReiserFS, be sure to mount it
884 with the <c>-o notail</c> option so GRUB gets properly installed. Make sure
885 that <c>notail</c> ends up in your new <path>/etc/fstab</path> boot partition entry, too.
886 We will get to that in a bit.
887 </impo>
889 <pre caption="Creating Mount Points">
890 # <c>mkdir /mnt/gentoo</c>
891 # <c>mount /dev/hda3 /mnt/gentoo</c>
892 # <c>mkdir /mnt/gentoo/boot</c>
893 # <c>mount /dev/hda1 /mnt/gentoo/boot</c>
894 </pre>
896 <impo>If you are having problems mounting your boot partition with ext2, try using
897 <c>mount /dev/hXX /mnt/gentoo/boot -t ext2 </c> </impo>
898 </body>
899 </section>
900 </chapter>
901 <chapter>
902 <title>Stage tarballs and chroot</title>
903 <section>
904 <title>Selecting the desired stage tarball</title>
905 <body>
907 <p>
908 Now, you need to decide which one you would like to use as a
909 basis for the install if you haven't already.</p>
911 <p>If you are using the &quot;from scratch, build everything&quot; install
912 method, you will want to use the <path>stage1-x86-1.4_rc3.tar.bz2</path> image.
913 If you're using one of our bigger CDs like the "3stages" ISO, you will also
914 have a choice of a stage2 and stage3 image. These images allow you to save
915 time at the expense of configurability (we've already chosen compiler
916 optimizations and default USE variables for you.) The stages on the CD are
917 accessible at <path>/mnt/cdrom/gentoo</path>, and you can type <c>ls /mnt/cdrom/gentoo</c>
918 to see what's available on your CD.</p>
920 <p>If you would like to perform an install using a stage tarball that is
921 <i>not</i> on your CD , this is still possible, but you'll need to download the
922 stage you want using the following instructions. If you already have the stage
923 tarball you want to use (most users), then proceed to the "Extracting the stage
924 tarball" section.</p>
926 <pre caption="Downloading Required Stages">
927 # <c>cd /mnt/gentoo</c>
928 <comment>Use lynx to get the URL for your tarball:</comment>
929 # <c>lynx http://www.ibiblio.org/pub/Linux/distributions/gentoo/releases/1.4_rc3/x86/</c>
930 <comment>Use <c>Up</c> and <c>Down</c> arrows keys (or the <c>TAB</c> key) to go to the right directory
931 Highlight the appropriate stage you want to download
932 Press <c>d</c> which will initiate the download
933 Save the file and quit the browser
935 <b>OR</b> use wget from the command line:</comment>
936 # <c>wget <comment>insert URL to the required stage tarball here.</comment></c>
937 </pre>
938 </body>
939 </section>
940 <section>
941 <title>Extracting the stage tarball</title>
942 <body>
944 <p>Now it is time to extract the compressed stage tarball of your choice to
945 <path>/mnt/gentoo/</path>. Remember, you only need to unpack <b>one</b> stage
946 tarball, either a stage1, stage2 or stage3. So, if you wanted to perform a
947 stage3 install of Gentoo, then you would just unpack the stage3 tarball.
948 Unpack the stage tarball as follows:</p>
950 <impo>Be sure to use the <c>p</c> option with <c>tar</c>. Forgetting to do this will
951 cause certain files to have incorrect permissions.</impo>
953 <pre caption="Unpacking the Stages">
954 # <c>cd /mnt/gentoo</c>
955 <comment>Change "stage3" to "stage2" or "stage1" if you want to start from these stages instead.</comment>
956 <comment>If you downloaded your stage tarball, change the path below to begin with "/mnt/gentoo/"
957 instead of "/mnt/cdrom/gentoo/".</comment>
958 # <c>tar -xvjpf /mnt/cdrom/gentoo/stage3-*.tar.bz2</c>
959 </pre>
961 <p>If you downloaded your stage tarball to <path>/mnt/gentoo</path>, you can now delete it by typing
962 <c>rm /mnt/gentoo/stage*.tar.bz2</c>.</p>
963 </body>
964 </section>
965 <section>
966 <title>Entering the chroot</title>
967 <body>
968 <p>
969 Next, we will <c>chroot</c> over to the new Gentoo Linux build installation to &quot;enter&quot; the new
970 Gentoo Linux system.
971 </p>
973 <pre caption="Prepping and entering the chroot environment">
974 # <c>mount -t proc proc /mnt/gentoo/proc</c>
975 # <c>cp /etc/resolv.conf /mnt/gentoo/etc/resolv.conf</c>
976 # <c>chroot /mnt/gentoo /bin/bash</c>
977 # <c>env-update</c>
978 Regenerating /etc/ld.so.cache...
979 # <c>source /etc/profile</c>
980 <comment>(The above points your shell to the new paths and updated binaries.)</comment>
981 </pre>
982 <p>After you execute these commands, you will be &quot;inside&quot; your new Gentoo Linux environment in <path>/mnt/gentoo</path>.
983 We can perform the rest of the installation process inside the chroot.
984 </p>
985 </body>
986 </section>
987 </chapter>
988 <chapter>
989 <title>Getting the Current Portage Tree using sync</title>
990 <section>
991 <body>
993 <p>Now, you will need to run <c>emerge sync</c>. This command tells Portage to download
994 the most recent copy of the Gentoo Linux Portage tree.
995 The Portage tree
996 contains all the scripts (called ebuilds) used to build every package
997 under Gentoo Linux. Currently, we have ebuild scripts for close to 4000 packages. Once <c>emerge sync</c>
998 completes, you will have a complete Portage tree in <path>/usr/portage</path>.</p>
1000 <pre caption="Updating Using sync">
1001 # <c>emerge sync</c>
1002 </pre>
1004 </body>
1005 </section>
1006 </chapter>
1007 <chapter>
1008 <title>Setting Gentoo optimizations (make.conf)</title>
1009 <section>
1010 <body>
1012 <p>Now that you have a working copy of the Portage tree, it is time to
1013 customize the optimization and optional build-time settings to use on your
1014 Gentoo Linux system. Portage will use these settings when compiling any
1015 programs for you. To do this, edit the file <path>/etc/make.conf</path>. In
1016 this file, you should set your <c>USE</c> flags, which specify optional
1017 functionality that you would like to be built into packages if available;
1018 generally, the defaults (an <e>empty</e> or unset <c>USE</c> variable) are
1019 fine. More information on <c>USE</c> flags can be found <uri
1020 link="http://www.gentoo.org/doc/en/use-howto.xml">here</uri>. A complete list
1021 of current USE flags can be found <uri
1022 link="http://www.gentoo.org/dyn/use-index.xml">here</uri>. </p>
1024 <p>You also should set appropriate <c>CHOST</c>, <c>CFLAGS</c> and
1025 <c>CXXFLAGS</c> settings for the kind of system that you are creating
1026 (commented examples can be found further down in the file.) These settings
1027 will be used to tell the C and C++ compiler how to optimize the code that
1028 is generated on your system. It is common for users with Athlon XP processors
1029 to specify a "-march=athlon-xp" setting in their CFLAGS and CXXFLAGS settings
1030 so that all packages built will be optimized for the instruction set and
1031 performance characteristics of their CPU, for example. The <path>/etc/make.conf</path>
1032 file contains a general guide for the proper settings of CFLAGS and CXXFLAGS.</p>
1034 <p>If necessary, you can also set proxy information here if you are behind a
1035 firewall. Use the following command to edit <path>/etc/make.conf</path> using <c>nano</c>,
1036 a simple visual editor.
1037 </p>
1038 <pre caption="Setting make.conf Options">
1039 # <c>nano -w /etc/make.conf</c>
1040 <comment>(Edit CHOST, CFLAGS, CXXFLAGS and any necessary USE or proxy settings)</comment>
1041 </pre>
1042 <note>
1043 People who need to substantially customize the build process should take a look at
1044 the <path>/etc/make.globals</path> file. This file comprises gentoo defaults and
1045 should never be touched. If the defaults do not suffice, then new values should
1046 be put in <path>/etc/make.conf</path>, as entries in <path>make.conf</path>
1047 <comment>override</comment> the entries in <path>make.globals</path>. If you're
1048 interested in customizing USE settings, look in <path>/etc/make.profile/make.defaults</path>.
1049 If you want to turn off any USE settings found here, add an appropriate <c>USE=&quot;-foo&quot;</c>
1050 in <path>/etc/make.conf</path> to turn off any <c>foo</c> USE setting enabled by default
1051 in <path>/etc/make.globals</path> or <path>/etc/make.profile/make.defaults</path>.
1052 </note>
1053 </body>
1054 </section>
1055 </chapter>
1056 <chapter>
1057 <title>Starting from Stage1</title>
1058 <section>
1059 <body>
1060 <note>If you are not starting from a stage1 tarball, skip this section.</note>
1061 <p>The stage1 tarball is for complete customization and optimization. If you have picked this tarball,
1062 you are most likely looking to have an uber-optimized and up-to-date system. Have fun, because optimization
1063 is what Gentoo Linux is all about! Installing from a stage1 takes a lot of time, but the result
1064 is a system that has been optimized from the ground up for your specific machine and needs.
1065 </p>
1066 <p>Now, it is time to start the &quot;bootstrap&quot; process. This process takes about two hours on
1067 my 1200Mhz AMD Athlon system.
1068 During this time, the GNU C library, compiler suite and other key system programs will be built. Start the bootstrap
1069 as follows:</p>
1070 <pre caption="Bootstrapping">
1071 # <c>cd /usr/portage</c>
1072 # <c>scripts/bootstrap.sh</c>
1073 </pre>
1074 <p>The &quot;bootstrap&quot; process will now begin.
1075 </p>
1076 <note>
1077 Portage by default uses <c>/var/tmp</c> during package building, often
1078 using several hundred megabytes of temporary storage. If you would like to
1079 change where Portage stores these temporary files, set a new PORTAGE_TMPDIR <e>before</e>
1080 starting the bootstrap process, as follows:
1081 </note>
1082 <pre caption="Changing Portage's Storage Path">
1083 # <c>export PORTAGE_TMPDIR=&quot;/otherdir/tmp&quot;</c>
1084 </pre>
1085 <p><c>bootstrap.sh</c> will build <c>binutils</c>, <c>gcc</c>, <c>gettext</c>,
1086 and <c>glibc</c>, rebuilding <c>binutils</c>, <c>gcc</c>, and <c>gettext</c>
1087 after <c>glibc</c>. Needless to say, this process takes a while.
1088 Once this process completes, your system will be equivalent to a &quot;stage2&quot; system,
1089 which means you can now move on to the stage2 instructions.
1090 </p>
1091 </body>
1092 </section>
1093 </chapter>
1094 <chapter>
1095 <title>Starting from Stage2 and continuing Stage1</title>
1096 <section>
1097 <body>
1099 <note>This section is for those continuing a stage1 install or starting at stage2. If
1100 this is not you (ie. you're using a stage3,) then skip this section.
1101 </note>
1103 <p>The stage2 tarball already has the bootstrapping done for you. All that you have
1104 to do is install the rest of the system.
1105 </p>
1106 <pre caption="Installing the Rest of the System">
1107 # <c>emerge -p system</c>
1108 <comment>(lists the packages to be installed)</comment>
1109 # <c>emerge system</c>
1110 </pre>
1111 <p>It is going to take a while
1112 to finish building the entire base system. Your reward is that it will be
1113 thoroughly optimized for your system. The drawback is that you have to find a
1114 way to keep yourself occupied for some time to come. The author suggests &quot;Star
1115 Wars - Super Bombad Racing&quot; for the PS2.
1116 </p>
1117 <p>When this process completes, your system will be the equivalent of a stage3 system. You have
1118 a couple of choices on how to continue
1119 at this point. You can move onto the stage3 instructions and complete those. Doing that will
1120 get your system right up to date with what is in the current Portage tree. This is not necessary,
1121 but it is highly recommended.
1122 </p>
1123 </body>
1124 </section>
1125 </chapter>
1126 <chapter>
1127 <title>Starting from Stage3</title>
1128 <section>
1129 <body>
1130 <note>This section is for those <b>starting</b> with stage3, and not for those who have started
1131 with stage1 or stage2 who should skip this section.</note>
1132 <p>The stage3 tarball provides a fully-functional basic Gentoo system, so no building is required.
1133 However, since the stage3 tarball is pre-built, it may be slightly out-of-date. If this is a concern
1134 for you, you can update your stage3 to contain the most up-to-date versions of all system packages
1135 by performing the following steps. Note that this could take a long time if your stage3 is very old;
1136 otherwise, this process will generally be quick and will allow you to benefit from the very latest
1137 Gentoo updates and fixes.
1138 In any case, feel free to skip these
1139 steps and proceed to the next section if you like.
1140 </p>
1142 <pre caption="Getting up-to-date">
1143 # <c>export CONFIG_PROTECT="-*"</c>
1144 # <c>emerge -up system</c>
1145 <comment>(lists the packages that would be installed)</comment>
1146 # <c>emerge -u system</c>
1147 <comment>(actually merges the packages)</comment>
1148 # <c>unset CONFIG_PROTECT</c>
1149 </pre>
1150 </body>
1151 </section>
1152 </chapter>
1153 <chapter>
1154 <title>Setting your time zone</title>
1155 <section>
1156 <body>
1157 <p>Now you need to set your time zone.</p>
1158 <p>Look for your time zone (or GMT if you are using Greenwich Mean Time)
1159 in <path>/usr/share/zoneinfo</path>. Then, make a symbolic link to
1160 /etc/localtime by typing:</p>
1161 <pre caption="Creating a symbolic link for time zone">
1162 # <c>ln -sf /usr/share/zoneinfo/path/to/timezonefile /etc/localtime</c>
1163 </pre>
1164 </body>
1165 </section>
1166 </chapter>
1167 <chapter>
1168 <title>Installing the kernel and a System Logger</title>
1169 <section>
1170 <body>
1171 <note>
1172 If you haven't done so, please edit <path>/etc/make.conf</path> to your flavor.
1173 </note>
1174 <p>You now need to merge Linux kernel sources. Here are the ones we currently
1175 offer:
1176 </p>
1177 <table>
1178 <tr>
1179 <th>ebuild</th>
1180 <th>description</th>
1181 </tr>
1182 <tr>
1183 <ti>
1184 <path>gentoo-sources</path>
1185 </ti>
1186 <ti>Our own performance and functionality-enhanced kernel does not include XFS support.</ti>
1187 </tr>
1188 <tr>
1189 <ti>
1190 <path>xfs-sources</path>
1191 </ti>
1192 <ti>Highly-compatible kernel with XFS support.</ti>
1193 </tr>
1194 <tr>
1195 <ti>
1196 <path>openmosix-sources</path>
1197 </ti>
1198 <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>
1199 </tr>
1200 <tr>
1201 <ti>
1202 <path>usermode-sources</path>
1203 </ti>
1204 <ti>A stock Linux kernel source tree patched with support for User-Mode Linux. (&quot;Linux inside Linux&quot; technology)</ti>
1205 </tr>
1206 <tr>
1207 <ti>
1208 <path>vanilla-sources</path>
1209 </ti>
1210 <ti>A stock Linux kernel source tree, just like you would get from kernel.org</ti>
1211 </tr>
1212 </table>
1213 <warn>
1214 If you are configuring your own kernel, be careful with the <i>grsecurity</i> option. Being too aggressive with your
1215 security settings can cause certain programs (such as X) to not run properly. If in doubt, leave it out.
1216 </warn>
1217 <p>Choose a kernel and then merge as follows:</p>
1218 <pre caption="Emerging Kernel Sources">
1219 # <c>emerge sys-kernel/gentoo-sources</c>
1220 </pre>
1221 <p>Once you have a Linux kernel source tree available, it is time to compile your own custom kernel.
1222 </p>
1223 <p>Please note that <path>/usr/src/linux</path> is a symlink to your current emerged kernel source package,
1224 and is set automatically by Portage at emerge time.
1225 If you have multiple kernel source packages, it is necessary to set the <path>/usr/src/linux</path> symlink
1226 to the correct one before proceeding.
1227 </p>
1228 <pre caption="Compiling the Linux Kernel">
1229 # <c>cd /usr/src/linux</c>
1230 # <c>make menuconfig</c>
1231 # <c>make dep &amp;&amp; make clean bzImage modules modules_install</c>
1232 # <c>cp /usr/src/linux/arch/i386/boot/bzImage /boot</c>
1233 </pre>
1234 <warn>For your kernel to function properly, there are several options that you will
1235 need to ensure are in the kernel proper -- that is, they should <i>be enabled and not
1236 compiled as modules</i>. Be sure to enable &quot;ReiserFS&quot; if you have
1237 any ReiserFS partitions; the same goes for &quot;Ext3&quot;. If you're using XFS, enable the
1238 &quot;SGI XFS filesystem support&quot; option. It's always a good idea to leave ext2
1239 enabled whether you are using it or not. Below are some common options that you will need:</warn>
1240 <pre caption="make menuconfig options">
1241 Code maturity level options ---&gt;
1242 [*] Prompt for development and/or incomplete code/drivers&quot;
1243 <comment>(You need this to enable some of the options below.)</comment>
1244 ...
1246 File systems ---&gt;
1247 &lt;*&gt; Reiserfs support
1248 <comment>(Only needed if you are using reiserfs.)</comment>
1249 ...
1250 &lt;*&gt; Ext3 journalling file system support
1251 <comment>(Only needed if you are using ext3.)</comment>
1252 ...
1253 [*] Virtual memory file system support (former shm fs)
1254 <comment>(Required for Gentoo Linux.)</comment>
1255 ...
1256 &lt;*&gt; JFS filesystem support
1257 <comment>(Only needed if you are using JFS.)</comment>
1258 ...
1259 [*] /proc file system support
1260 <comment>(Required for Gentoo Linux.)</comment>
1261 [*] /dev file system support (EXPERIMENTAL)
1262 [*] Automatically mount at boot
1263 <comment>(Required for Gentoo Linux.)</comment>
1264 [ ] /dev/pts file system for Unix98 PTYs
1265 <comment>(Uncheck this, it is NOT needed.)</comment>
1266 ...
1267 &lt;*&gt; Second extended fs support
1268 <comment>(Only needed if you are using ext2.)</comment>
1269 ...
1270 &lt;*&gt; XFS filesystem support
1271 <comment>(Only needed if you are using XFS.)</comment>
1272 </pre>
1273 <p>If you are using hardware RAID you will need to enable a couple more options in the kernel:
1274 For Highpoint RAID controllers select hpt366 chipset support, support for IDE RAID controllers and Highpoint
1275 370 software RAID.For Promise RAID controllers select PROMISE PDC202{46|62|65|67|68|69|70} support,
1276 support for IDE RAID
1277 controllers and Support Promise software RAID (Fasttrak(tm))
1278 </p>
1279 <p>If you use PPPoE to connect to Internet, you will need the following
1280 options in the kernel (built-in or as preferably as modules) :
1281 &quot;PPP (point-to-point protocol) support&quot;, &quot;PPP support for async serial ports&quot;,
1282 &quot;PPP support for sync tty ports&quot;. The two compression options won't harm but
1283 are not definitely needed, neither does the &quot;PPP over Ethernet&quot; option,
1284 that might only be used by <i>rp-pppoe</i> when configured to do kernel mode PPPoE.
1285 </p>
1286 <p>If you have an IDE cd burner, then you need to enable SCSI emulation in the
1287 kernel. Turn on &quot;ATA/IDE/MFM/RLL support&quot; ---&gt; &quot;IDE, ATA and ATAPI Block
1288 devices&quot; ---&gt; &quot;SCSI emulation support&quot; (I usually make it a module), then
1289 under &quot;SCSI support&quot; enable &quot;SCSI support&quot;, &quot;SCSI CD-ROM support&quot; and
1290 &quot;SCSI generic support&quot; (again, I usually compile them as modules). If you
1291 also choose to use modules, then <c>echo -e &quot;ide-scsi\nsg\nsr_mod&quot;
1292 &gt;&gt; /etc/modules.autoload</c> to have them automatically added at boot time.
1293 </p>
1294 <note>
1295 For those who prefer it,
1296 it is now possible to install Gentoo Linux with a 2.2 kernel.
1297 However, doing this comes at a price:
1298 you will lose many of the nifty features that
1299 are new to the 2.4 series kernels (such as XFS and tmpfs
1300 filesystems, iptables, and more), although the 2.2 kernel sources can be
1301 patched with ReiserFS and devfs support.
1302 Gentoo linux boot scripts require either tmpfs or ramdisk support in the kernel, so
1303 2.2 kernel users need to make sure that ramdisk support is compiled in (ie, not a module).
1304 It is <comment>vital</comment> that a <e>gentoo=notmpfs</e> flag be added to the kernel
1305 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
1306 that a ramdisk is mounted for the boot scripts instead of tmpfs. If you choose not to use devfs, then
1307 <e>gentoo=notmpfs,nodevfs</e> should be used instead.
1308 </note>
1309 <p>Your new custom kernel (and modules) are now installed. Now you need to choose a system
1310 logger that you would like to install. We offer sysklogd, which is the traditional set
1311 of system logging daemons. We also have msyslog and syslog-ng as well as metalog. Power users seem
1312 to gravitate away from sysklogd (not very good performance) and towards the
1313 newer alternatives.
1314 If in doubt, you may want to try metalog, since it seems to be quite popular.
1315 To merge your logger of choice, type <e>one</e> of the next four lines:
1316 </p>
1317 <pre caption="Emerging System Logger of Choice">
1318 # <c>emerge app-admin/sysklogd</c>
1319 # <c>rc-update add sysklogd default</c>
1320 <comment>or</comment>
1321 # <c>emerge app-admin/syslog-ng</c>
1322 # <c>rc-update add syslog-ng default</c>
1323 <comment>or</comment>
1324 # <c>emerge app-admin/metalog</c>
1325 # <c>rc-update add metalog default</c>
1326 <comment>or</comment>
1327 # <c>emerge app-admin/msyslog</c>
1328 # <c>rc-update add msyslog default</c>
1329 </pre>
1330 <impo>
1331 Metalog flushes output to the disk in blocks, so messages aren't immediately recorded into
1332 the system logs. If you are trying to debug a daemon, this performance-enhancing behavior
1333 is less than helpful. When your Gentoo Linux system is up and running, you can send
1334 metalog a USR1 signal to temporarily turn off this message buffering (meaning that
1335 <i>tail -f <path>/var/log/everything/current</path></i> will now work
1336 in real time, as expected),
1337 and a USR2 signal to turn buffering back on
1338 again. If you want to disable buffering permanently, you can change METALOG_OPTS="-B" to METALOG_OPTS="-B -s"
1339 in <path>/etc/conf.d/metalog</path>.
1340 </impo>
1341 <p>Now, you may optionally choose a cron package that you would like to use.
1342 Right now, we offer dcron, fcron and vcron. If you do not know which one to choose,
1343 you might as well grab vcron. They can be installed as follows:
1344 </p>
1345 <pre caption="Choosing a CRON Daemon">
1346 # <c>emerge sys-apps/dcron</c>
1347 # <c>rc-update add dcron default</c>
1348 # <c>crontab /etc/crontab</c>
1349 <comment>or</comment>
1350 # <c>emerge sys-apps/fcron</c>
1351 # <c>rc-update add fcron default</c>
1352 # <c>crontab /etc/crontab</c>
1353 <comment>or</comment>
1354 # <c>emerge sys-apps/vcron</c>
1355 # <c>rc-update add vcron default</c>
1356 <comment>You do not need to run <c>crontab /etc/crontab</c> if using vcron.</comment>
1357 </pre>
1358 <p>For more information on starting programs and daemons at startup, see the
1359 <uri link="/doc/en/rc-scripts.xml">rc-script guide</uri>.
1360 </p>
1361 </body>
1362 </section>
1363 </chapter>
1364 <chapter>
1365 <title>Installing miscellany necessary packages</title>
1366 <section>
1367 <body>
1368 <p>If you need rp-pppoe to connect to the net, be aware that at this point
1369 it has not been installed. It would be the good time to do it. </p>
1370 <pre caption="Installing rp-pppoe">
1371 # <c>USE="-X" emerge rp-pppoe</c>
1372 </pre>
1374 <note>The <i>USE="-X"</i> prevents pppoe from installing its optional X interface, which is a good thing,
1375 because X and its dependencies would also be emerged. You can always recompile <i>rp-pppoe</i> with
1376 X support later.
1377 </note>
1378 <note> Please note that the rp-pppoe is built but not configured.
1379 You will have to do it again using <c>adsl-setup</c> when you boot into your Gentoo system
1380 for the first time.
1381 </note>
1382 <p>You may need to install some additional packages in the Portage tree
1383 if you are using any optional features like XFS, ReiserFS or LVM. If you're
1384 using XFS, you should emerge the <c>xfsprogs</c> package:
1385 </p>
1386 <pre caption="Emerging Filesystem Tools">
1387 # <c>emerge sys-apps/xfsprogs</c>
1388 <comment>If you would like to use ReiserFS, you should emerge the ReiserFS tools: </comment>
1389 # <c>emerge sys-apps/reiserfsprogs</c>
1390 <comment>If you would like to use JFS, you should emerge the JFS tools: </comment>
1391 # <c>emerge jfsutils</c>
1392 <comment>If you're using LVM, you should emerge the <c>lvm-user</c> package: </comment>
1393 # <c>emerge sys-apps/lvm-user</c>
1394 </pre>
1395 <p>If you're a laptop user and wish to use your PCMCIA slots on your first
1396 real reboot, you will want to make sure you install the <i>pcmcia-cs</i> package.
1397 </p>
1398 <pre caption="Emerging PCMCIA-cs">
1399 # <c>emerge sys-apps/pcmcia-cs</c>
1400 </pre>
1401 <warn>You will have to re-emerge <i>pcmcia-cs</i> after installation to get PCMCIA
1402 to work.
1403 </warn>
1404 </body>
1405 </section>
1406 </chapter>
1407 <chapter>
1408 <title>Modifying /etc/fstab for your machine</title>
1409 <section>
1410 <body>
1411 <p>Your Gentoo Linux system is almost ready for use. All we need to do now is configure
1412 a few important system files and install the boot loader.
1413 The first file we need to
1414 configure is <path>/etc/fstab</path>. Remember that you should use
1415 the <c>notail</c> option for your boot partition if you chose to create a ReiserFS filesystem on it.
1416 Remember to specify <c>ext2</c>, <c>ext3</c> or <c>reiserfs</c> filesystem types as appropriate.
1417 </p>
1418 <p>Use something like the <path>/etc/fstab</path> listed below, but of course be sure to replace &quot;BOOT&quot;,
1419 &quot;ROOT&quot; and &quot;SWAP&quot; with the actual block devices you are using (such as <c>hda1</c>, etc.)</p>
1420 <pre caption="Editing fstab">
1421 <comment># /etc/fstab: static file system information.
1422 #
1423 # noatime turns off atimes for increased performance (atimes normally aren't
1424 # needed; notail increases performance of ReiserFS (at the expense of storage
1425 # efficiency). It is safe to drop the noatime options if you want and to
1426 # switch between notail and tail freely.
1428 # &lt;fs&gt; &lt;mount point&gt; &lt;type&gt; &lt;opts&gt; &lt;dump/pass&gt;
1430 # NOTE: If your BOOT partition is ReiserFS, add the notail option to opts.
1431 </comment>
1432 /dev/BOOT /boot ext2 noauto,noatime 1 2
1433 /dev/ROOT / ext3 noatime 0 1
1434 /dev/SWAP none swap sw 0 0
1435 /dev/cdroms/cdrom0 /mnt/cdrom iso9660 noauto,ro 0 0
1436 proc /proc proc defaults 0 0
1437 </pre>
1438 <warn>Please notice that <i>/boot</i> is NOT mounted at boot time.
1439 This is to protect the data in <i>/boot</i> from
1440 corruption. If you need to access <i>/boot</i>, please mount it!
1441 </warn>
1442 </body>
1443 </section>
1444 </chapter>
1445 <chapter>
1446 <title>Setting the Root Password</title>
1447 <section>
1448 <body>
1449 <p>Before you forget, set the root password by typing: </p>
1450 <pre caption="Setting the root Password">
1451 # <c>passwd</c>
1452 </pre>
1454 <p>You will also want to add a non-root user for everyday use. Please consult
1455 the <uri link="http://www.gentoo.org/doc/en/faq.xml">Gentoo FAQ</uri>.
1456 </p>
1457 </body>
1458 </section>
1459 </chapter>
1460 <chapter>
1461 <title>Setting your Hostname</title>
1462 <section>
1463 <body>
1464 <p>Edit this file so that it contains your fully-qualified domain name on a single line,
1465 i.e. <c>mymachine.mydomain.com</c>.
1466 </p>
1467 <pre caption="Configuring Hostname">
1468 # <c>echo mymachine.mydomain.com &gt; /etc/hostname</c>
1469 </pre>
1470 </body>
1471 </section>
1472 </chapter>
1473 <chapter>
1474 <title>Modifying /etc/hosts</title>
1475 <section>
1476 <body>
1477 <p>This file contains a list of ip addresses and their associated hostnames.
1478 It is used by the system to resolve the IP addresses
1479 of any hostnames that may not be in your nameservers. Here is a template for this file:
1480 </p>
1481 <pre caption="Hosts Template">
1482 localhost
1483 <comment># the next line contains your IP for your local LAN, and your associated machine name</comment>
1484 mymachine.mydomain.com mymachine
1485 </pre>
1486 <note>If you are on a DHCP network, it might be helpful to set <i>localhost</i> to your machine's
1487 actual hostname. This will help GNOME and many other programs in name resolution.
1488 </note>
1489 </body>
1490 </section>
1491 </chapter>
1492 <chapter>
1493 <title>Final Network Configuration</title>
1494 <section>
1495 <body>
1496 <p>Add the names of any modules that are necessary for the proper functioning of your system to
1497 <path>/etc/modules.autoload</path> file (you can also add any options you
1498 need to the same line.) When Gentoo Linux boots, these modules will be automatically
1499 loaded. Of particular importance is your ethernet card module, if you happened to compile
1500 it as a module:
1501 </p>
1502 <pre caption="/etc/modules.autoload"><comment>This is assuming that you are using a 3com card.
1503 Check <path>/lib/modules/`uname -r`/kernel/drivers/net</path> for your card. </comment>
1504 3c59x
1505 </pre>
1506 <p>Edit the <path>/etc/conf.d/net</path> script to get your network configured for your
1507 first boot: </p>
1508 <pre caption="Boot time Network Configuration">
1509 # <c>nano -w /etc/conf.d/net</c>
1510 # <c>rc-update add net.eth0 default</c>
1511 </pre>
1512 <p>If you have multiple network cards you need to create additional <path>net.eth<comment>x</comment></path>
1513 scripts for each one (<comment>x</comment> = 1, 2, ...): </p>
1514 <pre caption="Multiple Network Interfaces">
1515 # <c>cd /etc/init.d</c>
1516 # <c>cp net.eth0 net.eth<comment>x</comment></c>
1517 # <c>rc-update add net.eth<comment>x</comment> default</c>
1518 </pre>
1519 <p>If you have a PCMCIA card installed, have a quick look into
1520 <path>/etc/init.d/pcmcia</path> to verify that things seem all right for your setup,
1521 then add this line to the top of <path>/etc/init.d/net.ethx</path>:
1522 </p>
1523 <pre caption="PCMCIA depend in /etc/init.d/net.ethx">
1524 depend() {
1525 need pcmcia
1526 }
1527 </pre>
1528 <p>This makes sure that the PCMCIA drivers are autoloaded whenever your network is loaded.
1529 </p>
1530 </body>
1531 </section>
1532 </chapter>
1533 <chapter>
1534 <title>Final steps: Configure Basic Settings (including the international keymap setting)</title>
1535 <section>
1536 <body>
1537 <pre caption="Basic Configuration">
1538 # <c>nano -w /etc/rc.conf</c>
1539 </pre>
1540 <p>Follow the directions in the file to configure the basic settings.
1541 All users will want to make sure that <c>CLOCK</c> is set to his/her
1542 liking. International keyboard users will want to set the <c>KEYMAP</c>
1543 variable (browse <path>/usr/share/keymaps</path> to see the various
1544 possibilities).
1545 </p>
1546 </body>
1547 </section>
1548 </chapter>
1549 <chapter>
1550 <title>Configure a Bootloader</title>
1551 <section>
1552 <title>Notes</title>
1553 <body>
1554 <p> In the spirit of Gentoo, users now have more than one bootloader to choose from.
1555 Using our virtual package system, users are now able to choose between both GRUB and
1556 LILO as their bootloaders.
1557 </p>
1558 <p> Please keep in mind that having both bootloaders installed is not necessary.
1559 In fact, it can be a hindrance, so please only choose one.
1560 </p>
1561 <impo>If you are installing Gentoo Linux on a system with an NVIDIA nForce or nForce2 chipset
1562 with an integrated GeForce graphics card, you should use LILO and avoid GRUB. With on-board
1563 video enabled, the low memory area of your RAM may be used as video RAM. Since GRUB also uses low
1564 memory at boot time, it may experience an "out of memory" condition. So, if you have an nForce
1565 or potentially other board with on-board video, use LILO. Even if you're using off-board video
1566 right now, it would be nice to be able to remove the graphics card and use the on-board video in a
1567 pinch, wouldn't it? :)</impo>
1569 </body>
1570 </section>
1571 <section>
1572 <title>Configuring GRUB</title>
1573 <body>
1574 <p>The most critical part of understanding GRUB is getting comfortable with how GRUB
1575 refers to hard drives and partitions. Your Linux partition <path>/dev/hda1</path> is called
1576 <path>(hd0,0)</path> under GRUB. Notice the parenthesis around the hd0,0 - they are required.
1577 Hard drives count from zero rather than &quot;a&quot;, and partitions start at zero rather than one.
1578 Be aware too that with the hd devices, only harddrives are counted, not atapi-ide devices such as
1579 cdrom players, burners, and that the same construct can be used with scsi drives.
1580 (Normally they get higher numbers than ide drives except when the bios is configured
1581 to boot from scsi devices.) Assuming you have a harddrive on /dev/hda, a cdrom player on /dev/hdb,
1582 a burner on /dev/hdc and a second hardrive on /dev/hdd, for example, and no scsi harddrive
1583 <path>/dev/hdd7</path> gets translated to <path>(hd1,6)</path>.
1585 It might sound tricky, and tricky it is indeed, but as we will see, grub
1586 offers a tab completion mechanism that comes handy for those of you having
1587 a lot of harddrives and partitions and who are a little lost in the
1588 grub numbering scheme. Having gotten the feel for that,
1589 it is time to install GRUB.
1590 </p>
1591 <p>The easiest way to install GRUB is to simply type <c>grub</c> at your chrooted shell prompt: </p>
1592 <pre caption="Installing GRUB">
1593 # <c>emerge grub</c>
1594 # <c>grub</c>
1595 </pre>
1596 <impo>If you are using hardware RAID this part will not work at
1597 this time.
1598 Skip to the section on making your <path>grub.conf</path>. After that we will complete the
1599 grub setup for RAID controllers
1600 </impo>
1601 <p>You will be presented with the <c>grub&gt;</c> grub
1602 command-line prompt. Now, you need to type in the
1603 right commands to install the GRUB boot record onto your hard drive. In my example configuration,
1604 I want to install the GRUB boot record on my hard drive's MBR (master boot record), so that
1605 the first thing I see when I turn on the computer is the GRUB prompt. In my case, the commands
1606 I want to type are:
1607 </p>
1609 <pre caption="GRUB on the MBR">
1610 grub&gt; <c>root (hd0,0)</c> <codenote>Your boot partition</codenote>
1611 grub&gt; <c>setup (hd0)</c> <codenote>Where the boot record is installed, here, it is the MBR</codenote>
1612 </pre>
1614 <pre caption="GRUB not on the MBR">
1615 <comment>Alternatively, if you wanted to install the bootloader somewhere other than the MBR</comment>
1616 grub&gt; <c>root (hd0,0)</c> <codenote>Your boot partition</codenote>
1617 grub&gt; <c>setup (hd0,4)</c> <codenote>Where the boot record is installed, here it is /dev/hda5</codenote>
1618 grub&gt; <c>quit</c>
1619 </pre>
1621 <p>Here is how the two commands work. The first <c>root ( )</c> command tells GRUB
1622 the location of your boot partition (in our example, <path>/dev/hda1</path> or
1623 <path>(hd0,0)</path> in GRUB terminology. Then, the second <c>setup ( )
1624 </c> command tells GRUB where to install the
1625 boot record - it will be configured to look for its special files at the <c>root
1626 ( )</c> location that you specified. In my case, I want the boot record on the
1627 MBR of the hard drive, so I simply specify <path>/dev/hda</path> (also known as <path>(hd0)</path>).
1628 If I were using another boot loader and wanted to set up GRUB as a secondary boot-loader, I
1629 could install GRUB to the boot record of a particular partition. In that case,
1630 I would specify a particular partition rather than the entire disk. Once the GRUB
1631 boot record has been successfully installed, you can type <c>quit</c> to quit GRUB.
1632 </p>
1634 <note> The tab completion mechanism of grub can be used from within grub,
1635 assuming you wrote <c> root (</c> and that you hit the TAB key, you would
1636 be prompted with a list of the available devices (not only harddrives),
1637 hitting the TAB key having written <c> root (hd</c>, grub would print the
1638 available harddrives and hitting the TAB key after writing <c> root (hd0,</c>
1639 would make grub print the list of partitions on the first harddrive.
1641 Checking the syntax of the grub location with completion should really help
1642 to make the right choice.
1643 </note>
1645 <p>
1646 Gentoo Linux is now
1647 installed, but we need to create the <path>/boot/grub/grub.conf</path> file so that
1648 we get a nice GRUB boot menu when the system reboots. Here is how to do it.
1649 </p>
1650 <impo>To ensure backwards compatibility with GRUB, make sure to make a link from
1651 <i>grub.conf</i> to <i>menu.lst</i>. You can do this by doing
1652 <c>ln -s /boot/grub/grub.conf /boot/grub/menu.lst </c>. </impo>
1653 <p>Now, create the grub.conf file (<c>nano -w /boot/grub/grub.conf</c>), and add the following to it:
1654 </p>
1655 <pre caption="Grub.conf for GRUB">
1656 default 0
1657 timeout 30
1658 splashimage=(hd0,0)/boot/grub/splash.xpm.gz
1660 title=My example Gentoo Linux
1661 root (hd0,0)
1662 kernel (hd0,0)/boot/bzImage root=/dev/hda3
1664 <comment># Below is for setup using hardware RAID</comment>
1665 title=My Gentoo Linux on RAID
1666 root (hd0,0)
1667 kernel (hd0,0)/boot/bzImage root=/dev/ataraid/dXpY
1669 <comment># Below needed only for people who dual-boot</comment>
1670 title=Windows XP
1671 root (hd0,5)
1672 chainloader (hd0,5)+1
1673 </pre>
1674 <note>
1675 (hd0,0) should be written without any spaces inside the parentheses.
1676 </note>
1677 <impo>
1678 If you set up scsi emulation for an IDE cd burner earlier, then to get it to
1679 actually work you need to add an &quot;hdx=ide-scsi&quot; fragment to the kernel
1680 line in grub.conf (where &quot;hdx&quot; should be the device for your cd burner).
1681 </impo>
1682 <p>After saving this file, Gentoo Linux installation is complete. Selecting the first option will
1683 tell GRUB to boot Gentoo Linux without a fuss. The second part of the grub.conf file is optional,
1684 and shows you how to use GRUB to boot a bootable Windows partition.
1685 </p>
1686 <note>Above, <path>(hd0,0)</path> should point to your &quot;boot&quot; partition
1687 (<path>/dev/hda1</path> in our example config) and <path>/dev/hda3</path> should point to
1688 your root filesystem. <path>(hd0,5)</path> contains the NT boot
1689 loader.
1690 </note>
1691 <note>
1692 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>.
1693 </note>
1694 <p>If you need to pass any additional options to the kernel, simply
1695 add them to the end of the <c>kernel</c> command. We're already passing one option
1696 (<c>root=/dev/hda3</c>), but you can pass others as well. In particular, you can
1697 turn off devfs by default (not recommended unless you know what you're doing) by
1698 adding the <c>gentoo=nodevfs</c> option to the <c>kernel</c> command.
1699 </p>
1700 <note>Unlike in earlier versions of Gentoo Linux, you no longer have to add
1701 <c>devfs=mount</c> to the end of the <c>kernel</c> line to enable devfs. In rc6
1702 devfs is enabled by default.
1703 </note>
1704 </body>
1705 </section>
1706 <section>
1707 <title>Configuring LILO</title>
1708 <body>
1709 <p>While GRUB may be the new alternative for most people, it is not always the best choice.
1710 LILO, the LInuxLOader, is the tried and true workhorse of Linux bootloaders. Here is how to install
1711 LILO if you would like to use it instead of GRUB:
1712 </p>
1713 <p>The first step is to emerge LILO:
1714 </p>
1715 <pre caption="Emerging LILO">
1716 # <c>emerge lilo</c>
1717 </pre>
1718 <p>Now it is time to configure LILO. Here is a sample configuration file <path>/etc/lilo.conf</path>
1719 </p>
1720 <pre caption="Example lilo.conf">
1721 boot=/dev/hda
1722 map=/boot/map
1723 install=/boot/boot.b
1724 prompt
1725 timeout=50
1726 lba32
1727 default=linux
1729 image=/boot/vmlinuz-2.4.20
1730 label=linux
1731 read-only
1732 root=/dev/hda3
1734 #For dual booting windows/other OS
1735 other=/dev/hda1
1736 label=dos
1737 </pre>
1738 <ul>
1739 <li><i>boot=/dev/hda</i> tells LILO to install itself on the first hard disk on the first IDE controller. </li>
1740 <li><i>map=/boot/map</i> states the map file. In normal use, this should not be modified. </li>
1741 <li><i>install=/boot/boot.b</i> tells LILO to install the specified file as the new boot sector.
1742 In normal use, this should not be altered. If the install line is missing, LILO will
1743 assume a default of /boot/boot.b as the file to be used. </li>
1744 <li>The existence of <i>prompt</i> tells LILO to display the classic <i>lilo:</i> prompt at bootup.
1745 While it is not recommended that you remove the prompt line, if you do remove it, you can still
1746 get a prompt by holding down the [Shift] key while your machine starts to boot. </li>
1747 <li><i>timeout=50</i> sets the amount of time that LILO will wait for user input before proceeding
1748 with booting the default line entry. This is measured in tenths of a second, with 50 as the default. </li>
1749 <li><i>lba32</i> describes the hard disk geometry to LILO. Another common entry here is linear. You should
1750 not change this line unless you are very aware of what you are doing. Otherwise, you could put
1751 your system in an unbootable state. </li>
1752 <li><i>default=linux</i> refers to the default operating system for LILO to boot from the
1753 options listed below this line. The name linux refers to the label line below in each of the boot options. </li>
1754 <li><i>image=/boot/vmlinuz-2.4.20</i> specifies the linux kernel to boot with this particular boot option. </li>
1755 <li><i>label=linux</i> names the operating system option in the LILO screen. In this case,
1756 it is also the name referred to by the default line. </li>
1757 <li><i>read-only</i> specifies that the root partition (see the root line below) is read-only and cannot be
1758 altered during the boot process. </li>
1759 <li><i>root=/dev/hda5</i> tells LILO what disk partition to use as the root partition. </li>
1760 </ul>
1761 <p>After you have edited your <i>lilo.conf</i> file, it is time to run LILO to load the information
1762 into the MBR:
1763 </p>
1764 <pre caption="Running LILO">
1765 # <c>/sbin/lilo</c>
1766 </pre>
1767 <p>LILO is configured, and now your machine is ready to boot into Gentoo Linux!
1768 </p>
1769 </body>
1770 </section>
1771 </chapter>
1772 <chapter>
1773 <title>Creating Bootdisks</title>
1774 <section>
1775 <title>GRUB Bootdisks</title>
1776 <body>
1777 <p>It is always a good idea to make a boot disk the first
1778 time you install any Linux distribution. This is a security
1779 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
1780 disk. With these types of hardware RAID,
1781 if you try to install grub from your chrooted shell it will fail. If you are in this camp,
1782 make a GRUB
1783 boot disk, and when you reboot the first time you can install GRUB
1784 to the MBR. Make your
1785 bootdisks like this:
1786 </p>
1787 <pre caption="Creating a GRUB Bootdisk">
1788 # <c>mke2fs /dev/fd0</c>
1789 # <c>mount /dev/fd0 /mnt/floppy</c>
1790 # <c>mkdir -p /mnt/floppy/boot/grub</c>
1791 # <c>cp /usr/share/grub/i386-pc/stage1 /mnt/floppy/boot/grub/</c>
1792 # <c>cp /usr/share/grub/i386-pc/stage2 /mnt/floppy/boot/grub/</c>
1793 # <c>umount /mnt/floppy</c>
1794 # <c>grub</c>
1796 grub&gt; <c>root (fd0)</c>
1797 grub&gt; <c>setup (fd0)</c>
1798 grub&gt; <c>quit</c>
1799 </pre>
1800 <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>
1801 and <c>setup</c> commands.</p>
1802 </body>
1803 </section>
1804 <section>
1805 <title>LILO Bootdisks</title>
1806 <body>
1807 <p>If you are using LILO, it is also a good idea to make a bootdisk:
1808 </p>
1809 <pre caption="Making a LILO Bootdisk">
1810 # <c>dd if=/boot/your_kernel of=/dev/fd0 </c>
1811 <comment>This will only work if your kernel is smaller than 1.4MB</comment>
1812 </pre>
1813 </body>
1814 </section>
1815 </chapter>
1816 <chapter>
1817 <title>Installation Complete!</title>
1818 <section>
1819 <body>
1820 <p>Now, Gentoo Linux is installed. The only remaining step is to update necessary configuration files, exit the chrooted shell,
1822 safely unmount your partitions
1823 and reboot the system:
1824 </p>
1825 <pre caption="Rebooting the System">
1826 # <c>etc-update</c>
1827 # <c>exit</c>
1828 <comment>(This exits the chrooted shell; you can also type <c>^D</c>)</comment>
1829 # <c>cd / </c>
1830 # <c>umount /mnt/gentoo/boot</c>
1831 # <c>umount /mnt/gentoo/proc</c>
1832 # <c>umount /mnt/gentoo</c>
1833 # <c>reboot</c>
1834 </pre>
1835 <note>
1836 After rebooting, it is a good idea to run the <c>update-modules</c> command to create
1837 the <path>/etc/modules.conf</path> file. Instead of modifying this file directly, you should
1838 generally make changes to the files in <path>/etc/modules.d</path>.
1839 </note>
1840 <impo>Remember if you are running hardware RAID, you must
1841 use the bootdisk for the first reboot.
1842 then go back and install grub the way everyone else did the first
1843 time. You are done -- congratulations!</impo>
1844 <p>If you have any questions or would like to get involved with Gentoo Linux development,
1845 consider joining our gentoo-user and gentoo-dev mailing lists
1846 (more information on our <uri link="http://www.gentoo.org/main/en/lists.xml">mailing lists</uri> page).
1847 We also have a handy <uri link="http://www.gentoo.org/doc/en/desktop.xml">Desktop configuration guide</uri>
1848 that will
1849 help you to continue configuring your new Gentoo Linux system, and a useful
1850 <uri link="http://www.gentoo.org/doc/en/portage-user.xml">Portage user guide</uri>
1851 to help familiarize you with Portage basics. You can find the rest of the Gentoo Documentation
1852 <uri link="http://www.gentoo.org/main/en/docs.xml">here</uri>. If you have any other questions
1853 involving installation or anything for that matter, please check the Gentoo Linux
1854 <uri link="http://www.gentoo.org/doc/en/faq.xml">FAQ</uri>.
1855 Enjoy and welcome to Gentoo Linux!
1856 </p>
1857 </body>
1858 </section>
1859 </chapter>
1860 <chapter>
1861 <title>Gentoo-Stats</title>
1862 <section>
1863 <body>
1864 <p>The Gentoo Linux usage statistics program was started as an attempt to give the developers
1865 a way to find out about their user base. It collects information about Gentoo Linux usage to help
1866 us in set priorities our development. Installing it is completely optional, and it would be greatly
1867 appreciated if you decide to use it. Compiled statistics can be viewed at <uri>http://stats.gentoo.org/</uri>.
1868 </p>
1869 <p>The gentoo-stats server will assign a unique ID to your system.
1870 This ID is used to make sure that each system is counted only once. The ID will not be used
1871 to individually identify your system, nor will it be mached against an IP address or
1872 other personal information. Every precaution has been taken to assure your privacy in the
1873 development of this system. The following are the things that we are monitoring
1874 right now through our &quot;gentoo-stats&quot; program:
1875 </p>
1876 <ul>
1877 <li>installed packages and their version numbers</li>
1878 <li>CPU information: speed (MHz), vendor name, model name, CPU flags (like &quot;mmx&quot; or &quot;3dnow&quot;)</li>
1879 <li>memory information (total available physical RAM, total available swap space)</li>
1880 <li>PCI cards and network controller chips</li>
1881 <li>the Gentoo Linux profile your machine is using (that is, where the /etc/make.profile link is pointing to).</li>
1882 </ul>
1883 <p>We are aware that disclosure of sensitive information is a threat to most Gentoo Linux users
1884 (just as it is to the developers).
1885 </p>
1886 <ul>
1887 <li>Unless you modify the gentoo-stats program, it will never transmit sensitive
1888 information such as your passwords, configuration data, shoe size...</li>
1889 <li>Transmission of your e-mail addresses is optional and turned off by default.</li>
1890 <li>The IP address your data transmission originates from will never be logged
1891 in such a way that we can identify you. There are no &quot;IP address/system ID&quot; pairs.</li>
1892 </ul>
1893 <p>The installation is easy - just run the following commands:
1894 </p>
1895 <pre caption="Installing gentoo-stats">
1896 # <c>emerge gentoo-stats</c> <codenote>Installs gentoo-stats</codenote>
1897 # <c>gentoo-stats --new</c> <codenote>Obtains a new system ID</codenote>
1898 </pre>
1899 <p>The second command above will request a new system ID and enter it into
1900 <path>/etc/gentoo-stats/gentoo-stats.conf</path> automatically. You can view this file
1901 to see additional configuration options.
1902 </p>
1903 <p>After that, the program should be run on a regular schedule
1904 (gentoo-stats does not have to be run as root). Add this line to your <path>crontab</path>:
1905 </p>
1906 <pre caption="Updating gentoo-stats with cron">
1907 <c>0 0 * * 0,4 /usr/sbin/gentoo-stats --update &gt; /dev/null</c>
1908 </pre>
1909 <p>The <c>gentoo-stats</c> program is a simple perl script which can be
1910 viewed with your favorite pager or editor: <path>/usr/sbin/gentoo-stats</path>. </p>
1911 </body>
1912 </section>
1913 </chapter>
1914 </guide>

  ViewVC Help
Powered by ViewVC 1.1.20