/[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.78 - (hide annotations) (download) (as text)
Fri Feb 28 10:24:32 2003 UTC (14 years, 7 months ago) by seemant
Branch: MAIN
Changes since 1.77: +11 -11 lines
File MIME type: application/xml
spelling corrections

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

  ViewVC Help
Powered by ViewVC 1.1.20