/[gentoo]/xml/htdocs/doc/en/gentoo-x86-install.xml
Gentoo

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

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1.142 - (show annotations) (download) (as text)
Tue Aug 5 08:50:17 2003 UTC (14 years, 3 months ago) by swift
Branch: MAIN
Changes since 1.141: +660 -262 lines
File MIME type: application/xml
#25802, upgrade installation guide to Gentoo Linux 1.4

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

  ViewVC Help
Powered by ViewVC 1.1.20