Contents of /xml/htdocs/doc/en/gentoo-x86-install.xml

Parent Directory Parent Directory | Revision Log Revision Log

Revision 1.102 - (hide annotations) (download) (as text)
Fri Apr 4 19:35:52 2003 UTC (15 years, 3 months ago) by drobbins
Branch: MAIN
Changes since 1.101: +4 -2 lines
File MIME type: application/xml
OK, committed a fix to clarify the use of -o notail with ReiserFS

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

  ViewVC Help
Powered by ViewVC 1.1.20