/[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.23 - (show annotations) (download) (as text)
Wed Jan 1 06:11:25 2003 UTC (15 years, 5 months ago) by drobbins
Branch: MAIN
Changes since 1.22: +1 -1 lines
File MIME type: application/xml
url fixo

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

  ViewVC Help
Powered by ViewVC 1.1.20