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

Parent Directory Parent Directory | Revision Log Revision Log

Revision 1.11 - (show annotations) (download) (as text)
Sat Nov 30 06:02:12 2002 UTC (16 years ago) by zhen
Branch: MAIN
Changes since 1.10: +1 -1 lines
File MIME type: application/xml
changes to pcmcia section, and made mention of the faq

1 <?xml version='1.0' encoding="UTF-8"?>
2 <?xml-stylesheet href="/xsl/guide.xsl" type="text/xsl"?>
3 <!DOCTYPE guide SYSTEM "/dtd/guide.dtd">
5 <guide link="/doc/en/gentoo-x86-install.xml">
6 <title>Gentoo Linux 1.4 Installation Instructions</title>
7 <author title="Chief Architect"><mail link="drobbins@gentoo.org">Daniel Robbins</mail></author>
8 <author title="Author">Chris Houser</author>
9 <author title="Author"><mail link="jerry@gentoo.org">Jerry Alexandratos</mail></author>
10 <author title="Ghost"><mail link="g2boojum@gentoo.org">Grant Goodyear</mail></author>
11 <author title="Editor"><mail link="zhen@gentoo.org">John P. Davis</mail></author>
12 <author title="Editor"><mail link="Pierre-Henri.Jondot@wanadoo.fr">Pierre-Henri Jondot</mail></author>
13 <author title="Editor"><mail link="stocke2@gentoo.org">Eric Stockbridge</mail></author>
14 <author title="Editor"><mail link="rajiv@gentoo.org">Rajiv Manglani</mail></author>
16 <abstract>These instructions step you through the process of installing Gentoo
17 Linux 1.4_rc1. The Gentoo Linux installation process supports various installation
18 approaches, depending upon how much of the system you want to custom-build from
19 scratch.
20 </abstract>
22 <version>2.1</version>
23 <date>20 November 2002</date>
25 <chapter>
26 <title>About the Install</title>
27 <section>
28 <body>
30 <p>This new boot CD will boot from nearly any modern IDE CD-ROM drive, as well
31 as many SCSI CD-ROM, assuming that your CD-ROM and BIOS both support booting.
32 Included on the CD-ROM is Linux support for IDE (and PCI IDE)
33 (built-in to the kernel) as well as support for all SCSI devices (available as
34 modules). In addition, we provide modules for literally every kind of network
35 card that Linux supports, as well as tools to allow you to configure your
36 network and establish outbound <c>ssh</c> connections and download files.
37 </p>
39 <p>To install from the build CD, you will need to have a 486+ processor and
40 ideally at least 64 Megabytes of RAM. (Gentoo linux has been successfully
41 built with 64MB of RAM + 64MB of swap space, but the build process is awfully
42 slow under those conditions.) To begin the install process, first grab the
43 livecd ISO images from
44 <uri>http://www.ibiblio.org/gentoo/releases/1.4_rc1/</uri>. The three stages make our life
45 easy with Gentoo. The stage1 is for building the entire system from scratch. Stage2 is for building
46 some of the system from scratch, and stage3 saves a lot of time because it is already
47 optimized for you specific system. At the moment only the stage1 tarball is
48 stored on the livecd, but you will be able to download a stage2 or
49 stage3 tarball optimized for your system after booting the livecd.
50 </p>
52 <p>Now, let's quickly review the install process. We'll create partitions,
53 create our filesystems, and extract either a stage1, stage2 or stage3 tarball.
54 If we are using a stage1 or stage2 tarball, we will take the appropriate steps
55 to get our systems to stage3. Once our systems are at stage3, we can configure
56 them (tweaking config files, installing a bootloader, etc) and boot them and
57 have a fully-functional Gentoo Linux system. Depending on what stage of the build
58 process you're starting from, here's what's required for installation:
59 </p>
61 <table>
62 <tr><th>stage tarball</th><th>requirements for installation</th></tr>
63 <tr><ti>1</ti><ti>partition/filesystem setup, emerge sync, bootstrap, emerge system, emerge linux sources, final configuration</ti></tr>
64 <tr><ti>2</ti><ti>partition/filesystem setup, emerge sync, emerge system, emerge linux sources, final configuration</ti></tr>
65 <tr><ti>3</ti><ti>partition/filesystem setup, emerge sync, final configuration</ti></tr>
66 </table>
68 </body>
69 </section>
70 </chapter>
72 <chapter>
73 <title>Booting</title>
74 <section>
75 <body>
77 <p>Start by booting the livecd. You'll be
78 greeted with a lot of text output
79 followed by the normal Gentoo Linux boot sequence.
80 Login as "root" (just hit &lt;enter&gt; for the password),
81 and then use the <c>passwd</c> command to change the root
82 password. (This root password is only for this installation session.
83 The reason for changing the password is that you will have to connect
84 to the net to complete the installation. Connecting to the internet with
85 the default root password is a <i>really</i> bad idea!)
86 You should have a root ("<c>#</c>") prompt on the current
87 console, and can also open new consoles by typing alt-f2, alt-f3, etc and then
88 hitting enter.
89 </p>
91 <p>Next, you will be greeted with instructions for setting up your network,
92 and optional PCI autodetection. The PCI autodetection process will automatically
93 load the appropriate kernel modules for many popular PCI SCSI and ethernet
94 devices. After this, you should have a root ("<c>#</c>") prompt on the current
95 console, and can also open new consoles by typing Alt-F2, Alt-F3, etc and then
96 hitting enter.
97 </p>
99 </body>
100 </section>
101 </chapter>
103 <chapter>
104 <title>Load Kernel Modules</title>
105 <section>
106 <body>
109 <p>Hopefully you need only type <c>pci-setup</c> at the root prompt to
110 autodetect the hardware on your system and to load the appropriate
111 kernel modules.
112 </p>
114 <p>If the PCI autodetection missed some of your hardware, you
115 will have to load the appropriate modules manually.
116 To view a list of all available network card modules, type <c>ls
117 /lib/modules/*/kernel/drivers/net/*</c>. To load a particular module,
118 type:
119 </p>
121 <pre caption = "PCI Modules Configuration">
122 # <c>modprobe pcnet32</c>
123 <comment>(replace pcnet32 with your NIC module)</comment>
124 </pre>
126 <p>Now, if you want to be able to access any SCSI hardware that wasn't detected
127 during the PCI autodetection process, you'll need to load the appropriate
128 modules from /lib/modules, again using <c>modprobe</c>:
129 </p>
131 <pre caption = "Loading SCSI Modules">
132 # <c>modprobe aic7xxx</c>
133 # <c>modprobe sd_mod</c>
134 </pre>
136 <p><c>aic7xxx</c> supports your SCSI controller and <c>sd_mod</c> supports SCSI hard disks.
137 <note>
138 Support for a SCSI CD-ROMs in build-in in the kernel.
139 </note>
140 </p>
142 <p>If you are using hardware RAID, you need to load the
143 ATA-RAID modules for your RAID controller.
144 </p>
146 <pre caption = "Loading RAID Modules">
147 # <c>insmod ataraid</c>
148 # <c>insmod pdcraid</c>
149 <comment>(Promise Raid Controller)</comment>
150 # <c>insmod hptraid</c>
151 <comment>(Highpoint Raid Controller)</comment>
152 </pre>
154 <p>The Gentoo LiveCD should have enabled DMA on your disks, but if it did not,
155 <c>hdparm</c> can be used to set DMA on your drives. </p>
157 <pre caption = "Setting DMA">
158 <comment>Replace hdX with your disk device. </comment>
159 # <c>hdparm -d 1 /dev/hdX </c>
160 <comment>Enables DMA </comment>
161 # <c>hdparm -X66 /dev/hdX </c>
162 <comment>Enables Ultra-DMA </comment>
163 </pre>
165 </body>
166 </section>
167 </chapter>
169 <chapter>
170 <title>Loading PCMCIA Kernel Modules</title>
171 <section>
172 <body>
174 <p>If you have a PCMCIA network card, you will need to do some additional
175 trickery.
176 </p>
178 <warn>To avoid problems with <c>cardmgr</c>, you <e>must</e> run it <e>before</e> you enter the chroot
179 portion of the install. </warn>
181 <pre caption = "Loading PCMCIA Modules">
182 # <i>insmod pcmcia_core</i>
183 # <i>insmod i82365</i>
184 # <i>insmod ds</i>
185 # <i>cardmgr -f</i>
186 </pre>
188 <p>As cardmgr detects which hardware is present, your speaker should emit a
189 few reassuring beeps, and your PCMCIA network card should hum to life. You can
190 of course insert the PCMCIA card after loading cardmgr too, if that's
191 preferable. (Technically, you need not run
192 <i>cardmgr</i> if you know exactly which module your PCMCIA card requires.
193 But if you don't, loading all PCMCIA modules and see which sticks won't work,
194 as all PCMCIA modules load obligingly and hang around for a PCMCIA card to
195 drop by. <i>cardmgr</i> will also unload the module(s) for any card when you
196 remove it). </p>
198 </body>
199 </section>
200 </chapter>
202 <chapter>
203 <title>Configuring Networking</title>
204 <section>
205 <title> PPPoE configuration</title>
206 <body>
208 <p>Assuming you need PPPoE to connect to the internet, the livecd (any version) has
209 made things easy for you by including <i>rp-pppoe</i>. Use the provided <i>adsl-setup </i>
210 script to configure your connection. You will be prompted for the ethernet
211 device that is connected to your adsl modem, your username and password,
212 the IPs of your DNS servers, and if you need a basic firewall or not. </p>
214 <pre caption = "Configuring PPPoE">
215 # <c> adsl-setup </c>
216 # <c> adsl-start </c>
217 </pre>
219 <p>If something goes wrong, double-check that you correctly typed
220 your username and password by looking at <path>/etc/ppp/pap-secrets</path> or
221 <path>/etc/ppp/chap-secrets</path>, and make sure you are using the right ethernet device. </p>
223 </body>
224 </section>
226 <section>
227 <title> Automatic Network Configuration </title>
228 <body>
230 <p>The Gentoo Linux install lets you configure a working network, allowing you to use
231 <c>ssh</c>, <c>scp</c> or <c>wget</c> as needed before even beginning the installation process.
232 Even if you don't need to do these things now, you should go ahead and set up networking now.
233 Once networking is up, Portage will be able to use your configured network once you are inside
234 the chroot environment (required for installing Gentoo Linux).
235 The simplest way to set up networking is to run our new <c>net-setup</c>
236 script. </p>
238 <pre caption = "Net-Setup Script">
239 # <c>net-setup eth0</c>
240 </pre>
242 <p>Of course, if you prefer, you may still set up networking manually. </p>
244 </body>
245 </section>
247 <section>
248 <title>Manual DHCP Configuration</title>
249 <body>
251 <p>Network configuration is simple with DHCP; If your ISP is not using
252 DHCP, skip down to the static configuration section below. </p>
254 <pre caption="Network configuration with DHCP">
255 # <c>dhcpcd eth0</c>
256 </pre>
258 <note>Some ISPs require you to provide a hostname. To do that,
259 add a <c>-h myhostname</c> flag to the dhcpcd command line above.
260 </note>
262 <p>If you receive <i>dhcpConfig</i> warnings, don't panic; the errors
263 are most likely cosmetic. Skip down to Network testing below.</p>
265 </body>
266 </section>
268 <section>
269 <title>Manual Static Configuration</title>
270 <body>
272 <p>We need to setup just enough networking so that we can download
273 sources for the system build, as well as the required localhost interface.
274 Type in the following commands, replacing
275 $IFACE with your network interface (typically <c>eth0</c>), $IPNUM
276 with your IP address, $BCAST with your broadcast address, and $NMASK
277 with your network mask. For the <c>route</c> command, replace
278 $GTWAY with your default gateway.
279 </p>
281 <pre caption = "Static IP Network Configuration">
282 # <c>ifconfig $IFACE $IPNUM broadcast $BCAST netmask $NMASK</c>
283 # <c>/sbin/route add -net default gw $GTWAY netmask metric 1</c>
284 </pre>
286 <p>Now it's time to create the <path>/etc/resolv.conf</path>
287 file so that name resolution (finding Web/FTP sites by name, rather than just by IP address) will work.</p>
289 <p>Here's a template to follow for creating your /etc/resolv.conf file: </p>
291 <pre caption="/etc/resolv.conf template">
292 domain mydomain.com
293 nameserver
294 nameserver
295 </pre>
297 <p>Replace <c></c> and <c></c> with the IP addresses of your
298 primary and secondary DNS servers respectively.</p>
299 </body>
300 </section>
302 <section>
303 <title>Proxy Configuration</title>
304 <body>
305 <p>If you are behind a proxy, it is necessary to configure your proxy before
306 you continue. We will export some variables to set up the proxy accordingly.
307 </p>
309 <pre caption = "Setting a Proxy">
310 # <c>export http_proxy="machine.company.com:1234" </c>
311 # <c>export ftp_proxy="$http_proxy" </c>
312 # <c>export RSYNC_PROXY="$http_proxy" </c>
313 </pre>
315 </body>
316 </section>
318 <section>
319 <title>Network Testing</title>
320 <body>
321 <p>Now that your network has been configured, the <c>/sbin/ifconfig -a</c> command should show
322 that your network card is working (look for <e>UP</e> and <e>RUNNING</e> in the output). </p>
324 <pre caption="/sbin/ifconfig for a working network card">
325 eth0 Link encap:Ethernet HWaddr 00:50:BA:8F:61:7A
326 inet addr: Bcast: Mask:
327 inet6 addr: fe80::50:ba8f:617a/10 Scope:Link
329 RX packets:1498792 errors:0 dropped:0 overruns:0 frame:0
330 TX packets:1284980 errors:0 dropped:0 overruns:0 carrier:0
331 collisions:1984 txqueuelen:100
332 RX bytes:485691215 (463.1 Mb) TX bytes:123951388 (118.2 Mb)
333 Interrupt:11
334 </pre>
336 <p>You may want to also try pinging Gentoo.org's website, just to make sure that your packets are
337 reaching the net, DNS name resolution is working correctly, etc.
338 </p>
340 <pre caption = "Further Network Testing">
341 # <c>ping www.gentoo.org </c>
342 </pre>
344 </body>
345 </section>
347 <section>
348 <title>Networking is go!</title>
349 <body>
350 <p>Networking should now be configured and useable. You should be able to use the included
351 <c>ssh</c>, <c>scp</c> and <c>wget</c> commands to connect to other machines on your LAN or the Internet.</p>
352 </body>
353 </section>
354 </chapter>
356 <chapter>
357 <title>Partition Configuration</title>
358 <section>
359 <body>
361 <p>Now that the kernel can see the network card and disk controllers, it's time
362 to set up disk partitions for Gentoo Linux.
363 </p>
365 <p>Here's a quick overview of the standard Gentoo Linux partition layout.
366 We're going to create at least three partitions: a swap partition, a root
367 partition (to hold the bulk of Gentoo Linux), and a special boot partition.
368 The boot partition is designed to hold the GRUB or LILO boot loader information as well as
369 your Linux kernel(s). The boot partition gives us a safe place to store
370 everything related to booting Linux. During normal day-to-day Gentoo Linux use,
371 your boot partition should remain <e>unmounted</e>. This prevents your kernel
372 from being made unavailable to GRUB (due to filesystem corruption) in the event
373 of a system crash, preventing the chicken-and-egg problem where GRUB can't read
374 your kernel (since your filesystem isn't consistent) but you can't bring your
375 filesystem back to a consistent state (since you can't boot!)
376 </p>
378 <p>Now, on to filesystem types. Right now, you have four filesystem options:
379 XFS, ext2, ext3 (journaling) and ReiserFS. ext2 is the tried and true Linux
380 filesystem but doesn't have metadata journaling. ext3 is the new version of
381 ext2 with both metadata journaling and ordered data writes, effectively
382 providing data journaling as well. ReiserFS is a B*-tree based filesystem
383 that has very good small file performance, and greatly outperforms both ext2 and
384 ext3 when dealing with small files (files less than 4k), often by a factor of
385 10x-15x. ReiserFS also scales extremely well and has metadata journaling.
386 As of kernel 2.4.18+, ReiserFS is finally rock-solid and highly recommended.
387 XFS is a filesystem with metadata journaling that
388 is fully supported under Gentoo Linux's <path>xfs-sources</path> kernel, but be warned that it
389 is highly unstable at this time.
390 </p>
392 <p>If you're looking for the most standard filesystem, use ext2. If you're looking
393 for the most rugged journalled filesystem, use ext3. If you're looking for a
394 high-performance filesystem with journaling support, use ReiserFS; both ext3 and ReiserFS are
395 mature and refined. Please be careful with XFS; this filesystem has a tendency to fry lots of data
396 if the system crashes or you lose power. Originally, it seemed like a promising filesystem but it
397 now appears that this tendency to lose data is a major achilles' heel.
398 Here are our basic recommended filesystem
399 sizes and types:
400 </p>
402 <table>
403 <tr>
404 <th>Partition</th>
405 <th>Size</th>
406 <th>Type</th>
407 <th>example device</th>
408 </tr>
409 <tr>
410 <ti>boot partition, containing kernel(s) and boot information</ti>
411 <ti>100 Megabytes</ti>
412 <ti>ext2/3 highly recommended (easiest); if ReiserFS then mount with <c>-o notail</c></ti>
413 <ti>/dev/hda1</ti>
414 </tr>
415 <tr>
416 <ti>swap partition (no longer a 128 Megabyte limit)</ti>
417 <ti>&gt;=2*Amount of RAM in this system is recommended but no longer (as of kernel 2.4.10) required</ti>
418 <ti>Linux swap</ti>
419 <ti>/dev/hda2</ti>
420 </tr>
421 <tr>
422 <ti>root partition, containing main filesystem (/usr, /home, etc)</ti>
423 <ti>&gt;=1.5 Gigabytes</ti>
424 <ti>ReiserFS, ext3 recommended; ext2 ok</ti>
425 <ti>/dev/hda3</ti>
426 </tr>
427 </table>
429 <p>Before creating your partitions, it is a <e>very</e> good idea to initialize the
430 beginning of your HD using <c>dd</c>. Doing this will ensure that you have no issues with
431 mounting previously <i>fat32</i> partitions, like <path>/boot</path>
432 for example. To do this you would do:
433 </p>
435 <pre caption = "Initializing first 1024 Sectors of HD">
436 # <c>dd if=/dev/zero of=/dev/hdaBOOT bs=1024 count=1024 </c>
437 <comment>BOOT is the partition that holds your <path>/boot</path>.</comment>
438 </pre>
440 <p>At this point, create your partitions using fdisk. Note that your partitions
441 should be of type 82 if swap and 83 for regular filesystems (whether ReiserFS <e>or</e> ext2/3). </p>
443 <note><i>cfdisk</i> is included on the install CD, and it is *considerably* easier to use than
444 <i>fdisk</i>. Just type <c>cfdisk</c> to run it. By default cfdisk work with <b>/dev/hda</b>. If /dev/hda is not hard disk you want to partition, give the right value to cfdisk as a parameter. For example: <c>cfdisk /dev/hde</c></note>
445 <note>Changes to the partitions don't reflect on-the-fly, so please reboot after using fdisk or cfdisk.</note>
447 <note>If you are using RAID your partitions will be a little
448 different.
449 You will have the partitions like this:
450 <path>/dev/ataraid/discX/partY</path>
451 X is the arrays you have made, so if you only have made 1
452 array, then it will
453 be disc0.Y is the partition number as in <path>/dev/hdaY</path>
454 </note>
457 <p>Once you've created your partitions, it's time to initialize
458 the filesystems that will be used to house our data. Initialize swap as follows:</p>
460 <pre caption= "Initializing Swap">
461 # <c>mkswap /dev/hda2</c>
462 </pre>
464 <p>You can use the <c>mke2fs</c> command to create ext2 filesystems.</p>
466 <pre caption = "Creating an ext2 Filesystem">
467 # <i>mke2fs /dev/hda1</i>
468 </pre>
470 <p>To create an XFS filesystem, use the <c>mkfs.xfs</c> command.</p>
472 <pre caption = "Creating a XFS Filesystem">
473 # <c>mkfs.xfs /dev/hda3</c>
474 </pre>
476 <note>
477 You may want to add a couple of additional flags to the <c>mkfs.xfs</c> command: <c>-d agcount=3 -l size=32m</c>.
478 The <c>-d agcount=3</c> command will lower
479 the number of allocation groups. XFS will insist on using at least 1 allocation group per 4 GB of your partition,
480 so, for example, if you hava a 20 GB partition you will need a minimum agcount of 5.
481 The <c>-l size=32m</c> command increases the journal size to 32 Mb, increasing performance.
482 </note>
484 <warn>
485 If you are installing an XFS partition over a previous ReiserFS partition,
486 later attempts to mount may fail without an explicit <c>mount -t xfs</c>.
487 The solution is to zero out the partition before creating the XFS filesystem:
488 <c>dd if=/dev/zero of=/dev/hd<comment>x</comment> bs=1k</c>.
489 </warn>
491 <p>If you'd like to use ext3, you can create ext3 filesystems using <c>mke2fs -j</c>.</p>
493 <pre caption = "Creating an ext3 Filesystem">
494 # <c>mke2fs -j /dev/hda3</c>
495 </pre>
497 <p>To create ReiserFS filesystems, use the <c>mkreiserfs</c> command.</p>
499 <pre caption = "Creating a ReiserFS Filesystem">
500 # <c>mkreiserfs /dev/hda3</c>
501 </pre>
503 <note>You can find out more about using ext3 under Linux 2.4 at
504 <uri>http://www.zip.com.au/~akpm/linux/ext3/ext3-usage.html</uri>.
505 </note>
507 </body>
508 </section>
509 </chapter>
511 <chapter>
512 <title>Mount Partitions</title>
513 <section>
514 <body>
516 <p>Now, we'll activate our new swap, since we may need the additional virtual memory that
517 provides later:
518 </p>
520 <pre caption = "Activating Swap">
521 # <c>swapon /dev/hda2</c>
522 </pre>
524 <p>Next, we'll create the <path>/mnt/gentoo</path> and <path>/mnt/gentoo/boot</path> mountpoints,
525 and we'll mount our filesystems to these mountpoints. </p>
527 <pre caption = "Creating Mount Points">
528 # <c>mkdir /mnt/gentoo</c>
529 # <c>mount /dev/hda3 /mnt/gentoo</c>
530 # <c>mkdir /mnt/gentoo/boot</c>
531 # <c>mount /dev/hda1 /mnt/gentoo/boot</c>
532 </pre>
534 <p>
535 If you are setting up Gentoo
536 Linux with a separate <path>/usr</path> or <path>/var</path>, these would get mounted to
537 <path>/mnt/gentoo/usr</path> and <path>/mnt/gentoo/var</path>, respectively.
538 </p>
540 <impo>If your <e>boot</e> partition (the one holding the kernel) is ReiserFS, be sure to mount it
541 with the <c>-o notail</c> option so GRUB gets properly installed. Make sure
542 that <c>notail</c> ends up in your new <path>/etc/fstab</path> boot partition entry, too.
543 We'll get to that in a bit.
544 </impo>
546 <impo>If you are having problems mounting your boot partition with ext2, try using
547 <c>mount /dev/hXX /mnt/gentoo/boot -t ext2 </c> </impo>
548 </body>
549 </section>
550 </chapter>
552 <chapter>
553 <title>Obtaining the Desired 'stage-x' Tarball</title>
555 <section>
556 <body>
558 <p>If you want to start from a stage1 tarball, then you're already set
559 to go; you can find the stage1 tarball in <path>/cdroot/nocompress</path>.
560 On the other hand, if you would prefer to start from a stage2 or stage3
561 tarball that has been optimized for your architecture you can download it
562 (into <path>/mnt/gentoo</path> would be the simplest)
563 from one of the Gentoo mirror sites: </p>
565 <pre caption = "Downloading Required Stages">
566 # <c>cd /mnt/gentoo</c>
567 # <c>env TMPDIR="/mnt/gentoo" lynx http://www.ibiblio.org/pub/Linux/distributions/gentoo/releases/1.4_rc1/x86/</c>
568 </pre>
570 </body>
571 </section>
572 </chapter>
574 <chapter>
575 <title>Unpacking the Stage Tarballs</title>
576 <section>
578 <body>
580 <p>Now it's time to extract the compressed stage tarball of your choice to <path>/mnt/gentoo</path>.
581 Then, we'll <c>chroot</c> over to the new Gentoo Linux build installation.
582 </p>
584 <impo>Be sure to use the <c>p</c> option with <c>tar</c>. Forgetting to do this will
585 cause certain files to contain incorrect permissions.</impo>
587 <p>If you are using the "from scratch, build everything" install method,
588 you will want to use the <path>stage1-ix86-1.4_beta.tbz2</path> image.
589 If you're using one of our bigger CDs, you'll also have a choice of a stage2 and stage3 image.
590 These images allow you to save time at the expense of configurability (we've already chosen
591 compiler optimizations and default USE variables for you.) The stage3 image now also includes
592 complete linux sources and a Portage tree snapshot, eliminating the
593 need to do an <c>emerge sync</c> later, but it is highly recommended to do so anyway.
594 </p>
596 <pre caption = "Unpacking the Stages">
597 # <c>cd /mnt/gentoo</c>
598 # <c>tar -xvjpf /path/to/stage?-*.tbz2</c>
599 # <c>mount -o bind /proc /mnt/gentoo/proc</c>
600 # <c>cp /etc/resolv.conf /mnt/gentoo/etc/resolv.conf</c>
601 </pre>
603 <pre caption = "Entering the chroot Environment">
604 # <c>chroot /mnt/gentoo /bin/bash</c>
605 # <c>env-update</c>
606 Regenerating /etc/ld.so.cache...
607 # <c>source /etc/profile</c>
608 </pre>
610 <p>After you execute these commands, you'll be "inside" your new Gentoo Linux environment.
611 </p>
613 </body>
614 </section>
615 </chapter>
617 <chapter>
618 <title>Getting the Current Portage Tree using Rsync</title>
620 <section>
621 <body>
623 <p>Now, you'll need to run <c>emerge sync</c>. This will make sure that
624 you have the most current copy of the Portage tree. </p>
626 <pre caption = "Updating Using Rsync">
627 # <c>emerge sync</c>
628 </pre>
630 <p>The Portage tree will be downloaded and stored in <path>/usr/portage</path>;
631 it's about 90Mb in size without tarballs.
632 </p>
634 </body>
635 </section>
636 </chapter>
637 <chapter>
638 <title>Setting Gentoo optimizations (make.conf)</title>
639 <section>
640 <body>
642 <p>Now that you have a working copy of the Portage tree, people using stage1 to
643 install will need to bootstrap their Gentoo Linux system as follows. First
644 edit the file <path>/etc/make.conf</path>. In this file, you should set your
645 <c>USE</c> flags, which specify optional functionality that you would
646 like to be built into packages; generally, the defaults (an <e>empty</e>
647 or unset <c>USE</c> variable) are fine.
648 More information on <c>USE</c> flags can be found
649 <uri link="http://www.gentoo.org/doc/en/use-howto.xml">here</uri>.
650 </p>
653 <p>You also should set appropriate <c>CHOST</c>, <c>CFLAGS</c> and
654 <c>CXXFLAGS</c> settings for the kind of system that you are creating
655 (commented examples can be found further down in the file.) Your best friend
656 is <path>man gcc</path> to figure out what additional <c>CFLAGS</c> and
657 <code>CXXFLAGS</code> are available. Search for 'Optimization'.
658 </p>
660 <p>If necessary, you can also set proxy information here if you are behind a
661 firewall.
662 </p>
664 <pre caption = "Setting make.conf Options">
665 # <c>nano -w /etc/make.conf</c> <comment>(Adjust these settings)</comment>
666 </pre>
668 <note>
669 People who need to substantially tweak the build process should take a look at
670 the <path>/etc/make.globals</path> file. This file comprises gentoo defaults and
671 should never be touched. If the defaults do not suffice, then new values should
672 be put in <path>/etc/make.conf</path>, as entries in <path>make.conf</path>
673 <comment>override</comment> the entries in <path>make.globals</path>. If you're
674 interested in tweaking USE settings, look in <path>/etc/make.profile/make.defaults</path>.
675 If you want to turn off any USE settings found here, add an appropriate <c>USE="-foo"</c>
676 in /etc/make.conf (to turn off the <c>foo</c> USE setting.)
677 </note>
678 </body>
679 </section>
680 </chapter>
684 <chapter>
685 <title>Progressing from stage1 to stage2</title>
686 <section>
688 <body>
690 <p>If you are a stage2 or stage3 tarball, then we've already bootstrapped
691 for you. There is no reason for you to bootstrap again, unless you decided to
692 do an <c>emerge sync</c> and want to ensure that you have an up-to-the-minute
693 current Gentoo Linux system. Most people using stage2 or stage3 tarballs will
694 <i>not</i> want to bootstrap again, since it can take over two hours even on
695 very fast machines.
696 </p>
698 <p>Now, it's time to start the "bootstrap" process. This process takes about two hours on
699 my 1200Mhz AMD Athlon system. During this time, the extracted build image will be prepped
700 for compiling the rest ofthe system. The GNU compiler suite will be built, as well as the GNU C library.
701 These are time consuming builds and make up the bulk of the bootstrap process.
702 </p>
704 <pre caption = "Bootstrapping">
705 # <c>cd /usr/portage</c>
706 # <c>scripts/bootstrap.sh</c>
707 </pre>
709 <p>The "bootstrap" process will now begin.
710 </p>
712 <note>
713 Portage by default uses <c>/var/tmp</c> during package building, often
714 using several hundred megabytes of temporary storage. If you would like to
715 change where Portage stores these temporary files, set a new PORTAGE_TMPDIR <e>before</e>
716 starting the bootstrap process, as follows:
717 </note>
719 <pre caption = "Changing Portage's Storage Path">
720 # <c>export PORTAGE_TMPDIR="/otherdir/tmp"</c>
721 </pre>
723 <p><c>bootstrap.sh</c> will build <c>binutils</c>, <c>gcc</c>, <c>gettext</c>,
724 and <c>glibc</c>, rebuilding <c>binutils</c>, <c>gcc</c>, and <c>gettext</c>
725 after <c>glibc</c>. Needless to say, this process takes a while.
726 Have a nice nap. Once this process completes, your system will be in a "stage2" state.
727 </p>
729 </body>
730 </section>
731 </chapter>
733 <chapter>
734 <title>Timezone</title>
735 <section>
737 <body>
739 <impo>It is extremely important that this step is completed, no matter which stage
740 tarball you use. Major clock drift will be experienced if you do not set localtime correctly,
741 let alone subtle issues when emerging packages later.
742 </impo>
744 <p>At this point, you should have a stage2 system that's ready for final configuration.
745 We'll start this process by setting the timezone. By setting the timezone before building
746 the kernel we ensure that users get reasonable <c>uname -a</c> output.
747 </p>
749 <p>Look for your timezone (or GMT if you using Greenwich Mean Time) in
750 <path>/usr/share/zoneinfo</path>. Then, make a symbolic link by typing:
751 </p>
753 <pre caption = "Creating a symbolic link for timezome">
754 # <c>ln -sf /usr/share/zoneinfo/path/to/timezonefile /etc/localtime</c>
755 </pre>
757 <p>You might also want to check <path>/etc/rc.conf</path> to make sure your timezone settings
758 are correct.
759 </p>
761 </body>
762 </section>
763 </chapter>
765 <chapter>
766 <title>Progressing from stage2 to stage3</title>
767 <section>
769 <body>
770 <p>Once your build image has been bootstrapped and you're at stage2
771 (again, if you are using a stage3 tarball than these steps are not required)
772 it's time to build or install the rest of the base
773 system.
774 </p>
776 <note>
777 If you haven't done so, please edit <path>/etc/make.conf</path> to your flavor.
778 </note>
780 <pre caption = "Installing the Rest of the System">
781 # <c>export CONFIG_PROTECT=""</c>
782 # <c>emerge -p system</c>
783 <comment>[lists the packages to be installed]</comment>
784 # <c>emerge system</c>
785 </pre>
787 <note>The <c>export CONFIG_PROTECT=""</c> line ensures that any new scripts
788 installed to <path>/etc</path> will overwrite the old scripts (stored in
789 <path>sys-apps/baselayout</path>), bypassing Portage's new config file
790 management support. Type <c>emerge --help config</c> for more details.</note>
792 <p>It's going to take a while
793 to finish building the entire base system. Your reward is that it will be
794 thoroughly optimized for your system. The drawback is that you have to find a
795 way to keep yourself occupied for some time to come. The author suggests "Star
796 Wars - Super Bombad Racing" for the PS2. When <c>emerge system</c> completes,
797 you'll have a stage3 Gentoo Linux system.
798 </p>
800 </body>
801 </section>
802 </chapter>
804 <chapter>
805 <title>Final steps: kernel and system logger</title>
806 <section>
807 <body>
809 <note>
810 If you haven't done so, please edit <path>/etc/make.conf</path> to your flavor.
811 </note>
813 <p>You now need to merge Linux source ebuilds. Here are the ones we currently
814 offer:
815 </p>
817 <table>
818 <tr><th>ebuild</th><th>description</th></tr>
819 <tr><ti><path>gentoo-sources</path></ti><ti>Our own performance and functionality-enhanced kernel based on -ac.</ti></tr>
820 <tr><ti><path>xfs-sources</path></ti><ti>A snapshot of the SGI XFS CVS Linux source tree; this is the kernel to run if you want bleeding edge(cvs) xfs support.</ti></tr>
821 <tr><ti><path>openmosix-sources</path></ti><ti>A stock Linux kernel source tree patched with support for the GPL <uri link="http://www.openmosix.com">openMosix</uri> load-balancing/clustering technology</ti></tr>
822 <tr><ti><path>usermode-sources</path></ti><ti>A stock Linux kernel source tree patched with support for User-Mode Linux. ("Linux inside Linux" technology)</ti></tr>
823 <tr><ti><path>vanilla-sources</path></ti><ti>A stock Linux kernel source tree, just like you'd get from kernel.org</ti></tr>
824 </table>
826 <warn>Please note that <i>gentoo-sources</i> is heavily patched and may not be stable.
827 Using <i>vanilla-sources</i> might be a better idea if you encounter numerous problems. If you are using
828 <i>gentoo-sources</i> beware of <i>grsecurity</i>, especially with <i>X</i>.
829 It is best to disable <i>grsecurity</i>unless you are absolutely sure that you need it.
830 </warn>
832 <p>Choose one and then merge as follows:</p>
834 <pre caption = "Emerging Kernel Sources">
835 # <c>emerge sys-kernel/gentoo-sources</c>
836 </pre>
838 <p>Once you have a Linux kernel source tree available, it's time to compile your own custom kernel.
839 </p>
841 <pre caption = "Compiling the Linux Kernel">
842 # <c>cd /usr/src/linux</c>
843 # <c>make menuconfig</c>
844 # <c>make dep &amp;&amp; make clean bzImage modules modules_install</c>
845 # <c>mv /boot/bzImage /boot/bzImage.orig</c>
846 <comment>[if bzImage already exists]</comment>
847 # <c>cp /usr/src/linux/arch/i386/boot/bzImage /boot</c>
848 </pre>
850 <warn>For your kernel to function properly, there are several options that you will
851 need to ensure are in the kernel proper -- that is, they should <i>be enabled and not
852 compiled as modules</i>. You will need to enable the <i>"Code maturity
853 level options --> Prompt for development and/or incomplete code/drivers"</i>
854 option to see several of these selections.
855 Under the "File systems" section, be sure to enable the <i>"Device File System"</i> (note that
856 you <e>don't</e> need to enable the "/dev/pts file system support" option). You'll also
857 need to enable the <i>"Virtual Memory Filesystem"</i>. Be sure to enable "ReiserFS" if you have
858 any ReiserFS partitions; the same goes for "Ext3". If you're using XFS, enable the
859 "SGI XFS filesystem support"
860 option. It's always a good idea to leave ext2
861 enabled whether you are using it or not. Also, most people using IDE hard drives will
862 want to enable the "USE DMA by default" option; otherwise, your IDE drives may perform
863 very poorly. Of course, remember to enable "IDE disk" support as well -- otherwise your
864 kernel won't be able to see your IDE disks.
865 </warn>
867 <p>If you are using hardware RAID you will need to enable a couple more options in the kernel:
868 For Highpoint RAID controllers select hpt366 chipset support, support for IDE RAID controllers and Highpoint
869 370 software RAID.For Promise RAID controllers select PROMISE PDC202{46|62|65|67|68|69|70} support,
870 support for IDE RAID
871 controllers and Support Promise software RAID (Fasttrak(tm))
872 </p>
874 <p>If you use PPPoE to connect to Internet, you will need the following
875 options in the kernel (built-in or as preferably as modules) :
876 "PPP (point-to-point protocol) support", "PPP support for async serial ports",
877 "PPP support for sync tty ports". The two compression options won't harm but
878 are not definitely needed, neither does the "PPP over Ethernet" option,
879 that might only be used by <i>rp-pppoe</i> when configured to do kernel mode PPPoE.
880 </p>
882 <p>If you have an IDE cd burner, then you need to enable SCSI emulation in the
883 kernel. Turn on "ATA/IDE/MFM/RLL support" ---> "IDE, ATA and ATAPI Block
884 devices" ---> "SCSI emulation support" (I usually make it a module), then
885 under "SCSI support" enable "SCSI support", "SCSI CD-ROM support" and
886 "SCSI generic support" (again, I usually compile them as modules). If you
887 also choose to use modules, then <c>echo -e "ide-scsi\nsg\nsr_mod"
888 >> /etc/modules.autoload</c> to have them automatically added at boot time.
889 </p>
891 <note>
892 For those who prefer it,
893 it is now possible to install Gentoo Linux with a 2.2 kernel.
894 Such stability will come at a price:
895 you will lose many of the nifty features that
896 are new to the 2.4 series kernels (such as XFS and tmpfs
897 filesystems, iptables, and more), although the 2.2 kernel sources can be
898 patched with Reiserfs and devfs support.
899 Gentoo linux bootscripts require either tmpfs or ramdisk support in the kernel, so
900 2.2 kernel users need to make sure that ramdisk support is compiled in (ie, not a module).
901 It is <comment>vital</comment> that a <e>gentoo=notmpfs</e> flag be added to the kernel
902 line in <path>/boot/grub/grub.conf</path> for the 2.2 kernel so that a ramdisk is mounted
903 for the bootscripts instead of tmpfs. If you choose not to use devfs, then
904 <e>gentoo=notmpfs,nodevfs</e> should be used instead.
905 </note>
907 <p>Your new custom kernel (and modules) are now installed. Now you need to choose a system
908 logger that you would like to install. We offer sysklogd, which is the traditional set
909 of system logging daemons. We also have msyslog and syslog-ng as well as metalog. Power users seem
910 to gravitate away from sysklogd (not very good performance) and towards the
911 newer alternatives.
912 If in doubt, you may want to try metalog, since it seems to be quite popular.
913 To merge your logger of choice, type <e>one</e> of the next four lines:
914 </p>
917 <pre caption = "Emerging System Logger of Choice">
918 # <c>emerge app-admin/sysklogd</c>
919 # <c>rc-update add sysklogd default</c>
920 <comment>or</comment>
921 # <c>emerge app-admin/syslog-ng</c>
922 # <c>rc-update add syslog-ng default</c>
923 <comment>or</comment>
924 # <c>emerge app-admin/metalog</c>
925 # <c>rc-update add metalog default</c>
926 <comment>or</comment>
927 # <c>emerge app-admin/msyslog</c>
928 # <c>rc-update add msyslog default</c>
929 </pre>
931 <warn>
932 In the case of syslog-ng you need to create
933 <path>/etc/syslog-ng/syslog-ng.conf</path>.
934 See <path>/etc/syslog-ng</path>
935 for a sample configuration file.
936 </warn>
938 <impo>
939 Metalog flushes output to the disk in blocks, so messages aren't immediately recorded into
940 the system logs. If you are trying to debug a daemon, this performance-enhancing behavior
941 is less than helpful. When your Gentoo Linux system is up and running, you can send
942 metalog a USR1 signal to temporarily turn off this message buffering (meaning that
943 <i>tail -f <path>/var/log/everything/current</path></i> will now work
944 in real time, as expected),
945 and a USR2 signal to turn buffering back on
946 again.
947 </impo>
949 <p>Now, you may optionally choose a cron package that you'd like to use.
950 Right now, we offer dcron, fcron and vcron. If you don't know which one to choose,
951 you might as well grab vcron. They can be installed as follows:
952 </p>
954 <pre caption = "Choosing a CRON Daemon">
955 # <c>emerge sys-apps/dcron</c>
956 # <c>crontab /etc/crontab</c>
957 <comment>or</comment>
958 # <c>emerge sys-apps/fcron</c>
959 # <c>crontab /etc/crontab</c>
960 <comment>or</comment>
961 # <c>emerge sys-apps/vcron</c>
962 <comment>You do not need to run <c>crontab /etc/crontab</c> if using vcron. </comment>
963 <comment>Don't forget to add your *cron to the proper init level. </comment>
964 # <c>rc-update add *cron default </c>
965 </pre>
967 <p>For more information how how cron works under Gentoo Linux,
968 see <uri link="http://lists.gentoo.org/pipermail/gentoo-announce/2002-April/000151.html">this announcement</uri>.</p>
969 <p>For more information on starting programs and daemons at startup, see the
970 <uri link="/doc/rc-scripts.html">rc-script guide</uri>.
971 </p>
973 </body>
974 </section>
975 </chapter>
977 <chapter>
978 <title>Final steps: Install Additional Packages</title>
979 <section>
980 <body>
982 <p>If you need rp-pppoe to connect to the net, be aware that at this point
983 it has not been installed. It would be the good time to do it. </p>
985 <pre caption = "Installing rp-pppoe">
986 # <c>emerge rp-pppoe</c>
987 </pre>
989 <note> Please note that the rp-pppoe is built but not configured.
990 You will have to do it again using <c>adsl-setup</c> when you boot into your Gentoo system
991 for the first time.
992 </note>
995 <p>You may need to install some additional packages in the Portage tree
996 if you are using any optional features like XFS, ReiserFS or LVM. If you're
997 using XFS, you should emerge the <c>xfsprogs</c> ebuild:
998 </p>
1000 <pre caption = "Emerging Filesystem Tools">
1001 # <c>emerge sys-apps/xfsprogs</c>
1002 <comment>If you'd like to use ReiserFS, you should emerge the ReiserFS tools: </comment>
1003 # <c> emerge sys-apps/reiserfsprogs</c>
1004 <comment>If you're using LVM, you should emerge the <c>lvm-user</c> package: </comment>
1005 # <c>emerge --usepkg sys-apps/lvm-user</c>
1006 </pre>
1009 <p>If you're a laptop user and wish to use your PCMCIA slots on your first
1010 real reboot, you'll want to make sure you install the <i>pcmcia-cs</i> package.
1011 </p>
1013 <pre caption = "Emerging PCMCIA-cs">
1014 # <c>emerge sys-apps/pcmcia-cs</c>
1015 </pre>
1017 <warn>You will have to re-emerge <i>pcmcia-cs</i> after installation to get PCMCIA
1018 to work.
1019 </warn>
1021 </body>
1022 </section>
1023 </chapter>
1025 <chapter>
1026 <title>Final steps: /etc/fstab</title>
1027 <section>
1029 <body>
1031 <p>Your Gentoo Linux system is almost ready for use. All we need to do now is configure
1032 a few important system files and install the GRUB boot loader.
1033 The first file we need to
1034 configure is <path>/etc/fstab</path>. Remember that you should use
1035 the <c>notail</c> option for your boot partition if you chose to create a ReiserFS filesystem on it.
1036 Remember to specify <c>ext2</c>, <c>ext3</c> or <c>reiserfs</c> filesystem types as appropriate.
1037 </p>
1039 <p>Use something like the <path>/etc/fstab</path> listed below, but of course be sure to replace "BOOT",
1040 "ROOT" and "SWAP" with the actual block devices you are using (such as <c>hda1</c>, etc.)</p>
1041 <pre caption = "Editing fstab">
1042 <comment>
1043 # /etc/fstab: static file system information.
1044 #
1045 # noatime turns of atimes for increased performance (atimes normally aren't
1046 # needed; notail increases performance of ReiserFS (at the expense of storage
1047 # efficiency). It's safe to drop the noatime options if you want and to
1048 # switch between notail and tail freely.
1050 # &lt;fs&gt; &lt;mountpoint&gt; &lt;type&gt; &lt;opts&gt; &lt;dump/pass&gt;
1052 # NOTE: If your BOOT partition is ReiserFS, add the notail option to opts.
1053 </comment>
1054 /dev/BOOT /boot ext2 noauto,noatime 1 2
1055 /dev/ROOT / ext3 noatime 0 1
1056 /dev/SWAP none swap sw 0 0
1057 /dev/cdroms/cdrom0 /mnt/cdrom iso9660 noauto,ro 0 0
1058 proc /proc proc defaults 0 0
1059 </pre>
1061 <warn>Please notice that <i>/boot</i> is NOT mounted at boottime.
1062 This is to protect the data in <i>/boot</i> from
1063 corruption. If you need to access <i>/boot</i>, please mount it!
1064 </warn>
1066 </body>
1067 </section>
1069 <section>
1070 <title>Final steps: Root Password</title>
1072 <body>
1074 <p>Before you forget, set the root password by typing: </p>
1076 <pre caption = "Setting the root Password">
1077 # <i>passwd</i>
1078 </pre>
1080 </body>
1081 </section>
1083 <section>
1084 <title>Final steps: /etc/hostname</title>
1086 <body>
1087 <p>Edit this file so that it contains your fully-qualified domain name on a single line,
1088 i.e. <c>mymachine.mydomain.com</c>.
1089 </p>
1091 <pre caption = "Configuring Hostname">
1092 # <c>echo mymachine.mydomain.com > /etc/hostname</c>
1093 </pre>
1095 </body>
1096 </section>
1098 <section>
1099 <title>Final steps: /etc/hosts</title>
1101 <body>
1102 <p>This file contains a list of ip addresses and their associated hostnames.
1103 It's used by the system to resolve the IP addresses
1104 of any hostnames that may not be in your nameservers. Here's a template for this file:
1105 </p>
1107 <pre caption = "Hosts Template">
1108 localhost
1109 <comment># the next line contains your IP for your local LAN, and your associated machine name</comment>
1110 mymachine.mydomain.com mymachine
1111 </pre>
1113 <note>If you are on a DHCP network, it might be helpful to set <i>localhost</i> to your machine's
1114 actual hostname. This will help GNOME and many other programs in name resolution.
1115 </note>
1117 </body>
1118 </section>
1120 <section>
1121 <title>Final Network Configuration</title>
1123 <body>
1126 <p>Add the names of any modules that are necessary for the proper functioning of your system to
1127 <path>/etc/modules.autoload</path> file (you can also add any options you
1128 need to the same line.) When Gentoo Linux boots, these modules will be automatically
1129 loaded. Of particular importance is your ethernet card module, if you happened to compile
1130 it as a module:
1131 </p>
1133 <pre caption="/etc/modules.autoload">
1134 <comment>This is assuming that you are using a 3com card. Check <path>/lib/modules/`uname -r`/kernel/drivers/net</path> for your
1135 card. </comment>
1136 3c59x
1137 </pre>
1139 <p>Edit the <path>/etc/conf.d/net</path> script to get your network configured for your
1140 first boot: </p>
1142 <pre caption = "Boottime Network Configuration">
1143 # <c>nano -w /etc/conf.d/net</c>
1144 # <c>rc-update add net.eth0 default</c>
1145 </pre>
1148 <p>If you have multiple network cards you need to create additional <path>net.eth<comment>x</comment></path>
1149 scripts for each one (<comment>x</comment> = 1, 2, ...): </p>
1151 <pre caption="Multiple Network Interfaces">
1152 # <c>cd /etc/init.d</c>
1153 # <c>cp net.eth0 net.eth<comment>x</comment></c>
1154 # <c>rc-update add net.eth<comment>x</comment> default</c>
1155 </pre>
1158 <p>If you have a PCMCIA card installed, have a quick look into
1159 <path>/etc/init.d/pcmcia</path> to verify that things seem all right for your setup,
1160 then add this line to the top of <path>/etc/init.d/ethx</path>:
1161 </p>
1163 <pre caption = "PCMCIA depend in /etc/init.d/net.ethx">
1164 depend() {
1165 need pcmcia
1166 }
1167 </pre>
1169 <p>This makes sure that the PCMCIA drivers are autoloaded whenever your network is loaded.
1170 </p>
1172 </body>
1173 </section>
1175 <section>
1176 <title>Final steps: configure basic settings (including the international keymap setting)</title>
1178 <body>
1180 <pre caption="Basic Configuration">
1181 # <c>nano -w /etc/rc.conf</c>
1182 </pre>
1184 <p>Follow the directions in the file to configure the basic settings.
1185 All users will want to make sure that <c>CLOCK</c> is set to his/her
1186 liking. International keyboard users will want to set the <c>KEYMAP</c>
1187 variable (browse <path>/usr/share/keymaps</path> to see the various
1188 possibilities).
1189 </p>
1191 </body>
1192 </section>
1194 <section>
1195 <title>Final steps: Configure GRUB</title>
1197 <body>
1199 <p>The most critical part of understanding GRUB is getting comfortable with how GRUB
1200 refers to hard drives and partitions. Your Linux partition <path>/dev/hda1</path> is called
1201 <path>(hd0,0)</path> under GRUB. Notice the parenthesis around the hd0,0 - they are required.
1202 Hard drives count from zero rather than "a", and partitions start at zero rather than one.
1203 Be aware too that with the hd devices, only harddrives are counted, not atapi-ide devices such as
1204 cdrom players, burners, and that the same construct can be used with scsi drives.
1205 (Normally they get higher numbers than ide drives except when the bios is configured
1206 to boot from scsi devices.) Assuming you have a harddrive on /dev/hda, a cdrom player on /dev/hdb,
1207 a burner on /dev/hdc and a second hardrive on /dev/hdd, for example, and no scsi harddrive
1208 <path>/dev/hdd7</path> gets translated to <path>(hd1,6)</path>.
1210 It might sound tricky, and tricky it is indeed, but as we will see, grub
1211 offers a tab completion mechanism that comes handy for those of you having
1212 a lot of harddrives and partitions and who are a little lost in the
1213 grub numbering scheme. Having gotten the feel for that,
1214 it's time to install GRUB.
1215 </p>
1217 <p>The easiest way to install GRUB is to simply type <c>grub</c> at your chrooted shell prompt: </p>
1219 <pre caption = "Installing GRUB">
1220 # <c>grub</c>
1221 </pre>
1223 <impo>If you are using hardware RAID this part will not work at
1224 this time.
1225 Skip to the section on making your <path>grub.conf</path>. After that we will complete the
1226 grub setup for RAID controllers
1227 </impo>
1229 <p>You'll be presented with the <c>grub&gt;</c> grub
1230 command-line prompt. Now, you need to type in the
1231 right commands to install the GRUB boot record onto your hard drive. In my example configuration,
1232 I want to install the GRUB boot record on my hard drive's MBR (master boot record), so that
1233 the first thing I see when I turn on the computer is the GRUB prompt. In my case, the commands
1234 I want to type are:
1235 </p>
1237 <pre caption = "GRUB Commands">
1238 grub&gt; <c>root (hd0,0)</c>
1239 grub&gt; <c>setup (hd0)</c>
1240 grub&gt; <c>quit</c>
1241 </pre>
1243 <p>Here's how the two commands work. The first <c>root ( )</c> command tells GRUB
1244 the location of your boot partition (in our example, <path>/dev/hda1</path> or
1245 <path>(hd0,0)</path> in GRUB terminology. Then, the second <c>setup ( )
1246 </c> command tells GRUB where to install the
1247 boot record - it will be configured to look for its special files at the <c>root
1248 ( )</c> location that you specified. In my case, I want the boot record on the
1249 MBR of the hard drive, so I simply specify <path>/dev/hda</path> (also known as <path>(hd0)</path>).
1250 If I were using another boot loader and wanted to set up GRUB as a secondary boot-loader, I
1251 could install GRUB to the boot record of a particular partition. In that case,
1252 I'd specify a particular partition rather than the entire disk. Once the GRUB
1253 boot record has been successfully installed, you can type <c>quit</c> to quit GRUB.
1255 <note> The tab completion mechanism of grub can be used from within grub,
1256 assuming you wrote <c> root (</c> and that you hit the TAB key, you would
1257 be prompted with a list of the available devices (not only harddrives),
1258 hitting the TAB key having written <c> root (hd</c>, grub would print the
1259 available harddrives and hitting the TAB key after writing <c> root (hd0,</c>
1260 would make grub print the list of partitions on the first harddrive.
1262 Checking the syntax of the grub location with completion should really help
1263 to make the right choice.
1264 </note>
1266 Gentoo Linux is now
1267 installed, but we need to create the <path>/boot/grub/grub.conf</path> file so that
1268 we get a nice GRUB boot menu when the system reboots. Here's how to do it.
1269 </p>
1271 <impo>To ensure backwards compatibility with GRUB, make sure to make a link from
1272 <i>grub.conf</i> to <i>menu.lst</i>. You can do this by doing
1273 <c>ln -s /boot/grub/grub.conf /boot/grub/menu.lst </c>. </impo>
1275 <p>Now, create the grub.conf file (<c>nano -w /boot/grub/grub.conf</c>), and add the following to it:
1276 </p>
1278 <pre caption = "Grub.conf for GRUB">
1279 default 0
1280 timeout 30
1281 splashimage=(hd0,0)/boot/grub/splash.xpm.gz
1283 title=My example Gentoo Linux
1284 root (hd0,0)
1285 kernel /boot/bzImage root=/dev/hda3
1287 <comment> #Below is for setup using hardware RAID</comment>
1288 title=My Gentoo Linux on RAID
1289 root (hd0,0)
1290 kernel /boot/bzImage root=/dev/ataraid/discX/partY
1292 <comment># Below needed only for people who dual-boot</comment>
1293 title=Windows NT Workstation
1294 root (hd0,5)
1295 chainloader +1
1296 </pre>
1298 <note>
1299 (hd0,0) should be written without any spaces inside the parentheses.
1300 </note>
1302 <impo>
1303 If you set up scsi emulation for an IDE cd burner earlier, then to get it to
1304 actually work you need to add an "hdx=ide-scsi" fragment to the kernel
1305 line in grub.conf (where "hdx" should be the device for your cd burner).
1306 </impo>
1308 <p>After saving this file, Gentoo Linux installation is complete. Selecting the first option will
1309 tell GRUB to boot Gentoo Linux without a fuss. The second part of the grub.conf file is optional,
1310 and shows you how to use GRUB to boot a bootable Windows partition.
1311 </p>
1313 <note>Above, <path>(hd0,0)</path> should point to your "boot" partition
1314 (<path>/dev/hda1</path> in our example config) and <path>/dev/hda3</path> should point to
1315 your root filesystem. <path>(hd0,5)</path> contains the NT boot
1316 loader.
1317 </note>
1318 <note>
1319 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>.
1320 </note>
1322 <p>If you need to pass any additional options to the kernel, simply
1323 add them to the end of the <c>kernel</c> command. We're already passing one option
1324 (<c>root=/dev/hda3</c>), but you can pass others as well. In particular, you can
1325 turn off devfs by default (not recommended unless you know what you're doing) by
1326 adding the <c>gentoo=nodevfs</c> option to the <c>kernel</c> command.
1327 </p>
1329 <note>Unlike in earlier versions of Gentoo Linux, you no longer have to add
1330 <c>devfs=mount</c> to the end of the <c>kernel</c> line to enable devfs. In rc6
1331 devfs is enabled by default.
1332 </note>
1334 <p>If you are using hardware RAID, you must make a GRUB boot
1335 disk. With hardware RAID
1336 if you try to install grub from your chrooted shell it will fail. So we
1337 will make a GRUB
1338 boot disk, and when you reboot the first time we will install GRUB
1339 to the MBR. Make your
1340 bootdisk like this:
1341 </p>
1343 <pre caption = "Creating a RAID Bootdisk">
1344 # <c>mke2fs /dev/fd0</c>
1345 # <c>mount /dev/fd0 /mnt/floppy</c>
1346 # <c>mkdir -p /mnt/floppy/boot/grub</c>
1347 # <c>cp /usr/share/grub/i386-pc/stage1 /mnt/floppy/boot/grub/</c>
1348 # <c>cp /usr/share/grub/i386-pc/stage2 /mnt/floppy/boot/grub/</c>
1350 # <c>grub</c>
1352 grub&gt; <c>root (fd0)</c>
1353 grub&gt; <c>setup (fd0)</c>
1354 grub&gt; <c>quit</c>
1355 </pre>
1358 </body>
1359 </section>
1360 </chapter>
1362 <chapter>
1363 <title>Installation Complete!</title>
1364 <section>
1366 <body>
1367 <p>Now, Gentoo Linux is installed. The only remaining step is to exit the chrooted shell,
1368 udpate necessary configuration files,
1369 safely unmount your partitions
1370 and reboot the system:
1371 </p>
1373 <pre caption = "Rebooting the System">
1374 # <c>etc-update</c>
1375 # <c>exit</c>
1376 <codenote>This exits the chrooted shell; you can also type <c>^D</c></codenote>
1377 # <c>cd / </c>
1378 # <c>umount /mnt/gentoo/boot</c>
1379 # <c>umount /mnt/gentoo/proc</c>
1380 # <c>umount /mnt/gentoo</c>
1381 # <c>reboot</c>
1382 </pre>
1384 <note>
1385 After rebooting, it is a good idea to run the <c>update-modules</c> command to create
1386 the <path>/etc/modules.conf</path> file. Instead of modifying this file directly, you should
1387 generally make changes to the files in <path>/etc/modules.d</path>.
1388 </note>
1390 <impo>Remember if you are running hardware RAID, you must
1391 use the bootdisk for the first reboot.
1392 then go back and install grub the way everyone else did the first
1393 time. You are done, congratulations</impo>
1395 <p>If you have any questions or would like to get involved with Gentoo Linux development,
1396 consider joining our gentoo-user and gentoo-dev mailing lists
1397 (there's a "click to subscribe" link on our <uri link="http://www.gentoo.org">main page</uri>).
1398 We also have a handy <uri link="http://www.gentoo.org/doc/en/desktop.xml">Desktop configuration guide</uri>
1399 that will
1400 help you to continue configuring your new Gentoo Linux system, and a useful
1401 <uri link="http://www.gentoo.org/doc/en/portage-user.xml">Portage user guide</uri>
1402 to help familiarize you with Portage basics. You can find the rest of the Gentoo Documentation
1403 <uri link = "http://www.gentoo.org/main/en/docs.xml">here</uri>. If you have any other questions
1404 involving installation or anything for that matter, please check the Gentoo Linux
1405 <uri link = "http://www.gentoo.org/doc/en/faq.xml">FAQ</uri>.
1406 Enjoy and welcome to Gentoo Linux!
1407 </p>
1409 </body>
1410 </section>
1411 </chapter>
1413 <chapter>
1414 <title>Gentoo-Stats</title>
1415 <section>
1417 <body>
1419 <p>The Gentoo Linux usage statistics program was started as an attempt to give the developers
1420 a way to find out about their user base. It collects information about Gentoo Linux usage to help
1421 us in set priorities our development. Installing it is completely optional, and it would be greatly
1422 appreciated if you decide to use it. Compiled statistics can be viewed at <uri>http://stats.gentoo.org/</uri>.
1423 </p>
1425 <p>The gentoo-stats server will assign a unique ID to your system.
1426 This ID is used to make sure that each system is counted only once. The ID will not be used
1427 to individually identify your system, nor will it be mached against an IP address or
1428 other personal information. Every precaution has been taken to assure your privacy in the
1429 development of this system. The following are the things that we are monitoring
1430 right now through our "gentoo-stats" program:
1431 </p>
1432 <ul>
1433 <li>installed packages and their version numbers</li>
1434 <li>CPU information: speed (MHz), vendor name, model name, CPU flags (like "mmx" or "3dnow")</li>
1435 <li>memory information (total available physical RAM, total available swap space)</li>
1436 <li>PCI cards and network controller chips</li>
1437 <li>the Gentoo Linux profile your machine is using (that is, where the /etc/make.profile link is pointing to).</li>
1438 </ul>
1440 <p>We are aware that disclosure of sensitive information is a threat to most Gentoo Linux users
1441 (just as it is to the developers).
1442 </p>
1444 <ul>
1445 <li>Unless you modify the gentoo-stats program, it will never transmit sensitive
1446 information such as your passwords, configuration data, shoe size...</li>
1447 <li>Transmission of your e-mail addresses is optional and turned off by default.</li>
1448 <li>The IP address your data transmission originates from will never be logged
1449 in such a way that we can identify you. There are no "IP address/system ID" pairs.</li>
1450 </ul>
1452 <p>The installation is easy - just run the following commands:
1453 </p>
1455 <pre caption="Installing gentoo-stats">
1456 # <c>emerge gentoo-stats</c> <codenote>Installs gentoo-stats</codenote>
1457 # <c>gentoo-stats --new</c> <codenote>Obtains a new system ID</codenote>
1458 </pre>
1460 <p>The second command above will request a new system ID and enter it into
1461 <path>/etc/gentoo-stats/gentoo-stats.conf</path> automatically. You can view this file
1462 to see additional configuration options.
1463 </p>
1465 <p>After that, the program should be run on a regular schedule
1466 (gentoo-stats does not have to be run as root). Add this line to your <path>crontab</path>:
1467 </p>
1469 <pre caption="Updating gentoo-stats with cron">
1470 <c>0 0 * * 0,4 /usr/sbin/gentoo-stats --update > /dev/null</c>
1471 </pre>
1473 <p>The <c>gentoo-stats</c> program is a simple perl script which can be
1474 viewed with your favortive pager or editor: <path>/usr/sbin/gentoo-stats</path>. </p>
1477 </body>
1478 </section>
1479 </chapter>
1484 </guide>

  ViewVC Help
Powered by ViewVC 1.1.20