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

Parent Directory Parent Directory | Revision Log Revision Log

Revision 1.137 - (show annotations) (download) (as text)
Tue Jul 8 09:52:43 2003 UTC (15 years ago) by swift
Branch: MAIN
Changes since 1.136: +76 -45 lines
File MIME type: application/xml
Seperate ATA RAID information from the rest

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

  ViewVC Help
Powered by ViewVC 1.1.20