/[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.3 - (hide annotations) (download) (as text)
Fri Nov 15 18:39:34 2002 UTC (15 years, 1 month ago) by zhen
Branch: MAIN
Changes since 1.2: +1 -1 lines
File MIME type: application/xml
changed all of the <guide link> tags so that they are current

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

  ViewVC Help
Powered by ViewVC 1.1.20