/[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.15 - (hide annotations) (download) (as text)
Tue Dec 3 18:27:23 2002 UTC (15 years, 7 months ago) by zhen
Branch: MAIN
Changes since 1.14: +1 -1 lines
File MIME type: application/xml
changes for ping host

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

  ViewVC Help
Powered by ViewVC 1.1.20