/[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.99 - (hide annotations) (download) (as text)
Fri Mar 28 00:00:39 2003 UTC (14 years, 7 months ago) by peesh
Branch: MAIN
Changes since 1.98: +7 -7 lines
File MIME type: application/xml
fixed some spelling mistakes

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 drobbins 1.97 </author>
39 peesh 1.96 <author title="Editor">
40     <mail link="peesh@gentoo.org">Jorge Paulo</mail>
41 jhhudso 1.75 </author>
42 zhen 1.16 <abstract>These instructions step you through the process of installing Gentoo
43 jhhudso 1.74 Linux 1.4_rc3. The Gentoo Linux installation process supports various installation
44 zhen 1.6 approaches, depending upon how much of the system you want to custom-build from
45     scratch.
46     </abstract>
47 zhen 1.93 <version>2.6</version>
48 zhen 1.92 <date>20 March 2003</date>
49 zhen 1.16 <chapter>
50     <title>About the Install</title>
51     <section>
52     <body>
53 zhen 1.26 <p>This new boot CD will boot from nearly any modern IDE CD-ROM drive, as well
54 jhhudso 1.71 as many SCSI CD-ROM drives, assuming that your CD-ROM and BIOS both support booting.
55 drobbins 1.21 Included on the CD-ROM is Linux support for IDE (and PCI IDE) (built-in to the
56     kernel) as well as support for all SCSI devices (available as modules.) In
57     addition, we provide modules for literally every kind of network card that
58     Linux supports, as well as tools to allow you to configure your network and
59 jhhudso 1.75 establish outbound (as well as inbound) <c>ssh</c> connections and to download
60 drobbins 1.21 files. </p>
61 zhen 1.26 <p>To install from the build CD, you will need to have a 486+ processor and
62 drobbins 1.69 ideally at least 64 Megabytes of RAM. (Gentoo Linux has been successfully
63 drobbins 1.21 built with 64MB of RAM + 64MB of swap space, but the build process is awfully
64     slow under those conditions.)</p>
65 zhen 1.26 <p>Gentoo Linux can be installed using one of three &quot;stage&quot; tarball files. The
66 drobbins 1.21 one you choose depends on how much of the system you want to compile yourself.
67 jhhudso 1.75 The stage1 tarball is used when you want to bootstrap and build the entire
68 drobbins 1.21 system from scratch. The stage2 tarball is used for building the entire system
69 jhhudso 1.75 from a bootstrapped state. The stage3 tarball already contains a basic Gentoo Linux system.</p>
70 drobbins 1.70 <p><b>So, should you choose to start from a stage1, stage2, or stage3 tarball?</b>
71     Starting from a stage1 allows you to have total control over the optimization settings
72     and optional build-time functionality that is initially enabled on your system. This
73 jhhudso 1.75 makes stage1 installs good for power users who know what they are doing. Stage2 installs
74     allow you to skip the bootstrap process, and doing this is fine if you are happy with
75 drobbins 1.70 the optimization settings that we chose for your particular stage2 tarball. Choosing to
76     go with a stage3 allows for the fastest install of Gentoo Linux, but also means that
77 jhhudso 1.75 your base system will have the optimization settings that we chose for you. Since major
78     releases of Gentoo Linux have stage3's specifically optimized for various popular processors,
79     this may be sufficient for you. <b>If you're installing Gentoo Linux for the first time, consider
80 drobbins 1.70 using a stage3 tarball for installation.</b></p>
81    
82    
83 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
84 jhhudso 1.74 <uri>http://www.ibiblio.org/gentoo/releases/1.4_rc3/x86/</uri> .
85 drobbins 1.22 </p>
86 zhen 1.26 <p> The LiveCDs are full CD images that should be burned to a CDR or CD-RW
87 jhhudso 1.75 using CD burning software. Currently, we have two types of LiveCDs. The first
88     carries the &quot;gentoo-basic&quot; label, and is approximately 40MB in size, contains only the stage 1 tarball and lives
89 drobbins 1.24 in the <path>x86/livecd/</path> directory. This LiveCD is of minimal size to
90     allow for a initial quick download and contains a stage1 tarball that can be
91     found in <path>/mnt/cdrom/gentoo/</path> after the CD has booted.</p>
92 seemant 1.78 <p>The second flavor of LiveCD we currently offer is labeled &quot;gentoo-3stages.&quot;
93 jhhudso 1.75 This CD is also found in <path>x86/livecd</path>. It
94 jhhudso 1.77 contains stage 1, 2 and 3 tarballs. Using this LiveCD, it will be possible
95 jhhudso 1.75 for you to install a fully-functional Gentoo Linux system very quickly.</p>
96 jhhudso 1.77 <p><b>What happened to i686, pentium3, athlon, athlon-mp stages, LiveCDs and GRP (Gentoo Reference Platform)?</b>
97 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>
98 jhhudso 1.77 </p>
99 drobbins 1.70 <impo>If you encounter a problem with any part of the install and wish to
100 drobbins 1.21 report it as a bug, report it to <uri>http://bugs.gentoo.org</uri>. If the bug
101 jhhudso 1.75 needs to be sent upstream to the original software developers (eg the KDE team) the
102 drobbins 1.70 <e>Gentoo Linux developers</e> will take care of that for you.
103     </impo>
104 jhhudso 1.75 <p>Now, let us quickly review the install process. First, we will download, burn
105     and boot a LiveCD. After getting a root prompt, we will create partitions, create
106 drobbins 1.21 our filesystems, and extract either a stage1, stage2 or stage3 tarball. If we
107     are using a stage1 or stage2 tarball, we will take the appropriate steps to get
108 jhhudso 1.75 our system to stage3. Once our system is at stage3, we can configure it
109 seemant 1.78 (customize configuration files, install a boot loader, etc) and boot it and have a
110 drobbins 1.21 fully-functional Gentoo Linux system. Depending on what stage of the build
111 jhhudso 1.75 process you're starting from, here is what is required for installation: </p>
112 zhen 1.26 <table>
113 zhen 1.16 <tr>
114     <th>stage tarball</th>
115     <th>requirements for installation</th>
116     </tr>
117     <tr>
118     <ti>1</ti>
119 jhhudso 1.75 <ti>partition/filesystem setup, emerge sync, bootstrap, emerge system, emerge kernel sources, final configuration</ti>
120 zhen 1.16 </tr>
121     <tr>
122     <ti>2</ti>
123 jhhudso 1.75 <ti>partition/filesystem setup, emerge sync, emerge system, emerge kernel sources, final configuration</ti>
124 zhen 1.16 </tr>
125     <tr>
126     <ti>3</ti>
127     <ti>partition/filesystem setup, emerge sync, final configuration</ti>
128     </tr>
129     </table>
130     </body>
131     </section>
132     </chapter>
133     <chapter>
134     <title>Booting</title>
135     <section>
136     <body>
137 jhhudso 1.75 <p>Start by booting the LiveCD. You should see a fancy boot screen
138 drobbins 1.21 with the Gentoo Linux logo on it. At this screen, you can hit Enter to begin the boot process,
139 drobbins 1.70 or boot the LiveCD with custom boot options by typing <c>gentoo opt1 opt2</c> and then hitting Enter. To see
140     a detailed description of available boot options, press F2 to view the help screen.</p>
141    
142 jhhudso 1.75 <p> Once you hit Enter, you will be greeted with the standard kernel
143     booting output, kernel and initrd messages, followed by the normal Gentoo
144     Linux boot sequence. You will be automatically logged in as
145     &quot;<c>root</c>&quot; and the root password will be set to a random string
146     for security purposes. You should have a root (&quot;<c>#</c>&quot;) prompt
147 seemant 1.78 on the current console, and can also switch to other consoles by pressing
148 jhhudso 1.75 Alt-F2, Alt-F3 and Alt-F4. Get back to the one you started on by pressing
149     Alt-F1. At this point you should set the root password, type passwd and
150     follow the prompts.
151 zhen 1.6 </p>
152 zhen 1.26 <p>You've probably also noticed that above your <c>#</c> prompt is a bunch of help text
153 drobbins 1.70 that explains how to do things like configure your Linux networking and telling you where you can find
154 drobbins 1.21 the Gentoo Linux stage tarballs and packages on your CD.
155 zhen 1.6 </p>
156 zhen 1.16 </body>
157     </section>
158     </chapter>
159     <chapter>
160     <title>Load Kernel Modules</title>
161     <section>
162     <body>
163     <p>If the PCI autodetection missed some of your hardware, you
164 jhhudso 1.75 will have to load the appropriate kernel modules manually.
165 zhen 1.6 To view a list of all available network card modules, type <c>ls
166     /lib/modules/*/kernel/drivers/net/*</c>. To load a particular module,
167     type:
168     </p>
169 jhhudso 1.81 <pre caption="PCI Modules Configuration">
170 drobbins 1.1 # <c>modprobe pcnet32</c>
171 zhen 1.6 <comment>(replace pcnet32 with your NIC module)</comment>
172 jhhudso 1.81 </pre>
173 drobbins 1.70 <p>Likewise, if you want to be able to access any SCSI hardware that wasn't detected
174 jhhudso 1.75 during the initial boot autodetection process, you will need to load the appropriate
175 zhen 1.6 modules from /lib/modules, again using <c>modprobe</c>:
176     </p>
177 jhhudso 1.81 <pre caption="Loading SCSI Modules">
178 drobbins 1.1 # <c>modprobe aic7xxx</c>
179 jhhudso 1.73 <comment>(replace aic7xxx with your SCSI adapter module)</comment>
180 drobbins 1.1 # <c>modprobe sd_mod</c>
181 jhhudso 1.73 <comment>(sd_mod is the module for SCSI disk support)</comment>
182 jhhudso 1.81 </pre>
183 zhen 1.6 <note>
184 drobbins 1.21 Support for a SCSI CD-ROMs and disks are built-in in the kernel.
185 zhen 1.52 </note>
186 jhhudso 1.75 <p>If you are using hardware RAID, you will need to load the
187 zhen 1.6 ATA-RAID modules for your RAID controller.
188     </p>
189 jhhudso 1.81 <pre caption="Loading RAID Modules">
190 zhen 1.33 # <c>modprobe ataraid</c>
191     # <c>modprobe pdcraid</c>
192 jhhudso 1.81 <comment>(Promise Raid Controller)</comment>
193 zhen 1.33 # <c>modprobe hptraid</c>
194 jhhudso 1.81 <comment>(Highpoint Raid Controller)</comment>
195     </pre>
196 zhen 1.16 <p>The Gentoo LiveCD should have enabled DMA on your disks, but if it did not,
197 zhen 1.6 <c>hdparm</c> can be used to set DMA on your drives. </p>
198 jhhudso 1.81 <pre caption="Setting DMA">
199     <comment>Replace hdX with your disk device.</comment>
200 drobbins 1.21 # hdparm -d 1 /dev/hdX <comment>Enables DMA </comment>
201 jhhudso 1.75 # hdparm -d1 -A1 -m16 -u1 -a64 /dev/hdX
202     <comment>(Enables DMA and other safe performance-enhancing options)</comment>
203     # hdparm -X66 /dev/hdX
204     <comment>(Force-enables Ultra-DMA -- dangerous -- may cause some drives to mess up)</comment>
205     </pre>
206 zhen 1.16 </body>
207     </section>
208     </chapter>
209 drobbins 1.70 <!-- THIS SECTION SHOULD BE DEPRECATED WITH HOTPLUG ENABLED IN 1.4_rc3 (drobbins)
210 zhen 1.16 <chapter>
211     <title>Loading PCMCIA Kernel Modules</title>
212     <section>
213     <body>
214 drobbins 1.70 <p>If you have a PCMCIA network card, you will need to perform a few extra steps.
215 zhen 1.6 </p>
216 zhen 1.16 <warn>To avoid problems with <c>cardmgr</c>, you <e>must</e> run it <e>before</e> you enter the chroot
217 zhen 1.6 portion of the install. </warn>
218 jhhudso 1.81 <pre caption="Loading PCMCIA Modules">
219 zhen 1.33 # <i>modprobe pcmcia_core</i>
220     # <i>modprobe i82365</i>
221     # <i>modprobe ds</i>
222 drobbins 1.1 # <i>cardmgr -f</i>
223 jhhudso 1.81 </pre>
224 drobbins 1.21 <p>As <c>cardmgr</c> detects which hardware is present, your speaker should emit a
225 jhhudso 1.75 few reassuring beeps, and your PCMCIA network card should be active. You can
226     of course insert the PCMCIA card after loading <c>cardmgr</c> too, if that is
227 zhen 1.6 preferable. (Technically, you need not run
228 drobbins 1.21 <c>cardmgr</c> if you know exactly which module your PCMCIA card requires.
229 zhen 1.6 But if you don't, loading all PCMCIA modules and see which sticks won't work,
230     as all PCMCIA modules load obligingly and hang around for a PCMCIA card to
231 drobbins 1.21 drop by. <c>cardmgr</c> will also unload the module(s) for any card when you
232 zhen 1.6 remove it). </p>
233 zhen 1.16 </body>
234     </section>
235     </chapter>
236 drobbins 1.70 -->
237 zhen 1.16 <chapter>
238     <title>Configuring Networking</title>
239 drobbins 1.70 <section>
240     <title>Maybe it just works?</title>
241     <body>
242 jhhudso 1.75 <p>If you're using a 1.4_rc3 or later LiveCD, it is possible that your networking has already been
243 drobbins 1.70 configured automatically for you. If so, you should be able to take advantage of the many included
244     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>,
245     among others.</p>
246    
247     <p>If networking has been configured for you, the <c>/sbin/ifconfig</c> command should
248     list some internet interfaces besides <c>lo</c>, such as <c>eth0</c>:
249     </p>
250 jhhudso 1.81 <pre caption="/sbin/ifconfig for a working network card">
251 drobbins 1.70 eth0 Link encap:Ethernet HWaddr 00:50:BA:8F:61:7A
252     inet addr:192.168.0.2 Bcast:192.168.0.255 Mask:255.255.255.0
253     inet6 addr: fe80::50:ba8f:617a/10 Scope:Link
254     UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
255     RX packets:1498792 errors:0 dropped:0 overruns:0 frame:0
256     TX packets:1284980 errors:0 dropped:0 overruns:0 carrier:0
257     collisions:1984 txqueuelen:100
258     RX bytes:485691215 (463.1 Mb) TX bytes:123951388 (118.2 Mb)
259     Interrupt:11
260 jhhudso 1.81 </pre>
261 drobbins 1.70 <p>You may want to also try pinging your ISP's DNS server (found in <path>/etc/resolv.conf</path>),
262     and a Web site of choice, just to make sure that your packets are reaching the net, DNS name
263     resolution is working correctly, etc.
264     </p>
265 jhhudso 1.81 <pre caption="Further Network Testing">
266 drobbins 1.94 # <c>ping -c 3 www.yahoo.com </c>
267 jhhudso 1.81 </pre>
268 drobbins 1.70 <p>Are you able to use your network? If so, you can skip the rest of this section.</p>
269     </body>
270     </section>
271 zhen 1.16 <section>
272     <title> PPPoE configuration</title>
273     <body>
274 drobbins 1.70 <p>Assuming you need PPPoE to connect to the internet, the LiveCD (any version) has
275 drobbins 1.21 made things easy for you by including <c>rp-pppoe</c>. Use the provided <c>adsl-setup</c>
276 zhen 1.6 script to configure your connection. You will be prompted for the ethernet
277     device that is connected to your adsl modem, your username and password,
278     the IPs of your DNS servers, and if you need a basic firewall or not. </p>
279 jhhudso 1.81 <pre caption="Configuring PPPoE">
280 zhen 1.6 # <c> adsl-setup </c>
281     # <c> adsl-start </c>
282 jhhudso 1.81 </pre>
283 drobbins 1.70 <p>If something goes wrong, double-check that you correctly typed
284 zhen 1.6 your username and password by looking at <path>/etc/ppp/pap-secrets</path> or
285     <path>/etc/ppp/chap-secrets</path>, and make sure you are using the right ethernet device. </p>
286 zhen 1.16 </body>
287     </section>
288     <section>
289     <title> Automatic Network Configuration </title>
290     <body>
291 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>
292 jhhudso 1.81 <pre caption="Net-Setup Script">
293 drobbins 1.1 # <c>net-setup eth0</c>
294 jhhudso 1.81 </pre>
295 drobbins 1.70 <p>Of course, if you prefer, you may still set up networking manually. This is covered next.</p>
296 zhen 1.16 </body>
297     </section>
298     <section>
299     <title>Manual DHCP Configuration</title>
300     <body>
301     <p>Network configuration is simple with DHCP; If your ISP is not using
302     DHCP, skip down to the static configuration section below. </p>
303 jhhudso 1.81 <pre caption="Network configuration with DHCP">
304     # <c>dhcpcd eth0</c>
305     </pre>
306 zhen 1.16 <note>Some ISPs require you to provide a hostname. To do that,
307 zhen 1.6 add a <c>-h myhostname</c> flag to the dhcpcd command line above.
308     </note>
309 zhen 1.16 <p>If you receive <i>dhcpConfig</i> warnings, don't panic; the errors
310 zhen 1.6 are most likely cosmetic. Skip down to Network testing below.</p>
311 zhen 1.16 </body>
312     </section>
313     <section>
314     <title>Manual Static Configuration</title>
315     <body>
316     <p>We need to setup just enough networking so that we can download
317 zhen 1.6 sources for the system build, as well as the required localhost interface.
318     Type in the following commands, replacing
319     $IFACE with your network interface (typically <c>eth0</c>), $IPNUM
320     with your IP address, $BCAST with your broadcast address, and $NMASK
321     with your network mask. For the <c>route</c> command, replace
322     $GTWAY with your default gateway.
323     </p>
324 jhhudso 1.81 <pre caption="Static IP Network Configuration">
325 drobbins 1.1 # <c>ifconfig $IFACE $IPNUM broadcast $BCAST netmask $NMASK</c>
326     # <c>/sbin/route add -net default gw $GTWAY netmask 0.0.0.0 metric 1</c>
327 jhhudso 1.81 </pre>
328 jhhudso 1.75 <p>Now it is time to create the <path>/etc/resolv.conf</path>
329 zhen 1.6 file so that name resolution (finding Web/FTP sites by name, rather than just by IP address) will work.</p>
330 jhhudso 1.75 <p>Here is a template to follow for creating your /etc/resolv.conf file: </p>
331 jhhudso 1.81 <pre caption="/etc/resolv.conf template">
332 drobbins 1.1 domain mydomain.com
333     nameserver 10.0.0.1
334     nameserver 10.0.0.2
335 jhhudso 1.81 </pre>
336 zhen 1.16 <p>Replace <c>10.0.0.1</c> and <c>10.0.0.2</c> with the IP addresses of your
337 zhen 1.6 primary and secondary DNS servers respectively.</p>
338 zhen 1.16 </body>
339     </section>
340     <section>
341     <title>Proxy Configuration</title>
342     <body>
343     <p>If you are behind a proxy, it is necessary to configure your proxy before
344 zhen 1.6 you continue. We will export some variables to set up the proxy accordingly.
345     </p>
346 jhhudso 1.81 <pre caption="Setting a Proxy">
347 zhen 1.16 # <c>export http_proxy=&quot;machine.company.com:1234&quot; </c>
348 seo 1.42 # <c>export ftp_proxy=&quot;$http_proxy&quot; </c>
349     # <c>export RSYNC_PROXY=&quot;$http_proxy&quot; </c>
350 jhhudso 1.81 </pre>
351 zhen 1.16 </body>
352     </section>
353 drobbins 1.70 <section>
354 zhen 1.16 <title>Networking is go!</title>
355     <body>
356 seemant 1.78 <p>Networking should now be configured and usable. You should be able to use the included
357 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>
358 zhen 1.16 </body>
359     </section>
360     </chapter>
361     <chapter>
362 jhhudso 1.81 <title>Setting your system's date and time</title>
363     <section>
364     <body>
365     <p>Now you need to set your system's date and time.
366     You can do this using the <c>date</c> command.</p>
367     <pre caption="Setting your system's date">
368     # <c>date</c>
369     Thu Feb 27 09:04:42 CST 2003
370     <comment>(If your date is wrong, set your date with this next command)</comment>
371     # <c>date 022709042003</c>
372     <comment>(date MMDDhhmmCCYY)</comment>
373     </pre>
374     </body>
375     </section>
376     </chapter>
377     <chapter>
378 drobbins 1.86 <title>Filesystems, partitions and block devices</title>
379 zhen 1.16 <section>
380 drobbins 1.86 <title>Introduction to block devices</title>
381 zhen 1.16 <body>
382 drobbins 1.86 <p>
383     In this section, we'll take a good look at disk-oriented aspects of Gentoo Linux and Linux in general, including
384 peesh 1.99 Linux filesystems, partitions and block devices. Then, once you're familiar with the ins and outs of disks and
385 drobbins 1.86 filesystems, you'll be guided through the process of setting up partitions and filesystems for your Gentoo Linux
386     install.
387     </p>
388     <p>
389     To begin, I'll introduce "block devices". The most famous block device is
390     probably the one that represents the first IDE drive in a Linux system:
391     </p>
392     <pre caption="/dev/hda, the block device representing the primary master IDE drive in your system">
393     /dev/hda
394     </pre>
395    
396     <p>
397     If your system uses SCSI drives, then your first hard drive will be:
398     </p>
399    
400     <pre caption="/dev/sda, the block device representing the first logical SCSI drive in your system">
401     /dev/sda
402     </pre>
403    
404     <p>The block devices above represent an <i>abstract</i> interface to the disk.
405     User programs can use these block devices to interact with your disk without
406     worrying about whether your drivers are IDE, SCSI or something else. The
407     program can simply address the storage on the disk as a bunch of contiguous,
408     randomly-accessible 512-byte blocks. </p>
409     </body>
410     </section>
411     <section>
412     <title>Partitions and fdisk</title>
413     <body>
414     <p> Under Linux, we create filesystems by using a special command called
415     <c>mkfs</c> (or <c>mke2fs</c>, <c>mkreiserfs</c>, etc,) specifying a particular
416     block device as a command-line argument. </p>
417    
418     <p> However, although it is theoretically possible to use a "whole disk" block
419     device (one that represents the <i>entire</i> disk) like <c>/dev/hda</c> or
420     <c>/dev/sda</c> to house a single filesystem, this is almost never done in
421     practice. Instead, full disk block devices are split up into smaller, more
422 peesh 1.99 manageable block devices called "partitions". Partitions are created using a
423 drobbins 1.86 tool called <c>fdisk</c>, which is used to create and edit the partition table
424     that's stored on each disk. The partition table defines exactly how to split
425     up the full disk. </p>
426    
427     <p> We can take a look at a disk's partition table by running <c>fdisk</c>,
428     specifying a block device that represents a full disk as an argument: </p>
429    
430     <note>Alternate interfaces to the disk's partition table include <c>cfdisk</c>,
431     <c>parted</c> and <c>partimage</c></note>
432    
433     <pre caption="Starting up fdisk">
434     # fdisk /dev/hda
435     </pre>
436     <p>
437     or
438     </p>
439     <pre caption="Starting up fdisk to look at the partition table on /dev/sda">
440     # fdisk /dev/sda
441     </pre>
442    
443     <impo>
444     <b>Note that you should <i>not</i> save or make any changes to a disk's
445     partition table if any of its partitions contain filesystems that are in use or
446     contain important data. Doing so will generally cause data on the disk to be
447     lost.</b>
448     </impo>
449    
450     <p>
451     Once in fdisk, you'll be greeted with a prompt that looks like this:
452     </p>
453    
454     <pre caption="The fdisk prompt">
455     Command (m for help):
456     </pre>
457    
458    
459     <p>
460     Type <c>p</c> to display your disk's current partition configuration:
461     </p>
462    
463     <pre caption="An example partition configuration">
464     Command (m for help): p
465    
466     Disk /dev/hda: 240 heads, 63 sectors, 2184 cylinders
467     Units = cylinders of 15120 * 512 bytes
468    
469     Device Boot Start End Blocks Id System
470     /dev/hda1 1 14 105808+ 83 Linux
471     /dev/hda2 15 49 264600 82 Linux swap
472     /dev/hda3 50 70 158760 83 Linux
473     /dev/hda4 71 2184 15981840 5 Extended
474     /dev/hda5 71 209 1050808+ 83 Linux
475     /dev/hda6 210 348 1050808+ 83 Linux
476     /dev/hda7 349 626 2101648+ 83 Linux
477     /dev/hda8 627 904 2101648+ 83 Linux
478     /dev/hda9 905 2184 9676768+ 83 Linux
479    
480     Command (m for help):
481     </pre>
482    
483     <p> This particular disk is configured to house seven Linux filesystems (each
484     with a corresponding partition listed as "Linux") as well as a swap partition
485     (listed as "Linux swap"). </p>
486    
487     <p>
488     Notice the name of the corresponding partition block
489     devices on the left hand side, starting with <c>/dev/hda1</c> and going up to
490     <c>/dev/hda9</c>. In the early days of the PC, partitioning software only
491     allowed a maximum of four partitions (called "primary" partitions). This was
492     too limiting, so a workaround called an <i>extended partitioning</i> was
493     created. An extended partition is very similar to a primary partition, and
494     counts towards the primary partition limit of four. However, extended
495     partitions can hold any number of so-called <i>logical</i> partitions inside
496     them, providing an effective means of working around the four partition limit.
497     </p>
498    
499     <p>
500     All partitions <c>hda5</c> and higher are logical partitions. The numbers 1
501     through 4 are reserved for primary or extended partitions. </p>
502    
503     <p> So, In our example, <c>hda1</c> through <c>hda3</c> are primary partitions.
504     <c>hda4</c> is an extended partition that contains logical partitions
505 drobbins 1.87 <c>hda5</c> through <c>hda9</c>. You would never actually
506 drobbins 1.86 <i>use</i> <c>/dev/hda4</c> for storing any filesystems directly -- it simply
507     acts as a container for partitions <c>hda5</c> through <c>hda9</c>. </p>
508    
509     <p> Also, notice that each partition has an "Id", also called a "partition
510     type". Whenever you create a new partition, you should ensure that the
511     partition type is set correctly. '83' is the correct partition type for
512     partitions that will be housing Linux filesystems, and '82' is the correct
513     partition type for Linux swap partitions. You set the partition type using the
514     <c>t</c> option in <c>fdisk</c>. The Linux kernel uses the partition type
515 peesh 1.99 setting to auto-detect filesystems and swap devices on the disk at boot-time.
516 drobbins 1.86 </p>
517     </body>
518     </section>
519     <section>
520     <title>Using fdisk to set up partitions</title>
521     <body>
522    
523 drobbins 1.87 <p>Now that you've had your introduction to the way disk partitioning is
524 drobbins 1.86 done under Linux, it's time to walk you through the process of setting up disk
525     partitions for your Gentoo Linux installation. After we walk you through the
526     process of creating partitions on your disk, your partition configuration will
527     look like this: </p>
528    
529     <pre caption="The partition configuration that you will have after following these steps">
530     Disk /dev/hda: 30.0 GB, 30005821440 bytes
531     240 heads, 63 sectors/track, 3876 cylinders
532     Units = cylinders of 15120 * 512 = 7741440 bytes
533    
534     Device Boot Start End Blocks Id System
535     /dev/hda1 * 1 14 105808+ 83 Linux
536     /dev/hda2 15 81 506520 82 Linux swap
537     /dev/hda3 82 3876 28690200 83 Linux
538    
539     Command (m for help):
540     </pre>
541    
542     <p>In our suggested "newbie" partition configuration, we have three partitions.
543     The first one (<c>/dev/hda1</c>) at the beginning of the disk is a small
544     partition called a boot partition. The boot partition's purpose is to hold all
545     the critical data related to booting -- GRUB boot loader information (if you
546     will be using GRUB) as well as your Linux kernel(s). The boot partition gives
547     us a safe place to store everything related to booting Linux. During normal
548     day-to-day Gentoo Linux use, your boot partition should remain <e>unmounted</e>
549 drobbins 1.87 for safety. If you are setting up a SCSI system, your boot partition will
550     likely end up being <c>/dev/sda1</c>.</p>
551 drobbins 1.86
552 drobbins 1.98 <p>It's recommended to have boot partitions (containing everything necessary for
553     the boot loader to work) at the beginning of the disk. While not necessarily
554     required anymore, it is a useful tradition from the days when the lilo boot
555     loader wasn't able to load kernels from filesystems that extended beyond disk
556     cylinder 1024.
557     </p>
558    
559 drobbins 1.86 <p>The second partition (<c>/dev/hda2</c>) is used to for swap space. The
560     kernel uses swap space as virtual memory when RAM becomes low. This partition,
561     relatively speaking, isn't very big either, typically somewhere around 512MB.
562 drobbins 1.87 If you're setting up a SCSI system, this partition will likely end up
563     being called <c>/dev/sda2</c>. </p>
564 drobbins 1.86
565     <p>The third partition (<c>/dev/hda3</c>) is quite large and takes up the rest
566     of the disk. This partition is called our "root" partition and will be used to
567     store your main filesystem that houses Gentoo Linux itself. On a SCSI system,
568     this partition would likely end up being <c>/dev/sda3</c>.</p>
569    
570    
571     <p>Before we partition the disk, here's a quick technical overview of the
572     suggested partition and filesystem configuration to use when installing Gentoo
573     Linux:</p>
574    
575     <table>
576     <tr>
577     <th>Partition</th>
578     <th>Size</th>
579     <th>Type</th>
580     <th>example device</th>
581     </tr>
582     <tr>
583     <ti>boot partition, containing kernel(s) and boot information</ti>
584     <ti>100 Megabytes</ti>
585     <ti>ext2/3 highly recommended (easiest); if ReiserFS then mount with <c>-o notail</c></ti>
586     <ti>/dev/hda1</ti>
587     </tr>
588     <tr>
589     <ti>swap partition (no longer a 128 Megabyte limit, now 2GB)</ti>
590     <ti>Generally, configure a swap area that is between one to two times the size of the physical RAM
591     in your system.</ti>
592     <ti>Linux swap</ti>
593     <ti>/dev/hda2</ti>
594     </tr>
595     <tr>
596     <ti>root partition, containing main filesystem (/usr, /home, etc)</ti>
597     <ti>&gt;=1.5 Gigabytes</ti>
598     <ti>ReiserFS, ext3 recommended; ext2 ok</ti>
599     <ti>/dev/hda3</ti>
600     </tr>
601     </table>
602    
603     <p>OK, now to create the partitions as in the example and table above. First,
604 swift 1.95 enter fdisk by typing <c>fdisk /dev/hda</c> or <c>fdisk /dev/sda</c>,
605 drobbins 1.86 depending on whether you're using IDE or SCSI. Then, type <c>p</c> to view your
606     current partition configuration. Is there anything on the disk that you need
607     to keep? If so, <b>stop now</b>. If you continue with these directions, <b>all
608     existing data on your disk will be erased.</b></p>
609    
610     <impo>Following these instructions below will cause all prior data on your disk
611     to <b>be erased</b>! If there is anything on your drive, please be sure that it
612     is non-critical information that you don't mind losing. Also make sure that you
613     <b>have selected the correct drive</b> so that you don't mistakenly wipe data
614     from the wrong drive.</impo>
615    
616     <p>Now, it's time to delete any existing partitions. To do this, type <c>d</c>
617     and hit Enter. You will then be prompted for the partition number you would like
618     to delete. To delete a pre-existing <c>/dev/hda1</c>, you would type:</p>
619    
620     <pre caption="Deleting a partition">
621     Command (m for help): d
622     Partition number (1-4): 1
623     </pre>
624 zhen 1.54
625 drobbins 1.86 <p>The partition has been scheduled for deletion. It will no longer show up if
626     you type <c>p</c>, but it will not be erased until your changes have been
627     saved. If you made a mistake and want to abort without saving your changes,
628     type <c>q</c> immediately and hit enter and your partition will not be
629     deleted.</p>
630     <!-- NOTE: THis is not sufficient documentation to cover ATA Raid and I just
631     find it confusing, so I'm commenting it out (drobbins)
632     <note>If you are using RAID your partitions will be a little different. You
633 jhhudso 1.75 will have the partitions like this: <path>/dev/ataraid/discX/partY</path> X are
634 drobbins 1.70 the arrays you have made, so if you only have made 1 array, then it will be
635     disc0.Y is the partition number as in <path>/dev/hdaY</path> </note>
636 drobbins 1.86 -->
637     <p>Now, assuming that you do indeed want to wipe out all the partitions on your
638     system, repeatedly type <c>p</c> to print out a partition listing and then type
639     <c>d</c> and the number of the partition to delete it. Eventually, you'll end up
640     with a partition table with nothing in it:</p>
641    
642     <pre caption="An empty partition table">
643     Disk /dev/hda: 30.0 GB, 30005821440 bytes
644     240 heads, 63 sectors/track, 3876 cylinders
645     Units = cylinders of 15120 * 512 = 7741440 bytes
646    
647     Device Boot Start End Blocks Id System
648    
649     Command (m for help):
650     </pre>
651    
652     <p>Now that the in-memory partition table is empty, we're ready to create a
653     boot partition. To do this, type <c>n</c> to create a new partition, then
654     <c>p</c> to tell fdisk you want a primary partition. Then type <c>1</c> to
655     create the first primary partition. When prompted for the first cylinder, hit
656     enter. When prompted for the last cylinder, type <c>+100M</c> to create a
657     partition 100MB in size. You can see output from these steps below:</p>
658    
659     <pre caption="Steps to create our boot partition">
660     Command (m for help): n
661     Command action
662     e extended
663     p primary partition (1-4)
664     p
665     Partition number (1-4): 1
666     First cylinder (1-3876, default 1):
667     Using default value 1
668     Last cylinder or +size or +sizeM or +sizeK (1-3876, default 3876): +100M
669     </pre>
670    
671     <p>Now, when you type <c>p</c>, you should see the following partition printout:</p>
672    
673     <pre caption="Our first partition has been created">
674     Command (m for help): p
675    
676     Disk /dev/hda: 30.0 GB, 30005821440 bytes
677     240 heads, 63 sectors/track, 3876 cylinders
678     Units = cylinders of 15120 * 512 = 7741440 bytes
679    
680     Device Boot Start End Blocks Id System
681     /dev/hda1 1 14 105808+ 83 Linux
682     </pre>
683    
684     <p>Next, let's create the swap partition. To do this, type <c>n</c> to create a
685     new partition, then <c>p</c> to tell fdisk that you want a primary partition. Then
686     type <c>2</c> to create the second primary partition, <c>/dev/hda2</c> in our case.
687     When prompted for the first cylinder, hit enter. When prompted for the last cylinder,
688     type <c>+512M</c> to create a partition 512MB in size. After you've done this, type
689     <c>t</c> to set the partition type, and then type in <c>82</c> to set the partition
690     type to "Linux Swap". After completing these steps, typing <c>p</c> should display
691     a partition table that looks similar to this:</p>
692    
693     <pre caption="Our swap partition has been created">
694     Command (m for help): p
695    
696     Disk /dev/hda: 30.0 GB, 30005821440 bytes
697     240 heads, 63 sectors/track, 3876 cylinders
698     Units = cylinders of 15120 * 512 = 7741440 bytes
699    
700     Device Boot Start End Blocks Id System
701     /dev/hda1 1 14 105808+ 83 Linux
702     /dev/hda2 15 81 506520 82 Linux swap
703     </pre>
704    
705     <p>Finally, let's create the root partition. To do this, type <c>n</c> to
706     create a new partition, then <c>p</c> to tell fdisk that you want a primary
707 zhen 1.93 partition. Then type <c>2</c> to create the second primary partition,
708 drobbins 1.86 <c>/dev/hda3</c> in our case. When prompted for the first cylinder, hit enter.
709     When prompted for the last cylinder, hit enter to create a partition that takes
710     up the rest of the remaining space on your disk. After completing these steps,
711     typing <c>p</c> should display a partition table that looks similar to
712     this:</p>
713    
714     <pre caption="Our root partition has been created">
715     Command (m for help): p
716    
717     Disk /dev/hda: 30.0 GB, 30005821440 bytes
718     240 heads, 63 sectors/track, 3876 cylinders
719     Units = cylinders of 15120 * 512 = 7741440 bytes
720    
721     Device Boot Start End Blocks Id System
722     /dev/hda1 1 14 105808+ 83 Linux
723     /dev/hda2 15 81 506520 82 Linux swap
724     /dev/hda3 82 3876 28690200 83 Linux
725     </pre>
726    
727     <p>
728     Finally, we need to set the "bootable" flag on our boot partition and then write
729     our changes to disk. To tag <c>/dev/hda1</c> as a "bootable" partition, type
730     <c>a</c> at the menu and then type in <c>1</c> for the partition number. If you
731     type <c>p</c> now, you'll now see that <c>/dev/hda1</c> has a <c>*</c> in the "Boot"
732     column. Now, let's write our changes to disk. To do this, type <c>w</c> and hit
733     enter. Your disk partitions are now properly configured for a Gentoo Linux
734     install.
735     </p>
736    
737     <note>If <c>fdisk</c> or <c>cfdisk</c> instruct you to do so, please reboot to
738     allow your system to detect the new partition configuration.</note>
739     </body>
740     </section>
741     <section>
742     <title>Creating filesystems</title>
743     <body>
744     <p>Now that the partitions have been created, it's time to set up filesystems on
745     the boot and root partitions so that they can be mounted and used to store data.
746     We will also configure the swap partition to serve as swap storage.
747     </p>
748    
749     <p>Gentoo Linux supports a variety of different types of filesystems; each type has
750     its strengths and weaknesses and its own set of performance characteristics. Currently,
751     we support the creation of ext2, ext3, XFS, JFS and ReiserFS filesystems.</p>
752    
753     <p>ext2 is the tried and true Linux filesystem but doesn't have metadata
754     journaling, which means that routine ext2 filesystem checks at startup time can
755     be quite time-consuming. There is now quite a selection of newer-generation
756     <i>journaled</i> filesystems that can be checked for consistency very quickly
757     and are thus generally preferred over their non-journaled counterparts.
758     Journaled filesystems prevent long delays when you boot your system and your
759     filesystem happens to be in an <i>inconsistent</i> state.</p>
760    
761     <p>ext3 is the journaled version of the ext2 filesystem, providing metadata
762     journaling for fast recovery in addition to other enhanced journaling modes
763     like full data and ordered data journaling. ext3 is a very good and reliable
764 drobbins 1.88 filesystem. It offers generally decent performance under most conditions.
765     Because it does not extensively employ the use of "trees" in its internal
766     design, it doesn't scale very well, meaning that it is not an ideal choice for
767     very large filesystems, or situations where you will be handling very large
768     files or large quantities of files in a single directory. But when used within
769     its design parameters, ext3 is an excellent filesystem.</p>
770 drobbins 1.86
771     <p>ReiserFS is a B*-tree based filesystem that has very good overall
772     performance and greatly outperforms both ext2 and ext3 when dealing with small
773     files (files less than 4k), often by a factor of 10x-15x. ReiserFS also scales
774     extremely well and has metadata journaling. As of kernel 2.4.18+, ReiserFS is
775     now rock-solid and highly recommended for use both as a general-purpose
776     filesystem and for extreme cases such as the creation of large filesystems, the
777     use of many small files, very large files, and directories containing tens of
778     thousands of files. ReiserFS is the filesystem we recommend by default for all
779     non-boot partitions.</p>
780    
781     <p>XFS is a filesystem with metadata journaling that is fully supported under
782     Gentoo Linux's <path>xfs-sources</path> kernel. It comes with a robust
783     feature-set and is optimized for scalability. We only recommend using this
784     filesystem on Linux systems with high-end SCSI and/or fibre channel storage and
785     a uninterruptible power supply. Because XFS aggressively caches in-transit data
786     in RAM, improperly designed programs (those that don't take proper precautions
787     when writing files to disk, and there are quite a few of them) can lose a good
788     deal of data if the system goes down unexpectedly.</p>
789    
790     <p>JFS is IBM's own high performance journaling filesystem. It has recently
791     become production-ready, and there hasn't been a sufficient track record to
792     comment either positively nor negatively on its general stability at this
793     point.</p>
794    
795     <p>If you're looking for the most rugged journaling filesystem, use ext3. If
796     you're looking for a good general-purpose high-performance filesystem with
797     journaling support, use ReiserFS; both ext3 and ReiserFS are mature,
798     refined and recommended for general use.</p>
799    
800     <!-- Corner case, confusing
801 drobbins 1.70 <p>But before creating filesystems, you may want to initialize the
802 jhhudso 1.81 beginning of your partition using <c>dd</c> if you are using a pre-existing partition that has been used before.
803 drobbins 1.70 This is particularly helpful when you're going to create a new XFS filesystem on a partition that previously contained
804     a ReiserFS filesystem. Doing this will ensure that your new filesystem
805 seemant 1.78 will not be mis-identified by Linux's filesystem auto-detection code.
806 drobbins 1.21 This can be done as follows:
807 zhen 1.6 </p>
808 jhhudso 1.81 <pre caption="Initializing first 1024 bytes of your partition">
809     # <c>dd if=/dev/zero of=/dev/hda3 bs=1k count=1</c>
810     <comment>(Replace /dev/hda3 with the partition you wish to &quot;clean.&quot;)</comment>
811     </pre>
812     <warn>The command above will destroy all data from <path>/dev/hda3</path>.
813 zhware 1.43 Be careful and check twice which partition you specify for zeroing.
814     If you make a mistake it might result in a loss of data.
815     </warn>
816 drobbins 1.86 -->
817    
818     <p>Based on our example above, we will use the following commands to initialize
819     all our partitions for use:</p>
820    
821     <pre caption="Initializing our partitions (example)">
822     # mke2fs -j /dev/hda1
823     # mkswap /dev/hda2
824     # mkreiserfs /dev/hda3
825     </pre>
826    
827 drobbins 1.98 <p>We choose ext3 for our <c>/dev/hda1</c> boot partition because it is a
828     robust journaling filesystem supported by all major boot loaders. We used
829     <c>mkswap</c> for our <c>/dev/hda2 </c> swap partition -- the choice is obvious
830     here. And for our main root filesystem on <c>/dev/hda3</c> we choose ReiserFS,
831     since it is a solid journaling filesystem offering excellent performance. Now,
832     go ahead and initialize your partitions.</p>
833    
834     <p>For your reference, here are the various <c>mkfs</c>-like commands available
835     during the installation process:</p>
836 drobbins 1.86
837 drobbins 1.89 <p><c>mkswap</c> is the command that is used to initialize swap partitions:</p>
838 jhhudso 1.81 <pre caption="Initializing Swap">
839 drobbins 1.1 # <c>mkswap /dev/hda2</c>
840 jhhudso 1.81 </pre>
841 drobbins 1.89 <p>You can use the <c>mke2fs</c> command to create ext2 filesystems:</p>
842 jhhudso 1.81 <pre caption="Creating an ext2 Filesystem">
843 drobbins 1.1 # <i>mke2fs /dev/hda1</i>
844 jhhudso 1.81 </pre>
845 drobbins 1.86 <p>If you would like to use ext3, you can create ext3 filesystems using
846 drobbins 1.89 <c>mke2fs -j</c>:</p>
847 drobbins 1.86 <pre caption="Creating an ext3 Filesystem">
848     # <c>mke2fs -j /dev/hda3</c>
849     </pre>
850     <note>You can find out more about using ext3 under Linux 2.4 at
851     <uri>http://www.zip.com.au/~akpm/linux/ext3/ext3-usage.html</uri>.</note>
852 drobbins 1.89 <p>To create ReiserFS filesystems, use the <c>mkreiserfs</c> command:</p>
853 drobbins 1.86 <pre caption="Creating a ReiserFS Filesystem">
854     # <c>mkreiserfs /dev/hda3</c>
855     </pre>
856 drobbins 1.89 <p>To create an XFS filesystem, use the <c>mkfs.xfs</c> command:</p>
857 jhhudso 1.81 <pre caption="Creating a XFS Filesystem">
858 drobbins 1.1 # <c>mkfs.xfs /dev/hda3</c>
859 jhhudso 1.81 </pre>
860     <note>You may want to add a couple of additional flags to the
861     <c>mkfs.xfs</c> command: <c>-d agcount=3 -l size=32m</c>.
862     The <c>-d agcount=3</c> command will lower the number of allocation groups.
863     XFS will insist on using at least 1 allocation group per 4 GB of your
864     partition, so, for example, if you have a 20 GB partition you will need
865     a minimum agcount of 5. The <c>-l size=32m</c> command increases the
866     journal size to 32 Mb, increasing performance.</note>
867 drobbins 1.86
868 drobbins 1.89 <p>To create JFS filesystems, use the <c>mkfs.jfs</c> command:</p>
869 jhhudso 1.81 <pre caption="Creating a JFS Filesystem">
870 zhen 1.50 # <c>mkfs.jfs /dev/hda3</c>
871 jhhudso 1.81 </pre>
872 zhen 1.16 </body>
873     </section>
874     </chapter>
875     <chapter>
876     <title>Mount Partitions</title>
877     <section>
878     <body>
879 drobbins 1.86 <p>Now, we will activate our newly-initialized swap volume, since we may need the additional virtual memory that it
880 zhen 1.6 provides later:
881     </p>
882 jhhudso 1.81 <pre caption="Activating Swap">
883 drobbins 1.1 # <c>swapon /dev/hda2</c>
884 jhhudso 1.81 </pre>
885 drobbins 1.86
886 jhhudso 1.75 <p>Next, we will create the <path>/mnt/gentoo</path> and <path>/mnt/gentoo/boot</path> mount points,
887 zhen 1.93 and we will mount our filesystems to these mount points. Once our boot and root filesystems are
888 drobbins 1.86 mounted, any files we copy or create inside <path>/mnt/gentoo</path> will be placed on our new filesystems.
889     Note that if you are setting up Gentoo
890     Linux with separate <path>/usr</path> or <path>/var</path> filesystems, these would get mounted to
891     <path>/mnt/gentoo/usr</path> and <path>/mnt/gentoo/var</path> respectively.
892     </p>
893    
894     <impo>If your <e>boot</e> partition (the one holding the kernel) is ReiserFS, be sure to mount it
895     with the <c>-o notail</c> option so GRUB gets properly installed. Make sure
896     that <c>notail</c> ends up in your new <path>/etc/fstab</path> boot partition entry, too.
897     We will get to that in a bit.
898     </impo>
899    
900 jhhudso 1.81 <pre caption="Creating Mount Points">
901 drobbins 1.1 # <c>mkdir /mnt/gentoo</c>
902     # <c>mount /dev/hda3 /mnt/gentoo</c>
903     # <c>mkdir /mnt/gentoo/boot</c>
904     # <c>mount /dev/hda1 /mnt/gentoo/boot</c>
905 jhhudso 1.81 </pre>
906 drobbins 1.86
907     <impo>If you are having problems mounting your boot partition with ext2, try using
908 zhen 1.6 <c>mount /dev/hXX /mnt/gentoo/boot -t ext2 </c> </impo>
909 zhen 1.16 </body>
910     </section>
911     </chapter>
912     <chapter>
913 drobbins 1.86 <title>Stage tarballs and chroot</title>
914 zhen 1.16 <section>
915 drobbins 1.86 <title>Selecting the desired stage tarball</title>
916 zhen 1.16 <body>
917 zhen 1.55
918 drobbins 1.86 <p>
919     Now, you need to decide which one you would like to use as a
920     basis for the install if you haven't already.</p>
921    
922     <p>If you are using the &quot;from scratch, build everything&quot; install
923     method, you will want to use the <path>stage1-x86-1.4_rc3.tar.bz2</path> image.
924     If you're using one of our bigger CDs like the "3stages" ISO, you will also
925     have a choice of a stage2 and stage3 image. These images allow you to save
926     time at the expense of configurability (we've already chosen compiler
927     optimizations and default USE variables for you.) The stages on the CD are
928     accessible at <path>/mnt/cdrom/gentoo</path>, and you can type <c>ls /mnt/cdrom/gentoo</c>
929     to see what's available on your CD.</p>
930    
931     <p>If you would like to perform an install using a stage tarball that is
932     <i>not</i> on your CD , this is still possible, but you'll need to download the
933     stage you want using the following instructions. If you already have the stage
934     tarball you want to use (most users), then proceed to the "Extracting the stage
935     tarball" section.</p>
936    
937 jhhudso 1.81 <pre caption="Downloading Required Stages">
938 drobbins 1.1 # <c>cd /mnt/gentoo</c>
939 zhware 1.47 <comment>Use lynx to get the URL for your tarball:</comment>
940 zhen 1.80 # <c>lynx http://www.ibiblio.org/pub/Linux/distributions/gentoo/releases/1.4_rc3/x86/</c>
941 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
942     Highlight the appropriate stage you want to download
943     Press <c>d</c> which will initiate the download
944     Save the file and quit the browser
945    
946     <b>OR</b> use wget from the command line:</comment>
947     # <c>wget <comment>insert URL to the required stage tarball here.</comment></c>
948 jhhudso 1.81 </pre>
949 zhen 1.16 </body>
950     </section>
951     <section>
952 drobbins 1.86 <title>Extracting the stage tarball</title>
953 zhen 1.16 <body>
954 drobbins 1.86
955     <p>Now it is time to extract the compressed stage tarball of your choice to
956     <path>/mnt/gentoo/</path>. Remember, you only need to unpack <b>one</b> stage
957     tarball, either a stage1, stage2 or stage3. So, if you wanted to perform a
958     stage3 install of Gentoo, then you would just unpack the stage3 tarball.
959     Unpack the stage tarball as follows:</p>
960    
961     <impo>Be sure to use the <c>p</c> option with <c>tar</c>. Forgetting to do this will
962     cause certain files to have incorrect permissions.</impo>
963    
964 jhhudso 1.81 <pre caption="Unpacking the Stages">
965 drobbins 1.1 # <c>cd /mnt/gentoo</c>
966 drobbins 1.86 <comment>Change "stage3" to "stage2" or "stage1" if you want to start from these stages instead.</comment>
967     <comment>If you downloaded your stage tarball, change the path below to begin with "/mnt/gentoo/"
968     instead of "/mnt/cdrom/gentoo/".</comment>
969 drobbins 1.90 # <c>tar -xvjpf /mnt/cdrom/gentoo/stage3-*.tar.bz2</c>
970 drobbins 1.86 </pre>
971    
972     <p>If you downloaded your stage tarball to <path>/mnt/gentoo</path>, you can now delete it by typing
973 drobbins 1.90 <c>rm /mnt/gentoo/stage*.tar.bz2</c>.</p>
974 drobbins 1.86 </body>
975     </section>
976     <section>
977     <title>Entering the chroot</title>
978     <body>
979     <p>
980     Next, we will <c>chroot</c> over to the new Gentoo Linux build installation to &quot;enter&quot; the new
981     Gentoo Linux system.
982     </p>
983    
984     <pre caption="Prepping and entering the chroot environment">
985 drobbins 1.94 # <c>mount -t proc proc /mnt/gentoo/proc</c>
986 drobbins 1.1 # <c>cp /etc/resolv.conf /mnt/gentoo/etc/resolv.conf</c>
987     # <c>chroot /mnt/gentoo /bin/bash</c>
988     # <c>env-update</c>
989     Regenerating /etc/ld.so.cache...
990     # <c>source /etc/profile</c>
991 jhhudso 1.81 <comment>(The above points your shell to the new paths and updated binaries.)</comment>
992     </pre>
993 drobbins 1.86 <p>After you execute these commands, you will be &quot;inside&quot; your new Gentoo Linux environment in <path>/mnt/gentoo</path>.
994     We can perform the rest of the installation process inside the chroot.
995     </p>
996 zhen 1.16 </body>
997     </section>
998     </chapter>
999     <chapter>
1000 jhhudso 1.75 <title>Getting the Current Portage Tree using sync</title>
1001 zhen 1.16 <section>
1002     <body>
1003 drobbins 1.86
1004     <p>Now, you will need to run <c>emerge sync</c>. This command tells Portage to download
1005     the most recent copy of the Gentoo Linux Portage tree.
1006     The Portage tree
1007 drobbins 1.94 contains all the scripts (called ebuilds) used to build every package
1008 zhen 1.93 under Gentoo Linux. Currently, we have ebuild scripts for close to 4000 packages. Once <c>emerge sync</c>
1009 drobbins 1.86 completes, you will have a complete Portage tree in <path>/usr/portage</path>.</p>
1010    
1011 jhhudso 1.81 <pre caption="Updating Using sync">
1012 zhen 1.6 # <c>emerge sync</c>
1013 drobbins 1.86 </pre>
1014 zhen 1.60
1015 zhen 1.16 </body>
1016     </section>
1017     </chapter>
1018     <chapter>
1019     <title>Setting Gentoo optimizations (make.conf)</title>
1020     <section>
1021     <body>
1022 drobbins 1.86
1023     <p>Now that you have a working copy of the Portage tree, it is time to
1024     customize the optimization and optional build-time settings to use on your
1025     Gentoo Linux system. Portage will use these settings when compiling any
1026     programs for you. To do this, edit the file <path>/etc/make.conf</path>. In
1027     this file, you should set your <c>USE</c> flags, which specify optional
1028     functionality that you would like to be built into packages if available;
1029     generally, the defaults (an <e>empty</e> or unset <c>USE</c> variable) are
1030     fine. More information on <c>USE</c> flags can be found <uri
1031     link="http://www.gentoo.org/doc/en/use-howto.xml">here</uri>. A complete list
1032     of current USE flags can be found <uri
1033     link="http://www.gentoo.org/dyn/use-index.xml">here</uri>. </p>
1034    
1035     <p>You also should set appropriate <c>CHOST</c>, <c>CFLAGS</c> and
1036     <c>CXXFLAGS</c> settings for the kind of system that you are creating
1037     (commented examples can be found further down in the file.) These settings
1038     will be used to tell the C and C++ compiler how to optimize the code that
1039     is generated on your system. It is common for users with Athlon XP processors
1040     to specify a "-march=athlon-xp" setting in their CFLAGS and CXXFLAGS settings
1041     so that all packages built will be optimized for the instruction set and
1042     performance characteristics of their CPU, for example. The <path>/etc/make.conf</path>
1043     file contains a general guide for the proper settings of CFLAGS and CXXFLAGS.</p>
1044 drobbins 1.70
1045 drobbins 1.86 <p>If necessary, you can also set proxy information here if you are behind a
1046     firewall. Use the following command to edit <path>/etc/make.conf</path> using <c>nano</c>,
1047     a simple visual editor.
1048     </p>
1049 jhhudso 1.81 <pre caption="Setting make.conf Options">
1050     # <c>nano -w /etc/make.conf</c>
1051 drobbins 1.86 <comment>(Edit CHOST, CFLAGS, CXXFLAGS and any necessary USE or proxy settings)</comment>
1052 jhhudso 1.81 </pre>
1053 zhen 1.16 <note>
1054 jhhudso 1.75 People who need to substantially customize the build process should take a look at
1055 zhen 1.6 the <path>/etc/make.globals</path> file. This file comprises gentoo defaults and
1056 drobbins 1.70 should never be touched. If the defaults do not suffice, then new values should
1057 zhen 1.6 be put in <path>/etc/make.conf</path>, as entries in <path>make.conf</path>
1058     <comment>override</comment> the entries in <path>make.globals</path>. If you're
1059 jhhudso 1.75 interested in customizing USE settings, look in <path>/etc/make.profile/make.defaults</path>.
1060 zhen 1.16 If you want to turn off any USE settings found here, add an appropriate <c>USE=&quot;-foo&quot;</c>
1061 drobbins 1.86 in <path>/etc/make.conf</path> to turn off any <c>foo</c> USE setting enabled by default
1062     in <path>/etc/make.globals</path> or <path>/etc/make.profile/make.defaults</path>.
1063 zhen 1.6 </note>
1064 zhen 1.16 </body>
1065     </section>
1066     </chapter>
1067     <chapter>
1068 zhen 1.18 <title>Starting from Stage1</title>
1069 zhen 1.16 <section>
1070     <body>
1071 drobbins 1.86 <note>If you are not starting from a stage1 tarball, skip this section.</note>
1072 jhhudso 1.75 <p>The stage1 tarball is for complete customization and optimization. If you have picked this tarball,
1073 drobbins 1.86 you are most likely looking to have an uber-optimized and up-to-date system. Have fun, because optimization
1074 drobbins 1.70 is what Gentoo Linux is all about! Installing from a stage1 takes a lot of time, but the result
1075     is a system that has been optimized from the ground up for your specific machine and needs.
1076 zhen 1.18 </p>
1077 jhhudso 1.75 <p>Now, it is time to start the &quot;bootstrap&quot; process. This process takes about two hours on
1078 peesh 1.99 my 1200MHz AMD Athlon system.
1079 drobbins 1.86 During this time, the GNU C library, compiler suite and other key system programs will be built. Start the bootstrap
1080     as follows:</p>
1081 jhhudso 1.81 <pre caption="Bootstrapping">
1082 drobbins 1.1 # <c>cd /usr/portage</c>
1083     # <c>scripts/bootstrap.sh</c>
1084 jhhudso 1.81 </pre>
1085 zhen 1.16 <p>The &quot;bootstrap&quot; process will now begin.
1086 zhen 1.6 </p>
1087 zhen 1.16 <note>
1088 zhen 1.6 Portage by default uses <c>/var/tmp</c> during package building, often
1089     using several hundred megabytes of temporary storage. If you would like to
1090     change where Portage stores these temporary files, set a new PORTAGE_TMPDIR <e>before</e>
1091     starting the bootstrap process, as follows:
1092     </note>
1093 jhhudso 1.81 <pre caption="Changing Portage's Storage Path">
1094 zhen 1.16 # <c>export PORTAGE_TMPDIR=&quot;/otherdir/tmp&quot;</c>
1095 jhhudso 1.81 </pre>
1096 zhen 1.16 <p><c>bootstrap.sh</c> will build <c>binutils</c>, <c>gcc</c>, <c>gettext</c>,
1097 zhen 1.6 and <c>glibc</c>, rebuilding <c>binutils</c>, <c>gcc</c>, and <c>gettext</c>
1098     after <c>glibc</c>. Needless to say, this process takes a while.
1099 jhhudso 1.75 Once this process completes, your system will be equivalent to a &quot;stage2&quot; system,
1100 zhen 1.33 which means you can now move on to the stage2 instructions.
1101 zhen 1.6 </p>
1102 zhen 1.16 </body>
1103     </section>
1104     </chapter>
1105     <chapter>
1106 drobbins 1.86 <title>Starting from Stage2 and continuing Stage1</title>
1107 zhen 1.16 <section>
1108     <body>
1109 drobbins 1.86
1110     <note>This section is for those continuing a stage1 install or starting at stage2. If
1111     this is not you (ie. you're using a stage3,) then skip this section.
1112     </note>
1113    
1114     <p>The stage2 tarball already has the bootstrapping done for you. All that you have
1115 zhen 1.18 to do is install the rest of the system.
1116 zhen 1.6 </p>
1117 jhhudso 1.81 <pre caption="Installing the Rest of the System">
1118 drobbins 1.1 # <c>emerge -p system</c>
1119 jhhudso 1.81 <comment>(lists the packages to be installed)</comment>
1120 drobbins 1.1 # <c>emerge system</c>
1121 jhhudso 1.81 </pre>
1122 jhhudso 1.75 <p>It is going to take a while
1123 zhen 1.6 to finish building the entire base system. Your reward is that it will be
1124     thoroughly optimized for your system. The drawback is that you have to find a
1125 zhen 1.16 way to keep yourself occupied for some time to come. The author suggests &quot;Star
1126 zhen 1.37 Wars - Super Bombad Racing&quot; for the PS2.
1127     </p>
1128     <p>When this process completes, your system will be the equivalent of a stage3 system. You have
1129     a couple of choices on how to continue
1130     at this point. You can move onto the stage3 instructions and complete those. Doing that will
1131     get your system right up to date with what is in the current Portage tree. This is not necessary,
1132 jhhudso 1.75 but it is highly recommended.
1133 zhen 1.18 </p>
1134     </body>
1135     </section>
1136     </chapter>
1137     <chapter>
1138     <title>Starting from Stage3</title>
1139     <section>
1140     <body>
1141 drobbins 1.86 <note>This section is for those <b>starting</b> with stage3, and not for those who have started
1142     with stage1 or stage2 who should skip this section.</note>
1143     <p>The stage3 tarball provides a fully-functional basic Gentoo system, so no building is required.
1144     However, since the stage3 tarball is pre-built, it may be slightly out-of-date. If this is a concern
1145     for you, you can update your stage3 to contain the most up-to-date versions of all system packages
1146     by performing the following steps. Note that this could take a long time if your stage3 is very old;
1147     otherwise, this process will generally be quick and will allow you to benefit from the very latest
1148     Gentoo updates and fixes.
1149     In any case, feel free to skip these
1150     steps and proceed to the next section if you like.
1151     </p>
1152 zhen 1.57
1153 jhhudso 1.81 <pre caption="Getting up-to-date">
1154 drobbins 1.86 # <c>export CONFIG_PROTECT="-*"</c>
1155     # <c>emerge -up system</c>
1156     <comment>(lists the packages that would be installed)</comment>
1157     # <c>emerge -u system</c>
1158     <comment>(actually merges the packages)</comment>
1159     # <c>unset CONFIG_PROTECT</c>
1160 jhhudso 1.81 </pre>
1161 seemant 1.79 </body>
1162     </section>
1163     </chapter>
1164     <chapter>
1165 jhhudso 1.81 <title>Setting your time zone</title>
1166 seemant 1.79 <section>
1167     <body>
1168 jhhudso 1.81 <p>Now you need to set your time zone.</p>
1169     <p>Look for your time zone (or GMT if you are using Greenwich Mean Time)
1170     in <path>/usr/share/zoneinfo</path>. Then, make a symbolic link to
1171     /etc/localtime by typing:</p>
1172     <pre caption="Creating a symbolic link for time zone">
1173 seemant 1.79 # <c>ln -sf /usr/share/zoneinfo/path/to/timezonefile /etc/localtime</c>
1174 jhhudso 1.81 </pre>
1175 zhen 1.16 </body>
1176     </section>
1177     </chapter>
1178     <chapter>
1179 zhen 1.61 <title>Installing the kernel and a System Logger</title>
1180 zhen 1.16 <section>
1181     <body>
1182     <note>
1183 zhen 1.6 If you haven't done so, please edit <path>/etc/make.conf</path> to your flavor.
1184     </note>
1185 jhhudso 1.75 <p>You now need to merge Linux kernel sources. Here are the ones we currently
1186 zhen 1.6 offer:
1187     </p>
1188 zhen 1.16 <table>
1189     <tr>
1190     <th>ebuild</th>
1191     <th>description</th>
1192     </tr>
1193     <tr>
1194     <ti>
1195     <path>gentoo-sources</path>
1196     </ti>
1197 drobbins 1.21 <ti>Our own performance and functionality-enhanced kernel does not include XFS support.</ti>
1198 zhen 1.16 </tr>
1199     <tr>
1200     <ti>
1201     <path>xfs-sources</path>
1202     </ti>
1203 drobbins 1.21 <ti>Highly-compatible kernel with XFS support.</ti>
1204 zhen 1.16 </tr>
1205     <tr>
1206     <ti>
1207     <path>openmosix-sources</path>
1208     </ti>
1209     <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>
1210     </tr>
1211     <tr>
1212     <ti>
1213     <path>usermode-sources</path>
1214     </ti>
1215     <ti>A stock Linux kernel source tree patched with support for User-Mode Linux. (&quot;Linux inside Linux&quot; technology)</ti>
1216     </tr>
1217     <tr>
1218     <ti>
1219     <path>vanilla-sources</path>
1220     </ti>
1221 jhhudso 1.75 <ti>A stock Linux kernel source tree, just like you would get from kernel.org</ti>
1222 zhen 1.16 </tr>
1223     </table>
1224 drobbins 1.21 <warn>
1225     If you are configuring your own kernel, be careful with the <i>grsecurity</i> option. Being too aggressive with your
1226     security settings can cause certain programs (such as X) to not run properly. If in doubt, leave it out.
1227 zhen 1.6 </warn>
1228 drobbins 1.21 <p>Choose a kernel and then merge as follows:</p>
1229 jhhudso 1.81 <pre caption="Emerging Kernel Sources">
1230 drobbins 1.1 # <c>emerge sys-kernel/gentoo-sources</c>
1231 jhhudso 1.81 </pre>
1232 jhhudso 1.75 <p>Once you have a Linux kernel source tree available, it is time to compile your own custom kernel.
1233 zhen 1.6 </p>
1234 zhen 1.38 <p>Please note that <path>/usr/src/linux</path> is a symlink to your current emerged kernel source package,
1235 jhhudso 1.75 and is set automatically by Portage at emerge time.
1236 zhen 1.38 If you have multiple kernel source packages, it is necessary to set the <path>/usr/src/linux</path> symlink
1237     to the correct one before proceeding.
1238     </p>
1239 jhhudso 1.81 <pre caption="Compiling the Linux Kernel">
1240 drobbins 1.1 # <c>cd /usr/src/linux</c>
1241     # <c>make menuconfig</c>
1242     # <c>make dep &amp;&amp; make clean bzImage modules modules_install</c>
1243     # <c>cp /usr/src/linux/arch/i386/boot/bzImage /boot</c>
1244 jhhudso 1.81 </pre>
1245 zhen 1.16 <warn>For your kernel to function properly, there are several options that you will
1246 zhen 1.6 need to ensure are in the kernel proper -- that is, they should <i>be enabled and not
1247 jhhudso 1.81 compiled as modules</i>. Be sure to enable &quot;ReiserFS&quot; if you have
1248     any ReiserFS partitions; the same goes for &quot;Ext3&quot;. If you're using XFS, enable the
1249     &quot;SGI XFS filesystem support&quot; option. It's always a good idea to leave ext2
1250     enabled whether you are using it or not. Below are some common options that you will need:</warn>
1251     <pre caption="make menuconfig options">
1252     Code maturity level options ---&gt;
1253     [*] Prompt for development and/or incomplete code/drivers&quot;
1254     <comment>(You need this to enable some of the options below.)</comment>
1255     ...
1256    
1257     File systems ---&gt;
1258     &lt;*&gt; Reiserfs support
1259     <comment>(Only needed if you are using reiserfs.)</comment>
1260     ...
1261     &lt;*&gt; Ext3 journalling file system support
1262     <comment>(Only needed if you are using ext3.)</comment>
1263     ...
1264     [*] Virtual memory file system support (former shm fs)
1265     <comment>(Required for Gentoo Linux.)</comment>
1266     ...
1267     &lt;*&gt; JFS filesystem support
1268     <comment>(Only needed if you are using JFS.)</comment>
1269     ...
1270     [*] /proc file system support
1271     <comment>(Required for Gentoo Linux.)</comment>
1272     [*] /dev file system support (EXPERIMENTAL)
1273     [*] Automatically mount at boot
1274     <comment>(Required for Gentoo Linux.)</comment>
1275     [ ] /dev/pts file system for Unix98 PTYs
1276     <comment>(Uncheck this, it is NOT needed.)</comment>
1277     ...
1278     &lt;*&gt; Second extended fs support
1279     <comment>(Only needed if you are using ext2.)</comment>
1280     ...
1281     &lt;*&gt; XFS filesystem support
1282     <comment>(Only needed if you are using XFS.)</comment>
1283     </pre>
1284 zhen 1.16 <p>If you are using hardware RAID you will need to enable a couple more options in the kernel:
1285 zhen 1.6 For Highpoint RAID controllers select hpt366 chipset support, support for IDE RAID controllers and Highpoint
1286     370 software RAID.For Promise RAID controllers select PROMISE PDC202{46|62|65|67|68|69|70} support,
1287     support for IDE RAID
1288     controllers and Support Promise software RAID (Fasttrak(tm))
1289     </p>
1290 zhen 1.16 <p>If you use PPPoE to connect to Internet, you will need the following
1291 zhen 1.6 options in the kernel (built-in or as preferably as modules) :
1292 zhen 1.16 &quot;PPP (point-to-point protocol) support&quot;, &quot;PPP support for async serial ports&quot;,
1293     &quot;PPP support for sync tty ports&quot;. The two compression options won't harm but
1294     are not definitely needed, neither does the &quot;PPP over Ethernet&quot; option,
1295 zhen 1.6 that might only be used by <i>rp-pppoe</i> when configured to do kernel mode PPPoE.
1296     </p>
1297 zhen 1.16 <p>If you have an IDE cd burner, then you need to enable SCSI emulation in the
1298     kernel. Turn on &quot;ATA/IDE/MFM/RLL support&quot; ---&gt; &quot;IDE, ATA and ATAPI Block
1299     devices&quot; ---&gt; &quot;SCSI emulation support&quot; (I usually make it a module), then
1300     under &quot;SCSI support&quot; enable &quot;SCSI support&quot;, &quot;SCSI CD-ROM support&quot; and
1301     &quot;SCSI generic support&quot; (again, I usually compile them as modules). If you
1302     also choose to use modules, then <c>echo -e &quot;ide-scsi\nsg\nsr_mod&quot;
1303     &gt;&gt; /etc/modules.autoload</c> to have them automatically added at boot time.
1304 zhen 1.6 </p>
1305 zhen 1.16 <note>
1306 zhen 1.6 For those who prefer it,
1307     it is now possible to install Gentoo Linux with a 2.2 kernel.
1308 drobbins 1.21 However, doing this comes at a price:
1309 zhen 1.6 you will lose many of the nifty features that
1310     are new to the 2.4 series kernels (such as XFS and tmpfs
1311     filesystems, iptables, and more), although the 2.2 kernel sources can be
1312 drobbins 1.21 patched with ReiserFS and devfs support.
1313     Gentoo linux boot scripts require either tmpfs or ramdisk support in the kernel, so
1314 zhen 1.6 2.2 kernel users need to make sure that ramdisk support is compiled in (ie, not a module).
1315     It is <comment>vital</comment> that a <e>gentoo=notmpfs</e> flag be added to the kernel
1316 peesh 1.85 line in <path>/boot/grub/grub.conf</path> or to the append line in <path>/etc/lilo.conf</path> for the 2.2 kernel so
1317     that a ramdisk is mounted for the boot scripts instead of tmpfs. If you choose not to use devfs, then
1318 zhen 1.6 <e>gentoo=notmpfs,nodevfs</e> should be used instead.
1319     </note>
1320 zhen 1.16 <p>Your new custom kernel (and modules) are now installed. Now you need to choose a system
1321 zhen 1.6 logger that you would like to install. We offer sysklogd, which is the traditional set
1322     of system logging daemons. We also have msyslog and syslog-ng as well as metalog. Power users seem
1323     to gravitate away from sysklogd (not very good performance) and towards the
1324     newer alternatives.
1325     If in doubt, you may want to try metalog, since it seems to be quite popular.
1326     To merge your logger of choice, type <e>one</e> of the next four lines:
1327     </p>
1328 jhhudso 1.81 <pre caption="Emerging System Logger of Choice">
1329 drobbins 1.1 # <c>emerge app-admin/sysklogd</c>
1330     # <c>rc-update add sysklogd default</c>
1331     <comment>or</comment>
1332     # <c>emerge app-admin/syslog-ng</c>
1333     # <c>rc-update add syslog-ng default</c>
1334     <comment>or</comment>
1335     # <c>emerge app-admin/metalog</c>
1336     # <c>rc-update add metalog default</c>
1337     <comment>or</comment>
1338     # <c>emerge app-admin/msyslog</c>
1339     # <c>rc-update add msyslog default</c>
1340 jhhudso 1.81 </pre>
1341 zhen 1.16 <impo>
1342 zhen 1.6 Metalog flushes output to the disk in blocks, so messages aren't immediately recorded into
1343     the system logs. If you are trying to debug a daemon, this performance-enhancing behavior
1344     is less than helpful. When your Gentoo Linux system is up and running, you can send
1345     metalog a USR1 signal to temporarily turn off this message buffering (meaning that
1346     <i>tail -f <path>/var/log/everything/current</path></i> will now work
1347     in real time, as expected),
1348     and a USR2 signal to turn buffering back on
1349 zhen 1.39 again. If you want to disable buffering permanently, you can change METALOG_OPTS="-B" to METALOG_OPTS="-B -s"
1350     in <path>/etc/conf.d/metalog</path>.
1351 zhen 1.6 </impo>
1352 jhhudso 1.75 <p>Now, you may optionally choose a cron package that you would like to use.
1353     Right now, we offer dcron, fcron and vcron. If you do not know which one to choose,
1354 zhen 1.6 you might as well grab vcron. They can be installed as follows:
1355     </p>
1356 jhhudso 1.81 <pre caption="Choosing a CRON Daemon">
1357 drobbins 1.1 # <c>emerge sys-apps/dcron</c>
1358 jhhudso 1.81 # <c>rc-update add dcron default</c>
1359 drobbins 1.1 # <c>crontab /etc/crontab</c>
1360     <comment>or</comment>
1361     # <c>emerge sys-apps/fcron</c>
1362 jhhudso 1.81 # <c>rc-update add fcron default</c>
1363 drobbins 1.1 # <c>crontab /etc/crontab</c>
1364     <comment>or</comment>
1365     # <c>emerge sys-apps/vcron</c>
1366 jhhudso 1.81 # <c>rc-update add vcron default</c>
1367     <comment>You do not need to run <c>crontab /etc/crontab</c> if using vcron.</comment>
1368     </pre>
1369     <p>For more information on starting programs and daemons at startup, see the
1370 drobbins 1.21 <uri link="/doc/en/rc-scripts.xml">rc-script guide</uri>.
1371 zhen 1.6 </p>
1372 zhen 1.16 </body>
1373     </section>
1374     </chapter>
1375     <chapter>
1376 zhen 1.61 <title>Installing miscellany necessary packages</title>
1377 zhen 1.16 <section>
1378     <body>
1379     <p>If you need rp-pppoe to connect to the net, be aware that at this point
1380 zhen 1.6 it has not been installed. It would be the good time to do it. </p>
1381 jhhudso 1.81 <pre caption="Installing rp-pppoe">
1382 zhen 1.40 # <c>USE="-X" emerge rp-pppoe</c>
1383 jhhudso 1.81 </pre>
1384 zhen 1.40
1385     <note>The <i>USE="-X"</i> prevents pppoe from installing its optional X interface, which is a good thing,
1386     because X and its dependencies would also be emerged. You can always recompile <i>rp-pppoe</i> with
1387     X support later.
1388     </note>
1389 zhen 1.16 <note> Please note that the rp-pppoe is built but not configured.
1390 zhen 1.6 You will have to do it again using <c>adsl-setup</c> when you boot into your Gentoo system
1391     for the first time.
1392     </note>
1393 zhen 1.16 <p>You may need to install some additional packages in the Portage tree
1394 zhen 1.6 if you are using any optional features like XFS, ReiserFS or LVM. If you're
1395 zhen 1.50 using XFS, you should emerge the <c>xfsprogs</c> package:
1396 zhen 1.6 </p>
1397 jhhudso 1.81 <pre caption="Emerging Filesystem Tools">
1398 drobbins 1.1 # <c>emerge sys-apps/xfsprogs</c>
1399 jhhudso 1.75 <comment>If you would like to use ReiserFS, you should emerge the ReiserFS tools: </comment>
1400 zhen 1.50 # <c>emerge sys-apps/reiserfsprogs</c>
1401 jhhudso 1.75 <comment>If you would like to use JFS, you should emerge the JFS tools: </comment>
1402 zhen 1.50 # <c>emerge jfsutils</c>
1403 drobbins 1.1 <comment>If you're using LVM, you should emerge the <c>lvm-user</c> package: </comment>
1404 drobbins 1.21 # <c>emerge sys-apps/lvm-user</c>
1405 jhhudso 1.81 </pre>
1406 zhen 1.16 <p>If you're a laptop user and wish to use your PCMCIA slots on your first
1407 jhhudso 1.75 real reboot, you will want to make sure you install the <i>pcmcia-cs</i> package.
1408 zhen 1.6 </p>
1409 jhhudso 1.81 <pre caption="Emerging PCMCIA-cs">
1410 drobbins 1.1 # <c>emerge sys-apps/pcmcia-cs</c>
1411 jhhudso 1.81 </pre>
1412 zhen 1.16 <warn>You will have to re-emerge <i>pcmcia-cs</i> after installation to get PCMCIA
1413 zhen 1.10 to work.
1414     </warn>
1415 zhen 1.16 </body>
1416     </section>
1417     </chapter>
1418     <chapter>
1419 zhen 1.61 <title>Modifying /etc/fstab for your machine</title>
1420 zhen 1.16 <section>
1421     <body>
1422     <p>Your Gentoo Linux system is almost ready for use. All we need to do now is configure
1423 jhhudso 1.75 a few important system files and install the boot loader.
1424 zhen 1.6 The first file we need to
1425     configure is <path>/etc/fstab</path>. Remember that you should use
1426     the <c>notail</c> option for your boot partition if you chose to create a ReiserFS filesystem on it.
1427     Remember to specify <c>ext2</c>, <c>ext3</c> or <c>reiserfs</c> filesystem types as appropriate.
1428     </p>
1429 zhen 1.16 <p>Use something like the <path>/etc/fstab</path> listed below, but of course be sure to replace &quot;BOOT&quot;,
1430     &quot;ROOT&quot; and &quot;SWAP&quot; with the actual block devices you are using (such as <c>hda1</c>, etc.)</p>
1431 jhhudso 1.81 <pre caption="Editing fstab">
1432     <comment># /etc/fstab: static file system information.
1433 drobbins 1.1 #
1434 zhware 1.31 # noatime turns off atimes for increased performance (atimes normally aren't
1435 drobbins 1.1 # needed; notail increases performance of ReiserFS (at the expense of storage
1436 jhhudso 1.75 # efficiency). It is safe to drop the noatime options if you want and to
1437 drobbins 1.1 # switch between notail and tail freely.
1438    
1439 seemant 1.78 # &lt;fs&gt; &lt;mount point&gt; &lt;type&gt; &lt;opts&gt; &lt;dump/pass&gt;
1440 drobbins 1.1
1441     # NOTE: If your BOOT partition is ReiserFS, add the notail option to opts.
1442     </comment>
1443     /dev/BOOT /boot ext2 noauto,noatime 1 2
1444     /dev/ROOT / ext3 noatime 0 1
1445     /dev/SWAP none swap sw 0 0
1446     /dev/cdroms/cdrom0 /mnt/cdrom iso9660 noauto,ro 0 0
1447     proc /proc proc defaults 0 0
1448 jhhudso 1.81 </pre>
1449 jhhudso 1.75 <warn>Please notice that <i>/boot</i> is NOT mounted at boot time.
1450 zhen 1.6 This is to protect the data in <i>/boot</i> from
1451     corruption. If you need to access <i>/boot</i>, please mount it!
1452     </warn>
1453 zhen 1.16 </body>
1454     </section>
1455     </chapter>
1456     <chapter>
1457 zhen 1.61 <title>Setting the Root Password</title>
1458 zhen 1.16 <section>
1459     <body>
1460     <p>Before you forget, set the root password by typing: </p>
1461 jhhudso 1.81 <pre caption="Setting the root Password">
1462 zhen 1.16 # <c>passwd</c>
1463 jhhudso 1.81 </pre>
1464 zhen 1.56
1465     <p>You will also want to add a non-root user for everyday use. Please consult
1466     the <uri link="http://www.gentoo.org/doc/en/faq.xml">Gentoo FAQ</uri>.
1467     </p>
1468 zhen 1.16 </body>
1469     </section>
1470     </chapter>
1471     <chapter>
1472 zhen 1.61 <title>Setting your Hostname</title>
1473 zhen 1.16 <section>
1474     <body>
1475     <p>Edit this file so that it contains your fully-qualified domain name on a single line,
1476 zhen 1.6 i.e. <c>mymachine.mydomain.com</c>.
1477     </p>
1478 jhhudso 1.81 <pre caption="Configuring Hostname">
1479 zhen 1.16 # <c>echo mymachine.mydomain.com &gt; /etc/hostname</c>
1480 jhhudso 1.81 </pre>
1481 zhen 1.16 </body>
1482     </section>
1483     </chapter>
1484     <chapter>
1485 zhen 1.61 <title>Modifying /etc/hosts</title>
1486 zhen 1.16 <section>
1487     <body>
1488 peesh 1.99 <p>This file contains a list of IP addresses and their associated hostnames.
1489 jhhudso 1.75 It is used by the system to resolve the IP addresses
1490     of any hostnames that may not be in your nameservers. Here is a template for this file:
1491 zhen 1.6 </p>
1492 jhhudso 1.81 <pre caption="Hosts Template">
1493 drobbins 1.1 127.0.0.1 localhost
1494     <comment># the next line contains your IP for your local LAN, and your associated machine name</comment>
1495     192.168.1.1 mymachine.mydomain.com mymachine
1496 jhhudso 1.81 </pre>
1497 zhen 1.16 <note>If you are on a DHCP network, it might be helpful to set <i>localhost</i> to your machine's
1498 zhen 1.6 actual hostname. This will help GNOME and many other programs in name resolution.
1499     </note>
1500 zhen 1.16 </body>
1501     </section>
1502     </chapter>
1503     <chapter>
1504     <title>Final Network Configuration</title>
1505     <section>
1506     <body>
1507     <p>Add the names of any modules that are necessary for the proper functioning of your system to
1508 zhen 1.6 <path>/etc/modules.autoload</path> file (you can also add any options you
1509     need to the same line.) When Gentoo Linux boots, these modules will be automatically
1510     loaded. Of particular importance is your ethernet card module, if you happened to compile
1511     it as a module:
1512     </p>
1513 jhhudso 1.81 <pre caption="/etc/modules.autoload"><comment>This is assuming that you are using a 3com card.
1514     Check <path>/lib/modules/`uname -r`/kernel/drivers/net</path> for your card. </comment>
1515 drobbins 1.1 3c59x
1516 jhhudso 1.81 </pre>
1517 zhen 1.16 <p>Edit the <path>/etc/conf.d/net</path> script to get your network configured for your
1518 zhen 1.6 first boot: </p>
1519 jhhudso 1.81 <pre caption="Boot time Network Configuration">
1520 drobbins 1.1 # <c>nano -w /etc/conf.d/net</c>
1521     # <c>rc-update add net.eth0 default</c>
1522 jhhudso 1.81 </pre>
1523 zhen 1.16 <p>If you have multiple network cards you need to create additional <path>net.eth<comment>x</comment></path>
1524 zhen 1.6 scripts for each one (<comment>x</comment> = 1, 2, ...): </p>
1525 jhhudso 1.81 <pre caption="Multiple Network Interfaces">
1526 drobbins 1.1 # <c>cd /etc/init.d</c>
1527     # <c>cp net.eth0 net.eth<comment>x</comment></c>
1528     # <c>rc-update add net.eth<comment>x</comment> default</c>
1529 jhhudso 1.81 </pre>
1530 zhen 1.16 <p>If you have a PCMCIA card installed, have a quick look into
1531 zhen 1.6 <path>/etc/init.d/pcmcia</path> to verify that things seem all right for your setup,
1532 zhen 1.45 then add this line to the top of <path>/etc/init.d/net.ethx</path>:
1533 zhen 1.6 </p>
1534 jhhudso 1.81 <pre caption="PCMCIA depend in /etc/init.d/net.ethx">
1535 drobbins 1.1 depend() {
1536     need pcmcia
1537     }
1538 jhhudso 1.81 </pre>
1539 zhen 1.16 <p>This makes sure that the PCMCIA drivers are autoloaded whenever your network is loaded.
1540 zhen 1.10 </p>
1541 zhen 1.16 </body>
1542     </section>
1543     </chapter>
1544     <chapter>
1545     <title>Final steps: Configure Basic Settings (including the international keymap setting)</title>
1546     <section>
1547     <body>
1548 jhhudso 1.81 <pre caption="Basic Configuration">
1549 drobbins 1.1 # <c>nano -w /etc/rc.conf</c>
1550 jhhudso 1.81 </pre>
1551 zhen 1.16 <p>Follow the directions in the file to configure the basic settings.
1552 zhen 1.6 All users will want to make sure that <c>CLOCK</c> is set to his/her
1553     liking. International keyboard users will want to set the <c>KEYMAP</c>
1554     variable (browse <path>/usr/share/keymaps</path> to see the various
1555     possibilities).
1556     </p>
1557 zhen 1.16 </body>
1558     </section>
1559     </chapter>
1560     <chapter>
1561 zhen 1.61 <title>Configure a Bootloader</title>
1562 zhen 1.49 <section>
1563     <title>Notes</title>
1564     <body>
1565     <p> In the spirit of Gentoo, users now have more than one bootloader to choose from.
1566     Using our virtual package system, users are now able to choose between both GRUB and
1567     LILO as their bootloaders.
1568     </p>
1569     <p> Please keep in mind that having both bootloaders installed is not necessary.
1570 jhhudso 1.75 In fact, it can be a hindrance, so please only choose one.
1571 zhen 1.49 </p>
1572 drobbins 1.69 <impo>If you are installing Gentoo Linux on a system with an NVIDIA nForce or nForce2 chipset
1573     with an integrated GeForce graphics card, you should use LILO and avoid GRUB. With on-board
1574 drobbins 1.70 video enabled, the low memory area of your RAM may be used as video RAM. Since GRUB also uses low
1575     memory at boot time, it may experience an "out of memory" condition. So, if you have an nForce
1576 drobbins 1.69 or potentially other board with on-board video, use LILO. Even if you're using off-board video
1577 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
1578 drobbins 1.69 pinch, wouldn't it? :)</impo>
1579    
1580 zhen 1.49 </body>
1581     </section>
1582 zhen 1.16 <section>
1583 zhen 1.49 <title>Configuring GRUB</title>
1584 zhen 1.16 <body>
1585     <p>The most critical part of understanding GRUB is getting comfortable with how GRUB
1586 zhen 1.6 refers to hard drives and partitions. Your Linux partition <path>/dev/hda1</path> is called
1587     <path>(hd0,0)</path> under GRUB. Notice the parenthesis around the hd0,0 - they are required.
1588 zhen 1.16 Hard drives count from zero rather than &quot;a&quot;, and partitions start at zero rather than one.
1589 zhen 1.6 Be aware too that with the hd devices, only harddrives are counted, not atapi-ide devices such as
1590     cdrom players, burners, and that the same construct can be used with scsi drives.
1591     (Normally they get higher numbers than ide drives except when the bios is configured
1592     to boot from scsi devices.) Assuming you have a harddrive on /dev/hda, a cdrom player on /dev/hdb,
1593 peesh 1.99 a burner on /dev/hdc and a second hard drive on /dev/hdd, for example, and no scsi harddrive
1594 zhen 1.6 <path>/dev/hdd7</path> gets translated to <path>(hd1,6)</path>.
1595    
1596     It might sound tricky, and tricky it is indeed, but as we will see, grub
1597     offers a tab completion mechanism that comes handy for those of you having
1598     a lot of harddrives and partitions and who are a little lost in the
1599     grub numbering scheme. Having gotten the feel for that,
1600 jhhudso 1.75 it is time to install GRUB.
1601 zhen 1.6 </p>
1602 zhen 1.16 <p>The easiest way to install GRUB is to simply type <c>grub</c> at your chrooted shell prompt: </p>
1603 jhhudso 1.81 <pre caption="Installing GRUB">
1604 zhen 1.51 # <c>emerge grub</c>
1605 drobbins 1.1 # <c>grub</c>
1606 jhhudso 1.81 </pre>
1607 zhen 1.16 <impo>If you are using hardware RAID this part will not work at
1608 zhen 1.6 this time.
1609     Skip to the section on making your <path>grub.conf</path>. After that we will complete the
1610     grub setup for RAID controllers
1611     </impo>
1612 jhhudso 1.75 <p>You will be presented with the <c>grub&gt;</c> grub
1613 zhen 1.6 command-line prompt. Now, you need to type in the
1614     right commands to install the GRUB boot record onto your hard drive. In my example configuration,
1615     I want to install the GRUB boot record on my hard drive's MBR (master boot record), so that
1616     the first thing I see when I turn on the computer is the GRUB prompt. In my case, the commands
1617     I want to type are:
1618     </p>
1619 zhen 1.68
1620 jhhudso 1.81 <pre caption="GRUB on the MBR">
1621 zhen 1.68 grub&gt; <c>root (hd0,0)</c> <codenote>Your boot partition</codenote>
1622     grub&gt; <c>setup (hd0)</c> <codenote>Where the boot record is installed, here, it is the MBR</codenote>
1623 jhhudso 1.81 </pre>
1624 zhen 1.68
1625 jhhudso 1.81 <pre caption="GRUB not on the MBR">
1626 zhen 1.53 <comment>Alternatively, if you wanted to install the bootloader somewhere other than the MBR</comment>
1627 zhen 1.68 grub&gt; <c>root (hd0,0)</c> <codenote>Your boot partition</codenote>
1628     grub&gt; <c>setup (hd0,4)</c> <codenote>Where the boot record is installed, here it is /dev/hda5</codenote>
1629 drobbins 1.1 grub&gt; <c>quit</c>
1630 jhhudso 1.81 </pre>
1631 zhen 1.68
1632 jhhudso 1.75 <p>Here is how the two commands work. The first <c>root ( )</c> command tells GRUB
1633 zhen 1.6 the location of your boot partition (in our example, <path>/dev/hda1</path> or
1634     <path>(hd0,0)</path> in GRUB terminology. Then, the second <c>setup ( )
1635     </c> command tells GRUB where to install the
1636     boot record - it will be configured to look for its special files at the <c>root
1637     ( )</c> location that you specified. In my case, I want the boot record on the
1638     MBR of the hard drive, so I simply specify <path>/dev/hda</path> (also known as <path>(hd0)</path>).
1639     If I were using another boot loader and wanted to set up GRUB as a secondary boot-loader, I
1640     could install GRUB to the boot record of a particular partition. In that case,
1641 jhhudso 1.75 I would specify a particular partition rather than the entire disk. Once the GRUB
1642 zhen 1.6 boot record has been successfully installed, you can type <c>quit</c> to quit GRUB.
1643 zhen 1.52 </p>
1644 zhen 1.6
1645     <note> The tab completion mechanism of grub can be used from within grub,
1646     assuming you wrote <c> root (</c> and that you hit the TAB key, you would
1647     be prompted with a list of the available devices (not only harddrives),
1648     hitting the TAB key having written <c> root (hd</c>, grub would print the
1649     available harddrives and hitting the TAB key after writing <c> root (hd0,</c>
1650     would make grub print the list of partitions on the first harddrive.
1651    
1652     Checking the syntax of the grub location with completion should really help
1653     to make the right choice.
1654     </note>
1655    
1656 zhen 1.52 <p>
1657 zhen 1.6 Gentoo Linux is now
1658     installed, but we need to create the <path>/boot/grub/grub.conf</path> file so that
1659 jhhudso 1.75 we get a nice GRUB boot menu when the system reboots. Here is how to do it.
1660 zhen 1.6 </p>
1661 zhen 1.16 <impo>To ensure backwards compatibility with GRUB, make sure to make a link from
1662 zhen 1.6 <i>grub.conf</i> to <i>menu.lst</i>. You can do this by doing
1663     <c>ln -s /boot/grub/grub.conf /boot/grub/menu.lst </c>. </impo>
1664 zhen 1.16 <p>Now, create the grub.conf file (<c>nano -w /boot/grub/grub.conf</c>), and add the following to it:
1665 zhen 1.6 </p>
1666 jhhudso 1.81 <pre caption="Grub.conf for GRUB">
1667 drobbins 1.1 default 0
1668     timeout 30
1669     splashimage=(hd0,0)/boot/grub/splash.xpm.gz
1670    
1671     title=My example Gentoo Linux
1672     root (hd0,0)
1673 zhen 1.51 kernel (hd0,0)/boot/bzImage root=/dev/hda3
1674 drobbins 1.1
1675 jhhudso 1.81 <comment># Below is for setup using hardware RAID</comment>
1676 drobbins 1.1 title=My Gentoo Linux on RAID
1677     root (hd0,0)
1678 zhen 1.63 kernel (hd0,0)/boot/bzImage root=/dev/ataraid/dXpY
1679 drobbins 1.1
1680     <comment># Below needed only for people who dual-boot</comment>
1681 jhhudso 1.81 title=Windows XP
1682 drobbins 1.1 root (hd0,5)
1683 zhen 1.67 chainloader (hd0,5)+1
1684 jhhudso 1.81 </pre>
1685 zhen 1.16 <note>
1686 zhen 1.6 (hd0,0) should be written without any spaces inside the parentheses.
1687     </note>
1688 zhen 1.16 <impo>
1689 zhen 1.6 If you set up scsi emulation for an IDE cd burner earlier, then to get it to
1690 zhen 1.16 actually work you need to add an &quot;hdx=ide-scsi&quot; fragment to the kernel
1691     line in grub.conf (where &quot;hdx&quot; should be the device for your cd burner).
1692 zhen 1.6 </impo>
1693 zhen 1.16 <p>After saving this file, Gentoo Linux installation is complete. Selecting the first option will
1694 zhen 1.6 tell GRUB to boot Gentoo Linux without a fuss. The second part of the grub.conf file is optional,
1695     and shows you how to use GRUB to boot a bootable Windows partition.
1696     </p>
1697 zhen 1.16 <note>Above, <path>(hd0,0)</path> should point to your &quot;boot&quot; partition
1698 zhen 1.6 (<path>/dev/hda1</path> in our example config) and <path>/dev/hda3</path> should point to
1699     your root filesystem. <path>(hd0,5)</path> contains the NT boot
1700     loader.
1701 zhware 1.9 </note>
1702 zhen 1.16 <note>
1703 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>.
1704 zhen 1.6 </note>
1705 zhen 1.16 <p>If you need to pass any additional options to the kernel, simply
1706 zhen 1.6 add them to the end of the <c>kernel</c> command. We're already passing one option
1707     (<c>root=/dev/hda3</c>), but you can pass others as well. In particular, you can
1708     turn off devfs by default (not recommended unless you know what you're doing) by
1709     adding the <c>gentoo=nodevfs</c> option to the <c>kernel</c> command.
1710     </p>
1711 zhen 1.16 <note>Unlike in earlier versions of Gentoo Linux, you no longer have to add
1712 zhen 1.6 <c>devfs=mount</c> to the end of the <c>kernel</c> line to enable devfs. In rc6
1713     devfs is enabled by default.
1714     </note>
1715 zhen 1.16 </body>
1716     </section>
1717 zhen 1.49 <section>
1718     <title>Configuring LILO</title>
1719 zhen 1.16 <body>
1720 drobbins 1.21 <p>While GRUB may be the new alternative for most people, it is not always the best choice.
1721 jhhudso 1.75 LILO, the LInuxLOader, is the tried and true workhorse of Linux bootloaders. Here is how to install
1722 drobbins 1.21 LILO if you would like to use it instead of GRUB:
1723 zhen 1.16 </p>
1724     <p>The first step is to emerge LILO:
1725     </p>
1726 jhhudso 1.81 <pre caption="Emerging LILO">
1727 zhen 1.16 # <c>emerge lilo</c>
1728 jhhudso 1.81 </pre>
1729 zhen 1.82 <p>Now it is time to configure LILO. Here is a sample configuration file <path>/etc/lilo.conf</path>
1730 zhen 1.16 </p>
1731 jhhudso 1.81 <pre caption="Example lilo.conf">
1732 zhen 1.16 boot=/dev/hda
1733     map=/boot/map
1734     install=/boot/boot.b
1735     prompt
1736     timeout=50
1737     lba32
1738     default=linux
1739    
1740     image=/boot/vmlinuz-2.4.20
1741     label=linux
1742     read-only
1743 zhen 1.82 root=/dev/hda3
1744 zhen 1.16
1745     #For dual booting windows/other OS
1746     other=/dev/hda1
1747     label=dos
1748 jhhudso 1.81 </pre>
1749 zhen 1.52 <ul>
1750 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>
1751     <li><i>map=/boot/map</i> states the map file. In normal use, this should not be modified. </li>
1752     <li><i>install=/boot/boot.b</i> tells LILO to install the specified file as the new boot sector.
1753     In normal use, this should not be altered. If the install line is missing, LILO will
1754     assume a default of /boot/boot.b as the file to be used. </li>
1755 zhen 1.83 <li>The existence of <i>prompt</i> tells LILO to display the classic <i>lilo:</i> prompt at bootup.
1756 zhen 1.16 While it is not recommended that you remove the prompt line, if you do remove it, you can still
1757     get a prompt by holding down the [Shift] key while your machine starts to boot. </li>
1758     <li><i>timeout=50</i> sets the amount of time that LILO will wait for user input before proceeding
1759     with booting the default line entry. This is measured in tenths of a second, with 50 as the default. </li>
1760     <li><i>lba32</i> describes the hard disk geometry to LILO. Another common entry here is linear. You should
1761     not change this line unless you are very aware of what you are doing. Otherwise, you could put
1762     your system in an unbootable state. </li>
1763     <li><i>default=linux</i> refers to the default operating system for LILO to boot from the
1764     options listed below this line. The name linux refers to the label line below in each of the boot options. </li>
1765     <li><i>image=/boot/vmlinuz-2.4.20</i> specifies the linux kernel to boot with this particular boot option. </li>
1766     <li><i>label=linux</i> names the operating system option in the LILO screen. In this case,
1767     it is also the name referred to by the default line. </li>
1768     <li><i>read-only</i> specifies that the root partition (see the root line below) is read-only and cannot be
1769     altered during the boot process. </li>
1770     <li><i>root=/dev/hda5</i> tells LILO what disk partition to use as the root partition. </li>
1771 zhen 1.52 </ul>
1772 zhen 1.16 <p>After you have edited your <i>lilo.conf</i> file, it is time to run LILO to load the information
1773     into the MBR:
1774     </p>
1775 jhhudso 1.81 <pre caption="Running LILO">
1776 zhen 1.16 # <c>/sbin/lilo</c>
1777 jhhudso 1.81 </pre>
1778 zhen 1.16 <p>LILO is configured, and now your machine is ready to boot into Gentoo Linux!
1779     </p>
1780     </body>
1781     </section>
1782     </chapter>
1783     <chapter>
1784 zhen 1.66 <title>Creating Bootdisks</title>
1785 zhen 1.16 <section>
1786     <title>GRUB Bootdisks</title>
1787     <body>
1788 drobbins 1.21 <p>It is always a good idea to make a boot disk the first
1789 zhen 1.16 time you install any Linux distribution. This is a security
1790 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
1791     disk. With these types of hardware RAID,
1792     if you try to install grub from your chrooted shell it will fail. If you are in this camp,
1793     make a GRUB
1794     boot disk, and when you reboot the first time you can install GRUB
1795 zhen 1.6 to the MBR. Make your
1796 jhhudso 1.75 bootdisks like this:
1797 zhen 1.6 </p>
1798 jhhudso 1.81 <pre caption="Creating a GRUB Bootdisk">
1799 drobbins 1.1 # <c>mke2fs /dev/fd0</c>
1800     # <c>mount /dev/fd0 /mnt/floppy</c>
1801     # <c>mkdir -p /mnt/floppy/boot/grub</c>
1802     # <c>cp /usr/share/grub/i386-pc/stage1 /mnt/floppy/boot/grub/</c>
1803     # <c>cp /usr/share/grub/i386-pc/stage2 /mnt/floppy/boot/grub/</c>
1804 zhen 1.66 # <c>umount /mnt/floppy</c>
1805 drobbins 1.1 # <c>grub</c>
1806    
1807     grub&gt; <c>root (fd0)</c>
1808     grub&gt; <c>setup (fd0)</c>
1809     grub&gt; <c>quit</c>
1810 jhhudso 1.81 </pre>
1811 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>
1812 drobbins 1.21 and <c>setup</c> commands.</p>
1813 zhen 1.16 </body>
1814     </section>
1815     <section>
1816     <title>LILO Bootdisks</title>
1817     <body>
1818     <p>If you are using LILO, it is also a good idea to make a bootdisk:
1819     </p>
1820 jhhudso 1.81 <pre caption="Making a LILO Bootdisk">
1821 zhen 1.18 # <c>dd if=/boot/your_kernel of=/dev/fd0 </c>
1822     <comment>This will only work if your kernel is smaller than 1.4MB</comment>
1823 jhhudso 1.81 </pre>
1824 zhen 1.16 </body>
1825     </section>
1826     </chapter>
1827     <chapter>
1828     <title>Installation Complete!</title>
1829     <section>
1830     <body>
1831 jhhudso 1.75 <p>Now, Gentoo Linux is installed. The only remaining step is to update necessary configuration files, exit the chrooted shell,
1832    
1833 zhen 1.6 safely unmount your partitions
1834     and reboot the system:
1835     </p>
1836 jhhudso 1.81 <pre caption="Rebooting the System">
1837 drobbins 1.1 # <c>etc-update</c>
1838     # <c>exit</c>
1839 jhhudso 1.81 <comment>(This exits the chrooted shell; you can also type <c>^D</c>)</comment>
1840 drobbins 1.1 # <c>cd / </c>
1841     # <c>umount /mnt/gentoo/boot</c>
1842     # <c>umount /mnt/gentoo/proc</c>
1843     # <c>umount /mnt/gentoo</c>
1844     # <c>reboot</c>
1845 jhhudso 1.81 </pre>
1846 zhen 1.16 <note>
1847 zhen 1.6 After rebooting, it is a good idea to run the <c>update-modules</c> command to create
1848     the <path>/etc/modules.conf</path> file. Instead of modifying this file directly, you should
1849     generally make changes to the files in <path>/etc/modules.d</path>.
1850     </note>
1851 zhen 1.16 <impo>Remember if you are running hardware RAID, you must
1852 zhen 1.6 use the bootdisk for the first reboot.
1853     then go back and install grub the way everyone else did the first
1854 drobbins 1.21 time. You are done -- congratulations!</impo>
1855 zhen 1.16 <p>If you have any questions or would like to get involved with Gentoo Linux development,
1856 zhen 1.6 consider joining our gentoo-user and gentoo-dev mailing lists
1857 seo 1.84 (more information on our <uri link="http://www.gentoo.org/main/en/lists.xml">mailing lists</uri> page).
1858 zhen 1.6 We also have a handy <uri link="http://www.gentoo.org/doc/en/desktop.xml">Desktop configuration guide</uri>
1859     that will
1860     help you to continue configuring your new Gentoo Linux system, and a useful
1861     <uri link="http://www.gentoo.org/doc/en/portage-user.xml">Portage user guide</uri>
1862     to help familiarize you with Portage basics. You can find the rest of the Gentoo Documentation
1863 zhen 1.16 <uri link="http://www.gentoo.org/main/en/docs.xml">here</uri>. If you have any other questions
1864 zhen 1.10 involving installation or anything for that matter, please check the Gentoo Linux
1865 zhen 1.16 <uri link="http://www.gentoo.org/doc/en/faq.xml">FAQ</uri>.
1866 zhen 1.6 Enjoy and welcome to Gentoo Linux!
1867     </p>
1868 zhen 1.16 </body>
1869     </section>
1870     </chapter>
1871     <chapter>
1872     <title>Gentoo-Stats</title>
1873     <section>
1874     <body>
1875     <p>The Gentoo Linux usage statistics program was started as an attempt to give the developers
1876 zhen 1.6 a way to find out about their user base. It collects information about Gentoo Linux usage to help
1877     us in set priorities our development. Installing it is completely optional, and it would be greatly
1878     appreciated if you decide to use it. Compiled statistics can be viewed at <uri>http://stats.gentoo.org/</uri>.
1879     </p>
1880 zhen 1.16 <p>The gentoo-stats server will assign a unique ID to your system.
1881 zhen 1.6 This ID is used to make sure that each system is counted only once. The ID will not be used
1882 peesh 1.99 to individually identify your system, nor will it be matched against an IP address or
1883 zhen 1.6 other personal information. Every precaution has been taken to assure your privacy in the
1884     development of this system. The following are the things that we are monitoring
1885 zhen 1.16 right now through our &quot;gentoo-stats&quot; program:
1886 zhen 1.6 </p>
1887 zhen 1.16 <ul>
1888     <li>installed packages and their version numbers</li>
1889     <li>CPU information: speed (MHz), vendor name, model name, CPU flags (like &quot;mmx&quot; or &quot;3dnow&quot;)</li>
1890     <li>memory information (total available physical RAM, total available swap space)</li>
1891     <li>PCI cards and network controller chips</li>
1892     <li>the Gentoo Linux profile your machine is using (that is, where the /etc/make.profile link is pointing to).</li>
1893     </ul>
1894     <p>We are aware that disclosure of sensitive information is a threat to most Gentoo Linux users
1895 zhen 1.6 (just as it is to the developers).
1896     </p>
1897 zhen 1.16 <ul>
1898     <li>Unless you modify the gentoo-stats program, it will never transmit sensitive
1899 zhen 1.6 information such as your passwords, configuration data, shoe size...</li>
1900 zhen 1.16 <li>Transmission of your e-mail addresses is optional and turned off by default.</li>
1901     <li>The IP address your data transmission originates from will never be logged
1902     in such a way that we can identify you. There are no &quot;IP address/system ID&quot; pairs.</li>
1903     </ul>
1904     <p>The installation is easy - just run the following commands:
1905 zhen 1.6 </p>
1906 jhhudso 1.81 <pre caption="Installing gentoo-stats">
1907 drobbins 1.1 # <c>emerge gentoo-stats</c> <codenote>Installs gentoo-stats</codenote>
1908     # <c>gentoo-stats --new</c> <codenote>Obtains a new system ID</codenote>
1909 jhhudso 1.81 </pre>
1910 zhen 1.16 <p>The second command above will request a new system ID and enter it into
1911 zhen 1.6 <path>/etc/gentoo-stats/gentoo-stats.conf</path> automatically. You can view this file
1912     to see additional configuration options.
1913     </p>
1914 zhen 1.16 <p>After that, the program should be run on a regular schedule
1915 zhen 1.6 (gentoo-stats does not have to be run as root). Add this line to your <path>crontab</path>:
1916     </p>
1917 jhhudso 1.81 <pre caption="Updating gentoo-stats with cron">
1918     <c>0 0 * * 0,4 /usr/sbin/gentoo-stats --update &gt; /dev/null</c>
1919     </pre>
1920 zhen 1.16 <p>The <c>gentoo-stats</c> program is a simple perl script which can be
1921 jhhudso 1.75 viewed with your favorite pager or editor: <path>/usr/sbin/gentoo-stats</path>. </p>
1922 zhen 1.16 </body>
1923     </section>
1924     </chapter>
1925 drobbins 1.1 </guide>

  ViewVC Help
Powered by ViewVC 1.1.20