Gentoo Archives: gentoo-doc-cvs

From: Xavier Neys <neysx@×××××××××××.org>
To: gentoo-doc-cvs@l.g.o
Subject: [gentoo-doc-cvs] cvs commit: hb-install-x86+amd64-bootloader.xml hb-install-x86+amd64-disk.xml hb-install-x86+amd64-kernel.xml hb-install-x86+amd64-medium.xml
Date: Wed, 02 Aug 2006 21:15:29
Message-Id: 20060802211503.8CCAF644EC@smtp.gentoo.org
1 neysx 06/08/02 21:15:02
2
3 Added: hb-install-x86+amd64-bootloader.xml
4 hb-install-x86+amd64-disk.xml
5 hb-install-x86+amd64-kernel.xml
6 hb-install-x86+amd64-medium.xml
7 Log:
8 Copy of latest x86 files
9
10 Revision Changes Path
11 1.1 xml/htdocs/doc/en/handbook/hb-install-x86+amd64-bootloader.xml
12
13 file : http://sources.gentoo.org/viewcvs.py/gentoo/xml/htdocs/doc/en/handbook/hb-install-x86+amd64-bootloader.xml?rev=1.1&view=markup
14 plain: http://sources.gentoo.org/viewcvs.py/gentoo/xml/htdocs/doc/en/handbook/hb-install-x86+amd64-bootloader.xml?rev=1.1&content-type=text/plain
15
16 Index: hb-install-x86+amd64-bootloader.xml
17 ===================================================================
18 <?xml version='1.0' encoding='UTF-8'?>
19 <!DOCTYPE sections SYSTEM "/dtd/book.dtd">
20
21 <!-- The content of this document is licensed under the CC-BY-SA license -->
22 <!-- See http://creativecommons.org/licenses/by-sa/2.5 -->
23
24 <!-- $Header: /var/cvsroot/gentoo/xml/htdocs/doc/en/handbook/hb-install-x86+amd64-bootloader.xml,v 1.1 2006/08/02 21:15:02 neysx Exp $ -->
25
26 <sections>
27
28 <version>2.13</version>
29 <date>2006-05-28</date>
30
31 <section>
32 <title>Making your Choice</title>
33 <subsection>
34 <title>Introduction</title>
35 <body>
36
37 <p>
38 Now that your kernel is configured and compiled and the necessary system
39 configuration files are filled in correctly, it is time to install a
40 program that will fire up your kernel when you start the system. Such a
41 program is called a <e>bootloader</e>. For x86, Gentoo Linux provides <uri
42 link="#grub">GRUB</uri> and <uri link="#lilo">LILO</uri>. But before we
43 install one of these two bootloaders, we inform you how to configure framebuffer
44 (assuming you want it of course). With framebuffer you can run the Linux command
45 line with (limited) graphical features (such as using the nice bootsplash
46 image Gentoo provides).
47 </p>
48
49 </body>
50 </subsection>
51 <subsection>
52 <title>Optional: Framebuffer</title>
53 <body>
54
55 <p>
56 <e>If</e> you have configured your kernel with framebuffer support (or you used
57 <c>genkernel</c>'s default kernel configuration), you can activate it by adding
58 a <c>vga</c> and/or a <c>video</c> statement to your bootloader configuration
59 file.
60 </p>
61
62 <p>
63 First of all you need to know what type of framebuffer device you're using. If
64 you use a Gentoo patched kernel tree (such as <c>gentoo-sources</c>) you will
65 have had the possibility of selecting <c>vesafb-tng</c> as the <e>VESA driver
66 type</e> (which is default for these kernel sources). If this is the case, you
67 are using <c>vesafb-tng</c> and do not need to set a <c>vga</c> statement.
68 Otherwise you are using the <c>vesafb</c> driver and need to set the <c>vga</c>
69 statement.
70 </p>
71
72 <p>
73 The <c>vga</c> statement controls the resolution and color depth of your
74 framebuffer screen for <c>vesafb</c>. As stated in
75 <path>/usr/src/linux/Documentation/fb/vesafb.txt</path> (which gets installed
76 when you install a kernel source package), you need to pass the VESA number
77 corresponding to the requested resolution and color depth to it.
78 </p>
79
80 <p>
81 The following table lists the available resolutions and colordepths and matches
82 those against the value that you need to pass on to the <c>vga</c> statement.
83 </p>
84
85 <table>
86 <tr>
87 <ti></ti>
88 <th>640x480</th>
89 <th>800x600</th>
90 <th>1024x768</th>
91 <th>1280x1024</th>
92 </tr>
93 <tr>
94 <th>256</th>
95 <ti>0x301</ti>
96 <ti>0x303</ti>
97 <ti>0x305</ti>
98 <ti>0x307</ti>
99 </tr>
100 <tr>
101 <th>32k</th>
102 <ti>0x310</ti>
103 <ti>0x313</ti>
104 <ti>0x316</ti>
105 <ti>0x319</ti>
106 </tr>
107 <tr>
108 <th>64k</th>
109 <ti>0x311</ti>
110 <ti>0x314</ti>
111 <ti>0x317</ti>
112 <ti>0x31A</ti>
113 </tr>
114 <tr>
115 <th>16M</th>
116 <ti>0x312</ti>
117 <ti>0x315</ti>
118 <ti>0x318</ti>
119 <ti>0x31B</ti>
120 </tr>
121 </table>
122
123 <p>
124 The <c>video</c> statement controls framebuffer display options. It needs to be
125 given the framebuffer driver (<c>vesafb</c> for 2.6 kernels, or <c>vesa</c> for
126 2.4 kernels) followed by the control statements you wish to enable. All
127 variables are listed in <path>/usr/src/linux/Documentation/fb/vesafb.txt</path>,
128 but we'll inform you about three most-used options:
129 </p>
130
131 <table>
132 <tr>
133 <th>Control</th>
134 <th>Description</th>
135 </tr>
136 <tr>
137 <ti>ywrap</ti>
138 <ti>
139 Assume that the graphical card can wrap around its memory (i.e. continue at
140 the beginning when it has approached the end)
141 </ti>
142 </tr>
143 <tr>
144 <ti>mtrr:n</ti>
145 <ti>
146 Setup MTRR registers. <c>n</c> can be:
147 0 - disabled
148 1 - uncachable
149 2 - write-back
150 3 - write-combining
151 4 - write-through
152 </ti>
153 </tr>
154 <tr>
155 <ti><c>mode</c></ti>
156 <ti>
157 (<c>vesafb-tng</c> only)<br/>
158 Set up the resolution, color depth and refresh rate. For instance,
159 <c>1024x768-32@85</c> for a resolution of 1024x768, 32 bit color depth and a
160 refresh rate of 85 Hz.
161 </ti>
162 </tr>
163 </table>
164
165 <p>
166 The result of those two statements could be something like <c>vga=0x318
167 video=vesafb:mtrr:3,ywrap</c> or
168 <c>video=vesafb:mtrr:3,ywrap,1024x768-32@85</c>. Remember (or write down) this
169 setting; you will need it shortly.
170 </p>
171
172 <p>
173 Now continue by installing <uri link="#grub">GRUB</uri> <e>or</e> <uri
174 link="#lilo">LILO</uri>.
175 </p>
176
177 </body>
178 </subsection>
179 </section>
180 <section id="grub">
181 <title>Default: Using GRUB</title>
182 <subsection>
183 <title>Understanding GRUB's terminology</title>
184 <body>
185
186 <p>
187 The most critical part of understanding GRUB is getting comfortable with how
188 GRUB refers to hard drives and partitions. Your Linux partition
189 <path>/dev/hda1</path> (for IDE drives) or <path>/dev/sda1</path> (for
190 SATA/SCSI drives) will most likely be called <path>(hd0,0)</path> under GRUB.
191 Notice the parenthesis around the <path>hd0,0</path> - they are required.
192 </p>
193
194 <p>
195 Hard drives count from zero rather than "a" and partitions start at zero
196 rather than one. Be aware too that with the hd devices, only hard drives are
197 counted, not atapi-ide devices such as cdrom players and burners. Also, the
198 same construct is used with SCSI drives. (Normally they get higher numbers
199 than IDE drives except when the BIOS is configured to boot from SCSI devices.)
200 When you ask the BIOS to boot from a different hard disk (for instance your
201 primary slave), <e>that</e> harddisk is seen as <path>hd0</path>.
202 </p>
203
204 <p>
205 Assuming you have a hard drive on <path>/dev/hda</path>, a cdrom player on
206 <path>/dev/hdb</path>, a burner on <path>/dev/hdc</path>, a second hard drive
207 on <path>/dev/hdd</path> and no SCSI hard drive, <path>/dev/hdd7</path> gets
208 translated to <path>(hd1,6)</path>. It might sound tricky and tricky it is
209 indeed, but as we will see, GRUB offers a tab completion mechanism
210 that comes handy for those of you having a lot of hard drives and
211 partitions and who are a little lost in the GRUB numbering scheme.
212 </p>
213
214 <p>
215 Having gotten the feel for that, it is time to install GRUB.
216 </p>
217
218 </body>
219 </subsection>
220 <subsection>
221 <title>Installing GRUB</title>
222 <body>
223
224 <p>
225 To install GRUB, let's first emerge it:
226 </p>
227
228 <pre caption="Installing GRUB">
229 # <i>emerge grub</i>
230 </pre>
231
232 <p>
233 Although GRUB is now installed, we still need to write up a
234 configuration file for it and place GRUB in our MBR so that GRUB automatically
235 boots your newly created kernel. Create <path>/boot/grub/grub.conf</path> with
236 <c>nano</c> (or, if applicable, another editor):
237 </p>
238
239 <pre caption="Creating /boot/grub/grub.conf">
240 # <i>nano -w /boot/grub/grub.conf</i>
241 </pre>
242
243 <p>
244 Now we are going to write up a <path>grub.conf</path>. Below you'll
245 find two possible <path>grub.conf</path> for the partitioning example we use
246 in this guide. We've
247 only extensively commented the first <path>grub.conf</path>. Make sure you use
248 <e>your</e> kernel image filename and, if appropriate, <e>your</e> initrd image
249 filename.
250 </p>
251
252 <ul>
253 <li>
254 The first <path>grub.conf</path> is for people who have not used
255 <c>genkernel</c> to build their kernel
256 </li>
257 <li>
258 The second <path>grub.conf</path> is for people who have used
259 <c>genkernel</c> to build their kernel
260 </li>
261 </ul>
262
263 <note>
264 If your root filesystem is JFS, you <e>must</e> add " ro" to the <c>kernel</c>
265 line since JFS needs to replay its log before it allows read-write mounting.
266 </note>
267
268 <pre caption="grub.conf for non-genkernel users">
269 <comment># Which listing to boot as default. 0 is the first, 1 the second etc.</comment>
270 default 0
271 <comment># How many seconds to wait before the default listing is booted.</comment>
272 timeout 30
273 <comment># Nice, fat splash-image to spice things up :)
274 # Comment out if you don't have a graphics card installed</comment>
275 splashimage=(hd0,0)/boot/grub/splash.xpm.gz
276
277 title=Gentoo Linux 2.6.12-r10
278 <comment># Partition where the kernel image (or operating system) is located</comment>
279 root (hd0,0)
280 kernel /boot/kernel-2.6.12-gentoo-r10 root=/dev/hda3
281
282 <comment># The next four lines are only if you dualboot with a Windows system.</comment>
283 <comment># In this case, Windows is hosted on /dev/hda6.</comment>
284 title=Windows XP
285 rootnoverify (hd0,5)
286 makeactive
287 chainloader +1
288 </pre>
289
290 <pre caption="grub.conf for genkernel users">
291 default 0
292 timeout 30
293 splashimage=(hd0,0)/boot/grub/splash.xpm.gz
294
295 title=Gentoo Linux 2.6.12-r10
296 root (hd0,0)
297 kernel /boot/kernel-genkernel-x86-2.6.12-gentoo-r10 root=/dev/ram0 init=/linuxrc ramdisk=8192 real_root=/dev/hda3 udev
298 initrd /boot/initramfs-genkernel-x86-2.6.12-gentoo-r10
299
300 <comment># Only in case you want to dual-boot</comment>
301 title=Windows XP
302 rootnoverify (hd0,5)
303 makeactive
304 chainloader +1
305 </pre>
306
307 <note>
308 The <c>udev</c> mentioned at the end of the kernel line is needed to work around
309 a bug in some genkernel versions <e>if</e> you use udev in the first place
310 (which is the default behaviour).
311 </note>
312
313 <p>
314 If you used a different partitioning scheme and/or kernel image, adjust
315 accordingly. However, make sure that anything that follows a GRUB-device (such
316 as <path>(hd0,0)</path>) is relative to the mountpoint, not the root. In other
317 words, <path>(hd0,0)/grub/splash.xpm.gz</path> is in reality
318 <path>/boot/grub/splash.xpm.gz</path> since <path>(hd0,0)</path> is
319 <path>/boot</path>.
320 </p>
321
322 <p>
323 Besides, if you chose to use a different partitioning scheme and did not put
324 <path>/boot</path> in a separate partition, the <path>/boot</path> prefix used
325 in the above code samples is really <e>required</e>. If you followed our
326 suggested partitioning plan, the <path>/boot</path> prefix it not required, but
327 a <path>boot</path> symlink makes it work. In short, the above examples should
328 work whether you defined a separate <path>/boot</path> partition or not.
329 </p>
330
331 <p>
332 If you need to pass any additional options to the kernel, simply add
333 them to the end of the kernel command. We're already passing one option
334 (<c>root=/dev/hda3</c> or <c>real_root=/dev/hda3</c>), but you can pass others
335 as well, such as the <c>video</c> and/or <c>vga</c> statements for framebuffer
336 as we discussed previously.
337 </p>
338
339 <p>
340 If you're using a 2.6.7 or higher kernel and you jumpered your harddrive
341 because the BIOS can't handle large harddrives you'll need to append
342 <c>hdx=stroke</c>.
343 </p>
344
345 <p>
346 <c>genkernel</c> users should know that their kernels use the same boot options
347 as is used for the Installation CD. For instance, if you have SCSI devices, you
348 should add <c>doscsi</c> as kernel option.
349 </p>
350
351 <p>
352 Now save the <path>grub.conf</path> file and exit. You still need to install
353 GRUB in the MBR (Master Boot Record) so that GRUB is automatically executed when
354 you boot your system.
355 </p>
356
357 <p>
358 The GRUB developers recommend the use of <c>grub-install</c>. However, if for
359 some reason <c>grub-install</c> fails to work correctly you still have the
360 option to manually install GRUB.
361 </p>
362
363 <p>
364 Continue with <uri link="#grub-install-auto">Default: Setting up GRUB using
365 grub-install</uri> or <uri link="#grub-install-manual">Alternative: Setting up
366 GRUB using manual instructions</uri>.
367 </p>
368
369 </body>
370 </subsection>
371 <subsection id="grub-install-auto">
372 <title>Default: Setting up GRUB using grub-install</title>
373 <body>
374
375 <p>
376 To install GRUB you will need to issue the <c>grub-install</c> command.
377 However, <c>grub-install</c> won't work off-the-shelf since we are inside a
378 chrooted environment. We need to create <path>/etc/mtab</path> which lists all
379 mounted filesystems. Fortunately, there is an easy way to accomplish this -
380 just copy over <path>/proc/mounts</path> to <path>/etc/mtab</path>, excluding
381 the <c>rootfs</c> line if you haven't created a separate boot partition. The
382 following command will work in both cases:
383 </p>
384
385 <pre caption="Creating /etc/mtab">
386 # <i>grep -v rootfs /proc/mounts &gt; /etc/mtab</i>
387 </pre>
388
389 <p>
390 Now we can install GRUB using <c>grub-install</c>:
391 </p>
392
393 <pre caption="Running grub-install">
394 # <i>grub-install /dev/hda</i>
395 </pre>
396
397 <p>
398 If you have more questions regarding GRUB, please consult the <uri
399 link="http://www.gnu.org/software/grub/grub-faq.html">GRUB FAQ</uri> or the <uri
400 link="http://www.gnu.org/software/grub/manual/">GRUB Manual</uri>.
401 </p>
402
403 <p>
404 Continue with <uri link="#reboot">Rebooting the System</uri>.
405 </p>
406
407 </body>
408 </subsection>
409 <subsection id="grub-install-manual">
410 <title>Alternative: Setting up GRUB using manual instructions</title>
411 <body>
412
413 <p>
414 To start configuring GRUB, you type in <c>grub</c>. You'll be presented
415 with the <path>grub&gt;</path> grub command-line prompt. Now, you need to type
416 in the right commands to install the GRUB boot record onto your hard drive.
417 </p>
418
419 <pre caption="Starting the GRUB shell">
420 # <i>grub</i>
421 </pre>
422
423 <note>
424 If your system does not have any floppy drives, add the <c>--no-floppy</c>
425 option to the above command to prevent grub from probing the (non-existing)
426 floppy drives.
427 </note>
428
429 <p>
430 In the example configuration we want to install GRUB so that it reads its
431 information from the boot-partition <path>/dev/hda1</path>, and installs the
432 GRUB boot record on the hard drive's MBR (master boot record) so that the first
433 thing we see when we turn on the computer is the GRUB prompt. Of course, if you
434 haven't followed the example configuration during the installation,
435 change the commands accordingly.
436 </p>
437
438 <p>
439 The tab completion mechanism of GRUB can be used from within GRUB.
440 For instance, if you type in "<c>root (</c>" followed by a TAB, you will
441 be presented with a list of devices (such as <path>hd0</path>). If you
442 type in "<c>root (hd0,</c>" followed by a TAB, you will receive a list
443 of available partitions to choose from (such as <path>hd0,0</path>).
444 </p>
445
446 <p>
447 By using the tab completion, setting up GRUB should be not that hard.
448 Now go on, configure GRUB, shall we? :-)
449 </p>
450
451 <pre caption="Installing GRUB in the MBR">
452 grub&gt; <i>root (hd0,0)</i> <comment>(Specify where your /boot partition resides)</comment>
453 grub&gt; <i>setup (hd0)</i> <comment>(Install GRUB in the MBR)</comment>
454 grub&gt; <i>quit</i> <comment>(Exit the GRUB shell)</comment>
455 </pre>
456
457 <note>
458 If you want to install GRUB in a certain partition instead of the MBR,
459 you have to alter the <c>setup</c> command so it points to the right
460 partition. For instance, if you want GRUB installed in
461 <path>/dev/hda3</path>, then the command becomes <c>setup (hd0,2)</c>.
462 Few users however want to do this.
463 </note>
464
465 <p>
466 If you have more questions regarding GRUB, please consult the <uri
467 link="http://www.gnu.org/software/grub/grub-faq.html">GRUB FAQ</uri> or the <uri
468 link="http://www.gnu.org/software/grub/manual/">GRUB Manual</uri>.
469 </p>
470
471 <note>
472 When you reinstall a kernel, you do not need to copy over the files anymore.
473 Just run <c>make install</c> after compiling the kernel; it will automatically
474 copy the necessary files and adjust the GRUB configuration.
475 </note>
476
477 <p>
478 Continue with <uri link="#reboot">Rebooting the System</uri>.
479 </p>
480
481 </body>
482 </subsection>
483 </section>
484 <section id="lilo">
485 <title>Alternative: Using LILO</title>
486 <subsection>
487 <title>Installing LILO</title>
488 <body>
489
490 <p>
491 LILO, the LInuxLOader, is the tried and true workhorse of Linux
492 bootloaders. However, it lacks some features that GRUB has (which is
493 also the reason why GRUB is currently gaining popularity). The reason
494 why LILO is still used is that, on some systems, GRUB doesn't work and
495 LILO does. Of course, it is also used because some people know LILO and
496 want to stick with it. Either way, Gentoo supports both, and apparently
497 you have chosen to use LILO.
498 </p>
499
500 <p>
501 Installing LILO is a breeze; just use <c>emerge</c>.
502 </p>
503
504 <pre caption = "Installing LILO">
505 # <i>emerge lilo</i>
506 </pre>
507
508 </body>
509 </subsection>
510 <subsection>
511 <title>Configuring LILO</title>
512 <body>
513
514 <p>
515 To configure LILO, you must create <path>/etc/lilo.conf</path>. Fire up
516 your favorite editor (in this handbook we use <c>nano</c> for
517 consistency) and create the file.
518 </p>
519
520 <pre caption = "Creating /etc/lilo.conf">
521 # <i>nano -w /etc/lilo.conf</i>
522 </pre>
523
524 <p>
525 Some sections ago we have asked you to remember the kernel-image name
526 you have created. In the next example <path>lilo.conf</path> we use the
527 example partitioning scheme. There are two separate parts:
528 </p>
529
530 <ul>
531 <li>
532 One for those who have not used <c>genkernel</c> to build their kernel
533 </li>
534 <li>
535 One for those who have used <c>genkernel</c> to build their kernel
536 </li>
537 </ul>
538
539 <p>
540 Make sure you use <e>your</e> kernel image filename and, if appropriate,
541 <e>your</e> initrd image filename.
542 </p>
543
544 <note>
545 If your root filesystem is JFS, you <e>must</e> add a <c>append="ro"</c>
546 line after each boot item since JFS needs to replay its log before it allows
547 read-write mounting.
548 </note>
549
550 <pre caption = "Example /etc/lilo.conf">
551 boot=/dev/hda <comment># Install LILO in the MBR</comment>
552 prompt <comment># Give the user the chance to select another section</comment>
553 timeout=50 <comment># Wait 5 (five) seconds before booting the default section</comment>
554 default=gentoo <comment># When the timeout has passed, boot the "gentoo" section</comment>
555
556 <comment># For non-genkernel users</comment>
557 image=/boot/kernel-2.6.12-gentoo-r10
558 label=gentoo <comment># Name we give to this section</comment>
559 read-only <comment># Start with a read-only root. Do not alter!</comment>
560 root=/dev/hda3 <comment># Location of the root filesystem</comment>
561
562 <comment># For genkernel users</comment>
563 image=/boot/kernel-genkernel-x86-2.6.12-gentoo-r10
564 label=gentoo
565 read-only
566 root=/dev/ram0
567 append="init=/linuxrc ramdisk=8192 real_root=/dev/hda3 udev"
568 initrd=/boot/initramfs-genkernel-2.6.12-gentoo-r10
569
570 <comment># The next two lines are only if you dualboot with a Windows system.</comment>
571 <comment># In this case, Windows is hosted on /dev/hda6.</comment>
572 other=/dev/hda6
573 label=windows
574 </pre>
575
576 <note>
577 The <c>udev</c> mentioned at the end of the append line is needed to work around
578 a bug in some genkernel versions <e>if</e> you use udev in the first place
579 (which is the default behaviour).
580 </note>
581
582 <note>
583 If you use a different partitioning scheme and/or kernel image, adjust
584 accordingly.
585 </note>
586
587 <p>
588 If you need to pass any additional options to the kernel, add an
589 <c>append</c> statement to the section. As an example, we add the
590 <c>video</c> statement to enable framebuffer:
591 </p>
592
593 <pre caption = "Using append to add kernel options">
594 image=/boot/kernel-2.6.12-gentoo-r10
595 label=gentoo
596 read-only
597 root=/dev/hda3
598 <i>append="video=vesafb:mtrr,ywrap,1024x768-32@85"</i>
599 </pre>
600
601 <p>
602 If you're using a 2.6.7 or higher kernel and you jumpered your harddrive
603 because the BIOS can't handle large harddrives you'll need to append
604 <c>hdx=stroke</c>.
605 </p>
606
607 <p>
608 <c>genkernel</c> users should know that their kernels use the same boot options
609 as is used for the Installation CD. For instance, if you have SCSI devices, you
610 should add <c>doscsi</c> as kernel option.
611 </p>
612
613
614 <p>
615 Now save the file and exit. To finish up, you have to run <c>/sbin/lilo</c> so
616 LILO can apply the <path>/etc/lilo.conf</path> to your system (i.e. install
617 itself on the disk). Keep in mind that you'll also have to rerun
618 <c>/sbin/lilo</c> every time you install a new kernel or make any changes to
619 the menu.
620 </p>
621
622 <pre caption = "Finishing the LILO installation">
623 # <i>/sbin/lilo</i>
624 </pre>
625
626 <note>
627 When you reinstall a kernel, you do not need to copy over the files anymore.
628 Just run <c>make install</c> after compiling the kernel; it will automatically
629 copy the necessary files and adjust the LILO configuration.
630 </note>
631
632 <p>
633 You can now continue with <uri link="#reboot">Rebooting the System</uri>.
634 </p>
635
636 </body>
637 </subsection>
638 </section>
639 <section id="reboot">
640 <title>Rebooting the System</title>
641 <subsection>
642 <body>
643
644 <p>
645 Exit the chrooted environment and unmount all mounted partitions. Then type in
646 that one magical command you have been waiting for: <c>reboot</c>.
647 </p>
648
649 <pre caption="Unmounting all partitions and rebooting">
650 # <i>exit</i>
651 cdimage ~# <i>cd</i>
652 cdimage ~# <i>umount /mnt/gentoo/boot /mnt/gentoo/dev /mnt/gentoo/proc /mnt/gentoo</i>
653 cdimage ~# <i>reboot</i>
654 </pre>
655
656 <p>
657 Of course, don't forget to remove the bootable CD, otherwise the CD will be
658 booted again instead of your new Gentoo system.
659 </p>
660
661 <p>
662 Once rebooted in your Gentoo installation, finish up with <uri
663 link="?part=1&amp;chap=11">Finalizing your Gentoo Installation</uri>.
664 </p>
665
666 </body>
667 </subsection>
668 </section>
669 </sections>
670
671
672
673 1.1 xml/htdocs/doc/en/handbook/hb-install-x86+amd64-disk.xml
674
675 file : http://sources.gentoo.org/viewcvs.py/gentoo/xml/htdocs/doc/en/handbook/hb-install-x86+amd64-disk.xml?rev=1.1&view=markup
676 plain: http://sources.gentoo.org/viewcvs.py/gentoo/xml/htdocs/doc/en/handbook/hb-install-x86+amd64-disk.xml?rev=1.1&content-type=text/plain
677
678 Index: hb-install-x86+amd64-disk.xml
679 ===================================================================
680 <?xml version='1.0' encoding='UTF-8'?>
681 <!DOCTYPE sections SYSTEM "/dtd/book.dtd">
682
683 <!-- The content of this document is licensed under the CC-BY-SA license -->
684 <!-- See http://creativecommons.org/licenses/by-sa/2.5 -->
685
686 <!-- $Header: /var/cvsroot/gentoo/xml/htdocs/doc/en/handbook/hb-install-x86+amd64-disk.xml,v 1.1 2006/08/02 21:15:02 neysx Exp $ -->
687
688 <sections>
689
690 <version>2.5</version>
691 <date>2006-01-01</date>
692
693 <section>
694 <title>Introduction to Block Devices</title>
695 <subsection>
696 <title>Block Devices</title>
697 <body>
698
699 <p>
700 We'll take a good look at disk-oriented aspects of Gentoo Linux
701 and Linux in general, including Linux filesystems, partitions and block devices.
702 Then, once you're familiar with the ins and outs of disks and filesystems,
703 you'll be guided through the process of setting up partitions and filesystems
704 for your Gentoo Linux installation.
705 </p>
706
707 <p>
708 To begin, we'll introduce <e>block devices</e>. The most famous block device is
709 probably the one that represents the first IDE drive in a Linux system, namely
710 <path>/dev/hda</path>. If your system uses SCSI or SATA drives, then your
711 first hard drive would be <path>/dev/sda</path>.
712 </p>
713
714 <p>
715 The block devices above represent an abstract interface to the disk. User
716 programs can use these block devices to interact with your disk without worrying
717 about whether your drives are IDE, SCSI or something else. The program can
718 simply address the storage on the disk as a bunch of contiguous,
719 randomly-accessible 512-byte blocks.
720 </p>
721
722 </body>
723 </subsection>
724 <subsection>
725 <title>Partitions</title>
726 <body>
727
728 <p>
729 Although it is theoretically possible to use a full disk to house your Linux
730 system, this is almost never done in practice. Instead, full disk block devices
731 are split up in smaller, more manageable block devices. On x86 systems,
732 these are called <e>partitions</e>.
733 </p>
734
735 <p>
736 Partitions are divided in three types:
737 <e>primary</e>, <e>extended</e> and <e>logical</e>.
738 </p>
739
740 <p>
741 A <e>primary</e> partition is a partition which has its information stored in
742 the MBR (master boot record). As an MBR is very small (512 bytes) only four
743 primary partitions can be defined (for instance, <path>/dev/hda1</path> to
744 <path>/dev/hda4</path>).
745 </p>
746
747 <p>
748 An <e>extended</e> partition is a special primary partition (meaning the
749 extended partition must be one of the four possible primary partitions) which
750 contains more partitions. Such a partition didn't exist originally, but as
751 four partitions were too few, it was brought to life to extend the formatting
752 scheme without losing backward compatibility.
753 </p>
754
755 <p>
756 A <e>logical</e> partition is a partition inside the extended partition. Their
757 definitions aren't placed inside the MBR, but are declared inside the extended
758 partition.
759 </p>
760
761 </body>
762 </subsection>
763 <subsection>
764 <title>Advanced Storage</title>
765 <body>
766
767 <p>
768 The x86 Installation CDs provide support for EVMS and LVM2. EVMS and LVM2
769 increase the flexibility offered by your partitioning setup. During the
770 installation instructions, we will focus on "regular" partitions, but it is
771 still good to know EVMS and LVM2 are supported as well.
772 </p>
773
774 </body>
775 </subsection>
776 </section>
777 <section>
778 <title>Designing a Partitioning Scheme</title>
779 <subsection>
780 <title>Default Partitioning Scheme</title>
781 <body>
782
783 <p>
784 If you are not interested in drawing up a partitioning scheme for your system,
785 you can use the partitioning scheme we use throughout this book:
786 </p>
787
788 <table>
789 <tr>
790 <th>Partition</th>
791 <th>Filesystem</th>
792 <th>Size</th>
793 <th>Description</th>
794 </tr>
795 <tr>
796 <ti><path>/dev/hda1</path></ti>
797 <ti>ext2</ti>
798 <ti>32M</ti>
799 <ti>Boot partition</ti>
800 </tr>
801 <tr>
802 <ti><path>/dev/hda2</path></ti>
803 <ti>(swap)</ti>
804 <ti>512M</ti>
805 <ti>Swap partition</ti>
806 </tr>
807 <tr>
808 <ti><path>/dev/hda3</path></ti>
809 <ti>ext3</ti>
810 <ti>Rest of the disk</ti>
811 <ti>Root partition</ti>
812 </tr>
813 </table>
814
815 <p>
816 If you are interested in knowing how big a partition should be, or even how
817 many partitions you need, read on. Otherwise continue now with partitioning
818 your disk by reading <uri link="#fdisk">Using fdisk to Partition your
819 Disk</uri>.
820 </p>
821
822 </body>
823 </subsection>
824 <subsection>
825 <title>How Many and How Big?</title>
826 <body>
827
828 <p>
829 The number of partitions is highly dependent on your environment. For instance,
830 if you have lots of users, you will most likely want to have your
831 <path>/home</path> separate as it increases security and makes backups easier.
832 If you are installing Gentoo to perform as a mailserver, your
833 <path>/var</path> should be separate as all mails are stored inside
834 <path>/var</path>. A good choice of filesystem will then maximise your
835 performance. Gameservers will have a separate <path>/opt</path> as most gaming
836 servers are installed there. The reason is similar for <path>/home</path>:
837 security and backups. You will definitely want to keep <path>/usr</path> big:
838 not only will it contain the majority of applications, the Portage tree alone
839 takes around 500 Mbyte excluding the various sources that are stored in it.
840 </p>
841
842 <p>
843 As you can see, it very much depends on what you want to achieve. Separate
844 partitions or volumes have the following advantages:
845 </p>
846
847 <ul>
848 <li>
849 You can choose the best performing filesystem for each partition or volume
850 </li>
851 <li>
852 Your entire system cannot run out of free space if one defunct tool is
853 continuously writing files to a partition or volume
854 </li>
855 <li>
856 If necessary, file system checks are reduced in time, as multiple checks can
857 be done in parallel (although this advantage is more with multiple disks than
858 it is with multiple partitions)
859 </li>
860 <li>
861 Security can be enhanced by mounting some partitions or volumes read-only,
862 nosuid (setuid bits are ignored), noexec (executable bits are ignored) etc.
863 </li>
864 </ul>
865
866 <p>
867 However, multiple partitions have one big disadvantage: if not configured
868 properly, you might result in having a system with lots
869 of free space on one partition and none on another. There is also a 15-partition
870 limit for SCSI and SATA.
871 </p>
872
873 <p>
874 As an example partitioning, we show you one for a 20GB disk, used as a
875 demonstration laptop (containing webserver, mailserver, gnome, ...):
876 </p>
877
878 <pre caption="Filesystem usage example">
879 $ <i>df -h</i>
880 Filesystem Type Size Used Avail Use% Mounted on
881 /dev/hda5 ext3 509M 132M 351M 28% /
882 /dev/hda2 ext3 5.0G 3.0G 1.8G 63% /home
883 /dev/hda7 ext3 7.9G 6.2G 1.3G 83% /usr
884 /dev/hda8 ext3 1011M 483M 477M 51% /opt
885 /dev/hda9 ext3 2.0G 607M 1.3G 32% /var
886 /dev/hda1 ext2 51M 17M 31M 36% /boot
887 /dev/hda6 swap 516M 12M 504M 2% &lt;not mounted&gt;
888 <comment>(Unpartitioned space for future usage: 2 GB)</comment>
889 </pre>
890
891 <p>
892 <path>/usr</path> is rather full (83% used) here, but once
893 all software is installed, <path>/usr</path> doesn't tend to grow that much.
894 Although allocating a few gigabytes of disk space for <path>/var</path> may
895 seem excessive, remember that Portage uses this partition by default for
896 compiling packages. If you want to keep <path>/var</path> at a more reasonable
897 size, such as 1GB, you will need to alter your <c>PORTAGE_TMPDIR</c> variable
898 in <path>/etc/make.conf</path> to point to the partition with enough free space
899 for compiling extremely large packages such as OpenOffice.
900 </p>
901
902 </body>
903 </subsection>
904 </section>
905 <section id="fdisk">
906 <title>Using fdisk to Partition your Disk</title>
907 <subsection>
908 <body>
909
910 <p>
911 The following parts explain how to create the example partition layout
912 described previously, namely:
913 </p>
914
915 <table>
916 <tr>
917 <th>Partition</th>
918 <th>Description</th>
919 </tr>
920 <tr>
921 <ti><path>/dev/hda1</path></ti>
922 <ti>Boot partition</ti>
923 </tr>
924 <tr>
925 <ti><path>/dev/hda2</path></ti>
926 <ti>Swap partition</ti>
927 </tr>
928 <tr>
929 <ti><path>/dev/hda3</path></ti>
930 <ti>Root partition</ti>
931 </tr>
932 </table>
933
934 <p>
935 Change your partition layout according to your own preference.
936 </p>
937
938 </body>
939 </subsection>
940 <subsection>
941 <title>Viewing the Current Partition Layout</title>
942 <body>
943
944 <p>
945 <c>fdisk</c> is a popular and powerful tool to split your disk into partitions.
946 Fire up <c>fdisk</c> on your disk (in our example, we use
947 <path>/dev/hda</path>):
948 </p>
949
950 <pre caption="Starting fdisk">
951 # <i>fdisk /dev/hda</i>
952 </pre>
953
954 <p>
955 Once in <c>fdisk</c>, you'll be greeted with a prompt that looks like this:
956 </p>
957
958 <pre caption="fdisk prompt">
959 Command (m for help):
960 </pre>
961
962 <p>
963 Type <c>p</c> to display your disk's current partition configuration:
964 </p>
965
966 <pre caption="An example partition configuration">
967 Command (m for help): <i>p</i>
968
969 Disk /dev/hda: 240 heads, 63 sectors, 2184 cylinders
970 Units = cylinders of 15120 * 512 bytes
971
972 Device Boot Start End Blocks Id System
973 /dev/hda1 1 14 105808+ 83 Linux
974 /dev/hda2 15 49 264600 82 Linux swap
975 /dev/hda3 50 70 158760 83 Linux
976 /dev/hda4 71 2184 15981840 5 Extended
977 /dev/hda5 71 209 1050808+ 83 Linux
978 /dev/hda6 210 348 1050808+ 83 Linux
979 /dev/hda7 349 626 2101648+ 83 Linux
980 /dev/hda8 627 904 2101648+ 83 Linux
981 /dev/hda9 905 2184 9676768+ 83 Linux
982
983 Command (m for help):
984 </pre>
985
986 <p>
987 This particular disk is configured to house seven Linux filesystems (each with a
988 corresponding partition listed as "Linux") as well as a swap partition (listed
989 as "Linux swap").
990 </p>
991
992 </body>
993 </subsection>
994 <subsection>
995 <title>Removing all Partitions</title>
996 <body>
997
998 <p>
999 We will first remove all existing partitions from the disk. Type <c>d</c> to
1000 delete a partition. For instance, to delete an existing <path>/dev/hda1</path>:
1001 </p>
1002
1003 <pre caption="Deleting a partition">
1004 Command (m for help): <i>d</i>
1005 Partition number (1-4): <i>1</i>
1006 </pre>
1007
1008 <p>
1009 The partition has been scheduled for deletion. It will no longer show up if you
1010 type <c>p</c>, but it will not be erased until your changes have been saved. If
1011 you made a mistake and want to abort without saving your changes, type <c>q</c>
1012 immediately and hit enter and your partition will not be deleted.
1013 </p>
1014
1015 <p>
1016 Now, assuming that you do indeed want to wipe out all the partitions on your
1017 system, repeatedly type <c>p</c> to print out a partition listing and then type
1018 <c>d</c> and the number of the partition to delete it. Eventually, you'll end
1019 up with a partition table with nothing in it:
1020 </p>
1021
1022 <pre caption="An empty partition table">
1023 Disk /dev/hda: 30.0 GB, 30005821440 bytes
1024 240 heads, 63 sectors/track, 3876 cylinders
1025 Units = cylinders of 15120 * 512 = 7741440 bytes
1026
1027 Device Boot Start End Blocks Id System
1028
1029 Command (m for help):
1030 </pre>
1031
1032 <p>
1033 Now that the in-memory partition table is empty, we're ready to create the
1034 partitions. We will use a default partitioning scheme as discussed previously.
1035 Of course, don't follow these instructions to the letter if you don't want the
1036 same partitioning scheme!
1037 </p>
1038
1039 </body>
1040 </subsection>
1041 <subsection>
1042 <title>Creating the Boot Partition</title>
1043 <body>
1044
1045 <p>
1046 We first create a small boot partition. Type <c>n</c> to create a new partition,
1047 then <c>p</c> to select a primary partition, followed by <c>1</c> to select the
1048 first primary partition. When prompted for the first cylinder, hit enter. When
1049 prompted for the last cylinder, type <c>+32M</c> to create a partition 32 Mbyte
1050 in size:
1051 </p>
1052
1053 <pre caption="Creating the boot partition">
1054 Command (m for help): <i>n</i>
1055 Command action
1056 e extended
1057 p primary partition (1-4)
1058 <i>p</i>
1059 Partition number (1-4): <i>1</i>
1060 First cylinder (1-3876, default 1): <comment>(Hit Enter)</comment>
1061 Using default value 1
1062 Last cylinder or +size or +sizeM or +sizeK (1-3876, default 3876): <i>+32M</i>
1063 </pre>
1064
1065 <p>
1066 Now, when you type <c>p</c>, you should see the following partition printout:
1067 </p>
1068
1069 <pre caption="Created boot partition">
1070 Command (m for help): <i>p</i>
1071
1072 Disk /dev/hda: 30.0 GB, 30005821440 bytes
1073 240 heads, 63 sectors/track, 3876 cylinders
1074 Units = cylinders of 15120 * 512 = 7741440 bytes
1075
1076 Device Boot Start End Blocks Id System
1077 /dev/hda1 1 14 105808+ 83 Linux
1078 </pre>
1079
1080 <p>
1081 We need to make this partition bootable. Type <c>a</c> to toggle the bootable
1082 flag on a partition and select <c>1</c>. If you press <c>p</c> again, you will
1083 notice that an <path>*</path> is placed in the "Boot" column.
1084 </p>
1085
1086 </body>
1087 </subsection>
1088 <subsection>
1089 <title>Creating the Swap Partition</title>
1090 <body>
1091
1092 <p>
1093 Let's now create the swap partition. To do this, type <c>n</c> to create a new
1094 partition, then <c>p</c> to tell fdisk that you want a primary partition. Then
1095 type <c>2</c> to create the second primary partition, <path>/dev/hda2</path> in
1096 our case. When prompted for the first cylinder, hit enter. When prompted for
1097 the last cylinder, type <c>+512M</c> to create a partition 512MB in size. After
1098 you've done this, type <c>t</c> to set the partition type, <c>2</c> to select
1099 the partition you just created and then type in <c>82</c> to set the partition
1100 type to "Linux Swap". After completing these steps, typing <c>p</c> should
1101 display a partition table that looks similar to this:
1102 </p>
1103
1104 <pre caption="Partition listing after creating a swap partition">
1105 Command (m for help): <i>p</i>
1106
1107 Disk /dev/hda: 30.0 GB, 30005821440 bytes
1108 240 heads, 63 sectors/track, 3876 cylinders
1109 Units = cylinders of 15120 * 512 = 7741440 bytes
1110
1111 Device Boot Start End Blocks Id System
1112 /dev/hda1 * 1 14 105808+ 83 Linux
1113 /dev/hda2 15 81 506520 82 Linux swap
1114 </pre>
1115
1116 </body>
1117 </subsection>
1118 <subsection>
1119 <title>Creating the Root Partition</title>
1120 <body>
1121
1122 <p>
1123 Finally, let's create the root partition. To do this, type <c>n</c> to create a
1124 new partition, then <c>p</c> to tell fdisk that you want a primary partition.
1125 Then type <c>3</c> to create the third primary partition, <path>/dev/hda3</path>
1126 in our case. When prompted for the first cylinder, hit enter. When prompted for
1127 the last cylinder, hit enter to create a partition that takes up the rest of the
1128 remaining space on your disk. After completing these steps, typing <c>p</c>
1129 should display a partition table that looks similar to this:
1130 </p>
1131
1132 <pre caption="Partition listing after creating the root partition">
1133 Command (m for help): <i>p</i>
1134
1135 Disk /dev/hda: 30.0 GB, 30005821440 bytes
1136 240 heads, 63 sectors/track, 3876 cylinders
1137 Units = cylinders of 15120 * 512 = 7741440 bytes
1138
1139 Device Boot Start End Blocks Id System
1140 /dev/hda1 * 1 14 105808+ 83 Linux
1141 /dev/hda2 15 81 506520 82 Linux swap
1142 /dev/hda3 82 3876 28690200 83 Linux
1143 </pre>
1144
1145
1146 </body>
1147 </subsection>
1148 <subsection>
1149 <title>Saving the Partition Layout</title>
1150 <body>
1151
1152 <p>
1153 To save the partition layout and exit <c>fdisk</c>, type <c>w</c>.
1154 </p>
1155
1156 <pre caption="Save and exit fdisk">
1157 Command (m for help): <i>w</i>
1158 </pre>
1159
1160 <p>
1161 Now that your partitions are created, you can now continue with <uri
1162 link="#filesystems">Creating Filesystems</uri>.
1163 </p>
1164
1165 </body>
1166 </subsection>
1167 </section>
1168 <section id="filesystems">
1169 <title>Creating Filesystems</title>
1170 <subsection>
1171 <title>Introduction</title>
1172 <body>
1173
1174 <p>
1175 Now that your partitions are created, it is time to place a filesystem on them.
1176 If you don't care about what filesystem to choose and are happy with what we use
1177 as default in this handbook, continue with <uri
1178 link="#filesystems-apply">Applying a Filesystem to a Partition</uri>.
1179 Otherwise read on to learn about the available filesystems...
1180 </p>
1181
1182 </body>
1183 </subsection>
1184 <subsection>
1185 <title>Filesystems?</title>
1186 <body>
1187
1188 <p>
1189 The Linux kernel supports various filesystems. We'll explain ext2, ext3,
1190 ReiserFS, XFS and JFS as these are the most commonly used filesystems on Linux
1191 systems.
1192 </p>
1193
1194 <p>
1195 <b>ext2</b> is the tried and true Linux filesystem but doesn't have metadata
1196 journaling, which means that routine ext2 filesystem checks at startup time can
1197 be quite time-consuming. There is now quite a selection of newer-generation
1198 journaled filesystems that can be checked for consistency very quickly and are
1199 thus generally preferred over their non-journaled counterparts. Journaled
1200 filesystems prevent long delays when you boot your system and your filesystem
1201 happens to be in an inconsistent state.
1202 </p>
1203
1204 <p>
1205 <b>ext3</b> is the journaled version of the ext2 filesystem, providing metadata
1206 journaling for fast recovery in addition to other enhanced journaling modes like
1207 full data and ordered data journaling. ext3 is a very good and reliable
1208 filesystem. It has an additional hashed b-tree indexing option that enables
1209 high performance in almost all situations. You can enable this indexing by
1210 adding <c>-O dir_index</c> to the <c>mke2fs</c> command. In short, ext3 is an
1211 excellent filesystem.
1212 </p>
1213
1214 <p>
1215 <b>ReiserFS</b> is a B*-tree based filesystem that has very good overall
1216 performance and greatly outperforms both ext2 and ext3 when dealing with small
1217 files (files less than 4k), often by a factor of 10x-15x. ReiserFS also scales
1218 extremely well and has metadata journaling. As of kernel 2.4.18+, ReiserFS is
1219 solid and usable as both general-purpose filesystem and for extreme cases such
1220 as the creation of large filesystems, the use of many small files, very large
1221 files and directories containing tens of thousands of files.
1222 </p>
1223
1224 <p>
1225 <b>XFS</b> is a filesystem with metadata journaling which comes with a robust
1226 feature-set and is optimized for scalability. We only recommend using this
1227 filesystem on Linux systems with high-end SCSI and/or fibre channel storage and
1228 an uninterruptible power supply. Because XFS aggressively caches in-transit data
1229 in RAM, improperly designed programs (those that don't take proper precautions
1230 when writing files to disk and there are quite a few of them) can lose a good
1231 deal of data if the system goes down unexpectedly.
1232 </p>
1233
1234 <p>
1235 <b>JFS</b> is IBM's high-performance journaling filesystem. It has recently
1236 become production-ready and there hasn't been a sufficient track record to
1237 comment positively nor negatively on its general stability at this point.
1238 </p>
1239
1240 </body>
1241 </subsection>
1242 <subsection id="filesystems-apply">
1243 <title>Applying a Filesystem to a Partition</title>
1244 <body>
1245
1246 <p>
1247 To create a filesystem on a partition or volume, there are tools available for
1248 each possible filesystem:
1249 </p>
1250
1251 <table>
1252 <tr>
1253 <th>Filesystem</th>
1254 <th>Creation Command</th>
1255 </tr>
1256 <tr>
1257 <ti>ext2</ti>
1258 <ti><c>mke2fs</c></ti>
1259 </tr>
1260 <tr>
1261 <ti>ext3</ti>
1262 <ti><c>mke2fs -j</c></ti>
1263 </tr>
1264 <tr>
1265 <ti>reiserfs</ti>
1266 <ti><c>mkreiserfs</c></ti>
1267 </tr>
1268 <tr>
1269 <ti>xfs</ti>
1270 <ti><c>mkfs.xfs</c></ti>
1271 </tr>
1272 <tr>
1273 <ti>jfs</ti>
1274 <ti><c>mkfs.jfs</c></ti>
1275 </tr>
1276 </table>
1277
1278 <p>
1279 For instance, to have the boot partition (<path>/dev/hda1</path> in our
1280 example) in ext2 and the root partition (<path>/dev/hda3</path> in our example)
1281 in ext3 (as in our example), you would use:
1282 </p>
1283
1284 <pre caption="Applying a filesystem on a partition">
1285 # <i>mke2fs /dev/hda1</i>
1286 # <i>mke2fs -j /dev/hda3</i>
1287 </pre>
1288
1289 <p>
1290 Now create the filesystems on your newly created partitions (or logical
1291 volumes).
1292 </p>
1293
1294 </body>
1295 </subsection>
1296 <subsection>
1297 <title>Activating the Swap Partition</title>
1298 <body>
1299
1300 <p>
1301 <c>mkswap</c> is the command that is used to initialize swap partitions:
1302 </p>
1303
1304 <pre caption="Creating a Swap signature">
1305 # <i>mkswap /dev/hda2</i>
1306 </pre>
1307
1308 <p>
1309 To activate the swap partition, use <c>swapon</c>:
1310 </p>
1311
1312 <pre caption="Activating the swap partition">
1313 # <i>swapon /dev/hda2</i>
1314 </pre>
1315
1316 <p>
1317 Create and activate the swap with the commands mentioned above.
1318 </p>
1319
1320 </body>
1321 </subsection>
1322 </section>
1323 <section>
1324 <title>Mounting</title>
1325 <body>
1326
1327 <p>
1328 Now that your partitions are initialized and are housing a filesystem, it is
1329 time to mount those partitions. Use the <c>mount</c> command. Don't forget to
1330 create the necessary mount directories for every partition you created. As an
1331 example we mount the root and boot partition:
1332 </p>
1333
1334 <pre caption="Mounting partitions">
1335 # <i>mount /dev/hda3 /mnt/gentoo</i>
1336 # <i>mkdir /mnt/gentoo/boot</i>
1337 # <i>mount /dev/hda1 /mnt/gentoo/boot</i>
1338 </pre>
1339
1340 <note>
1341 If you want your <path>/tmp</path> to reside on a separate partition, be sure to
1342 change its permissions after mounting: <c>chmod 1777 /mnt/gentoo/tmp</c>. This
1343 also holds for <path>/var/tmp</path>.
1344 </note>
1345
1346 <p>
1347 We will also have to mount the proc filesystem (a virtual interface with the
1348 kernel) on <path>/proc</path>. But first we will need to place our files on the partitions.
1349 </p>
1350
1351 <p>
1352 Continue with <uri link="?part=1&amp;chap=5">Installing the Gentoo
1353 Installation Files</uri>.
1354 </p>
1355
1356 </body>
1357 </section>
1358 </sections>
1359
1360
1361
1362 1.1 xml/htdocs/doc/en/handbook/hb-install-x86+amd64-kernel.xml
1363
1364 file : http://sources.gentoo.org/viewcvs.py/gentoo/xml/htdocs/doc/en/handbook/hb-install-x86+amd64-kernel.xml?rev=1.1&view=markup
1365 plain: http://sources.gentoo.org/viewcvs.py/gentoo/xml/htdocs/doc/en/handbook/hb-install-x86+amd64-kernel.xml?rev=1.1&content-type=text/plain
1366
1367 Index: hb-install-x86+amd64-kernel.xml
1368 ===================================================================
1369 <?xml version='1.0' encoding='UTF-8'?>
1370 <!DOCTYPE sections SYSTEM "/dtd/book.dtd">
1371
1372 <!-- The content of this document is licensed under the CC-BY-SA license -->
1373 <!-- See http://creativecommons.org/licenses/by-sa/2.5 -->
1374
1375 <!-- $Header: /var/cvsroot/gentoo/xml/htdocs/doc/en/handbook/hb-install-x86+amd64-kernel.xml,v 1.1 2006/08/02 21:15:02 neysx Exp $ -->
1376
1377 <sections>
1378
1379 <version>3.13</version>
1380 <date>2006-07-20</date>
1381
1382 <section>
1383 <title>Timezone</title>
1384 <body>
1385
1386 <p>
1387 You first need to select your timezone so that your system knows where it is
1388 located. Look for your timezone in <path>/usr/share/zoneinfo</path>, then copy
1389 it to <path>/etc/localtime</path>. Please avoid the
1390 <path>/usr/share/zoneinfo/Etc/GMT*</path> timezones as their names do not
1391 indicate the expected zones. For instance, <path>GMT-8</path> is in fact GMT+8.
1392 </p>
1393
1394 <pre caption="Setting the timezone information">
1395 # <i>ls /usr/share/zoneinfo</i>
1396 <comment>(Suppose you want to use GMT)</comment>
1397 # <i>cp /usr/share/zoneinfo/GMT /etc/localtime</i>
1398 </pre>
1399
1400 </body>
1401 </section>
1402 <section>
1403 <title>Installing the Sources</title>
1404 <subsection>
1405 <title>Choosing a Kernel</title>
1406 <body>
1407
1408 <p>
1409 The core around which all distributions are built is the Linux kernel. It is the
1410 layer between the user programs and your system hardware. Gentoo provides its
1411 users several possible kernel sources. A full listing with description is
1412 available at the <uri link="/doc/en/gentoo-kernel.xml">Gentoo Kernel
1413 Guide</uri>.
1414 </p>
1415
1416 <p>
1417 For x86-based systems we have, amongst other kernels, <c>vanilla-sources</c>
1418 (the default kernel source as developed by the linux-kernel developers),
1419 <c>gentoo-sources</c> (kernel source patched with performance-enhancing
1420 features), ...
1421 </p>
1422
1423 <p>
1424 Choose your kernel source and install it using <c>emerge</c>. The
1425 <c>USE="-doc"</c> is necessary to avoid installing xorg-x11 or other
1426 dependencies at this point. <c>USE="symlink"</c> is not necessary for a new
1427 install, but ensures proper creation of the <path>/usr/src/linux</path>
1428 symlink.
1429 </p>
1430
1431 <pre caption="Installing a kernel source">
1432 # <i>USE="-doc symlink" emerge gentoo-sources</i>
1433 </pre>
1434
1435 <p>
1436 When you take a look in <path>/usr/src</path> you should see a symlink called
1437 <path>linux</path> pointing to your kernel source. In this case, the installed
1438 kernel source points to <c>gentoo-sources-2.6.12-r10</c>. Your version may be
1439 different, so keep this in mind.
1440 </p>
1441
1442 <pre caption="Viewing the kernel source symlink">
1443 # <i>ls -l /usr/src/linux</i>
1444 lrwxrwxrwx 1 root root 12 Oct 13 11:04 /usr/src/linux -&gt; linux-2.6.12-gentoo-r10
1445 </pre>
1446
1447 <p>
1448 Now it is time to configure and compile your kernel source. You
1449 can use <c>genkernel</c> for this, which will build a generic kernel as used
1450 by the Installation CD. We explain the "manual" configuration first though, as
1451 it is the best way to optimize your environment.
1452 </p>
1453
1454 <p>
1455 If you want to manually configure your kernel, continue now with <uri
1456 link="#manual">Default: Manual Configuration</uri>. If you want to use
1457 <c>genkernel</c> you should read <uri link="#genkernel">Alternative: Using
1458 genkernel</uri> instead.
1459 </p>
1460
1461 </body>
1462 </subsection>
1463 </section>
1464 <section id="manual">
1465 <title>Default: Manual Configuration</title>
1466 <subsection>
1467 <title>Introduction</title>
1468 <body>
1469
1470 <p>
1471 Manually configuring a kernel is often seen as the most difficult procedure a
1472 Linux user ever has to perform. Nothing is less true -- after configuring a
1473 couple of kernels you don't even remember that it was difficult ;)
1474 </p>
1475
1476 <p>
1477 However, one thing <e>is</e> true: you must know your system when you start
1478 configuring a kernel manually. Most information can be gathered by emerging
1479 pciutils (<c>emerge pciutils</c>) which contains <c>lspci</c>. You will now
1480 be able to use <c>lspci</c> within the chrooted environment. You may safely
1481 ignore any <e>pcilib</e> warnings (like pcilib: cannot open
1482 /sys/bus/pci/devices) that <c>lspci</c> throws out. Alternatively, you can run
1483 <c>lspci</c> from a <e>non-chrooted</e> environment. The results are the same.
1484 You can also run <c>lsmod</c> to see what kernel modules the Installation CD
1485 uses (it might provide you with a nice hint on what to enable).
1486 </p>
1487
1488 <p>
1489 Now go to your kernel source directory and execute <c>make menuconfig</c>. This
1490 will fire up an ncurses-based configuration menu.
1491 </p>
1492
1493 <pre caption="Invoking menuconfig">
1494 # <i>cd /usr/src/linux</i>
1495 # <i>make menuconfig</i>
1496 </pre>
1497
1498 <p>
1499 You will be greeted with several configuration sections. We'll first list some
1500 options you must activate (otherwise Gentoo will not function, or not function
1501 properly without additional tweaks).
1502 </p>
1503
1504 </body>
1505 </subsection>
1506 <subsection>
1507 <title>Activating Required Options</title>
1508 <body>
1509
1510 <p>
1511 First of all, activate the use of development and experimental code/drivers.
1512 You need this, otherwise some very important code/drivers won't show up:
1513 </p>
1514
1515 <pre caption="Selecting experimental code/drivers, General setup">
1516 Code maturity level options ---&gt;
1517 [*] Prompt for development and/or incomplete code/drivers
1518 </pre>
1519
1520 <p>
1521 Make sure that every driver that is vital to the booting of your system (such as
1522 SCSI controller, ...) is compiled <e>in</e> the kernel and not as a module,
1523 otherwise your system will not be able to boot completely.
1524 </p>
1525
1526 <p>
1527 Now select the correct processor family:
1528 </p>
1529
1530 <pre caption="Selecting correct processor family">
1531 Processor type and features ---&gt;
1532 <comment>(Change according to your system)</comment>
1533 (<i>Athlon/Duron/K7</i>) Processor family
1534 </pre>
1535
1536 <p>
1537 Now go to <c>File Systems</c> and select support for the filesystems you use.
1538 <e>Don't</e> compile them as modules, otherwise your Gentoo system will not be
1539 able to mount your partitions. Also select <c>Virtual memory</c> and <c>/proc
1540 file system</c>. If you are using a 2.4 kernel, you need to select <c>/dev file
1541 system</c> as 2.4 kernels do not support <c>udev</c>.
1542 </p>
1543
1544 <pre caption="Selecting necessary file systems">
1545 <comment>(With a 2.4.x kernel)</comment>
1546 File systems ---&gt;
1547 [*] Virtual memory file system support (former shm fs)
1548 [*] /proc file system support
1549 [*] /dev file system support (EXPERIMENTAL)
1550 [*] automatically mount /dev at boot
1551 [ ] /dev/pts file system for Unix98 PTYs
1552
1553 <comment>(With a 2.6.x kernel)</comment>
1554 File systems ---&gt;
1555 Pseudo Filesystems ---&gt;
1556 [*] /proc file system support
1557 [*] Virtual memory file system support (former shm fs)
1558
1559 <comment>(Select one or more of the following options as needed by your system)</comment>
1560 &lt;*&gt; Reiserfs support
1561 &lt;*&gt; Ext3 journalling file system support
1562 &lt;*&gt; JFS filesystem support
1563 &lt;*&gt; Second extended fs support
1564 &lt;*&gt; XFS filesystem support
1565 </pre>
1566
1567 <p>
1568 If your BIOS can't handle large harddrives and you jumpered the harddrive to
1569 report a limited size you have to enable the following option to gain access
1570 to your whole harddrive:
1571 </p>
1572
1573 <pre caption="Selecting autogeometry resizing support">
1574 <comment>(2.4.x kernel only)</comment>
1575 ATA/IDE/MFM/RLL support ---&gt;
1576 IDE, ATA and ATAPI Block devices ---&gt;
1577 &lt;*&gt; Include IDE/ATA-2 DISK support
1578 [ ] Use multi-mode by default
1579 [*] Auto-Geometry Resizing support
1580 </pre>
1581
1582 <p>
1583 Do not forget to enable DMA for your drives:
1584 </p>
1585
1586 <pre caption="Activating DMA">
1587 Device Drivers ---&gt;
1588 ATA/ATAPI/MFM/RLL support ---&gt;
1589 [*] Generic PCI bus-master DMA support
1590 [*] Use PCI DMA by default when available
1591 </pre>
1592
1593 <p>
1594 If you are using PPPoE to connect to the Internet or you are using a dial-up
1595 modem, you will need the following options in the kernel:
1596 </p>
1597
1598 <pre caption="Selecting PPPoE necessary drivers">
1599 <comment>(With a 2.4.x kernel)</comment>
1600 Network device support ---&gt;
1601 &lt;*&gt; PPP (point-to-point protocol) support
1602 &lt;*&gt; PPP support for async serial ports
1603 &lt;*&gt; PPP support for sync tty ports
1604
1605 <comment>(With a 2.6.x kernel)</comment>
1606 Device Drivers ---&gt;
1607 Networking support ---&gt;
1608 &lt;*&gt; PPP (point-to-point protocol) support
1609 &lt;*&gt; PPP support for async serial ports
1610 &lt;*&gt; PPP support for sync tty ports
1611 </pre>
1612
1613 <p>
1614 The two compression options won't harm but are not definitely needed, neither
1615 does the <c>PPP over Ethernet</c> option, that might only be used by
1616 <c>rp-pppoe</c> when configured to do kernel mode PPPoE.
1617 </p>
1618
1619 <p>
1620 If you require it, don't forget to include support in the kernel for your
1621 ethernet card.
1622 </p>
1623
1624 <p>
1625 If you have an Intel CPU that supports HyperThreading (tm), or you have a
1626 multi-CPU system, you should activate "Symmetric multi-processing support":
1627 </p>
1628
1629 <pre caption="Activating SMP support">
1630 Processor type and features ---&gt;
1631 [*] Symmetric multi-processing support
1632 </pre>
1633
1634 <note>
1635 In multi-core systems, each core counts as one processor.
1636 </note>
1637
1638 <p>
1639 If you use USB Input Devices (like Keyboard or Mouse) don't forget to enable
1640 those as well:
1641 </p>
1642
1643 <pre caption="Activating USB Support for Input Devices">
1644 USB Support ---&gt;
1645 &lt;*&gt; USB Human Interface Device (full HID) support
1646 </pre>
1647
1648 <p>
1649 Laptop-users who want PCMCIA support should <e>not</e> use the PCMCIA drivers if
1650 they choose to use a 2.4 kernel. More recent drivers are available through the
1651 <c>pcmcia-cs</c> package which will be installed later on. 2.6-kernel users
1652 however should use the PCMCIA drivers from the kernel.
1653 </p>
1654
1655 <p>
1656 Besides compiling in PCMCIA support in the 2.6 kernel, don't forget to enable
1657 support for the PCMCIA card bridge present in your system:
1658 </p>
1659
1660 <pre caption="Enabling PCMCIA support for 2.6 kernels">
1661 Bus options (PCI, PCMCIA, EISA, MCA, ISA) ---&gt;
1662 PCCARD (PCMCIA/CardBus) support ---&gt;
1663 &lt;*&gt; PCCard (PCMCIA/CardBus) support
1664 <comment>(select 16 bit if you need support for older PCMCIA cards. Most people want this.)</comment>
1665 &lt;*&gt; 16-bit PCMCIA support
1666 [*] 32-bit CardBus support
1667 <comment>(select the relevant bridges below)</comment>
1668 --- PC-card bridges
1669 &lt;*&gt; CardBus yenta-compatible bridge support (NEW)
1670 &lt;*&gt; Cirrus PD6729 compatible bridge support (NEW)
1671 &lt;*&gt; i82092 compatible bridge support (NEW)
1672 &lt;*&gt; i82365 compatible bridge support (NEW)
1673 &lt;*&gt; Databook TCIC host bridge support (NEW)
1674 </pre>
1675
1676 <p>
1677 When you've finished configuring the kernel, continue with <uri
1678 link="#compiling">Compiling and Installing</uri>.
1679 </p>
1680
1681 </body>
1682 </subsection>
1683 <subsection id="compiling">
1684 <title>Compiling and Installing</title>
1685 <body>
1686
1687 <p>
1688 Now that your kernel is configured, it is time to compile and install it. Exit
1689 the configuration and start the compilation process:
1690 </p>
1691
1692 <pre caption="Compiling the kernel">
1693 <comment>(For 2.4 kernel)</comment>
1694 # <i>make dep &amp;&amp; make bzImage modules modules_install</i>
1695
1696 <comment>(For 2.6 kernel)</comment>
1697 # <i>make &amp;&amp; make modules_install</i>
1698 </pre>
1699
1700 <p>
1701 When the kernel has finished compiling, copy the kernel image to
1702 <path>/boot</path>. Use whatever name you feel is appropriate for your kernel
1703 choice and remember it as you will need it later on when you configure your
1704 bootloader. Remember to replace <path>&lt;kernel-version&gt;</path> with the name and
1705 version of your kernel.
1706 </p>
1707
1708 <pre caption="Installing the kernel">
1709 # <i>cp arch/i386/boot/bzImage /boot/&lt;kernel-version&gt;</i>
1710 </pre>
1711
1712 <p>
1713 Now continue with <uri link="#kernel_modules">Kernel Modules</uri>.
1714 </p>
1715
1716 </body>
1717 </subsection>
1718 </section>
1719 <section id="genkernel">
1720 <title>Alternative: Using genkernel</title>
1721 <body>
1722
1723 <p>
1724 If you are reading this section, you have chosen to use our <c>genkernel</c>
1725 script to configure your kernel for you.
1726 </p>
1727
1728 <p>
1729 Now that your kernel source tree is installed, it's now time to compile your
1730 kernel by using our <c>genkernel</c> script to automatically build a kernel for
1731 you. <c>genkernel</c> works by configuring a kernel nearly identically to the
1732 way our Installation CD kernel is configured. This means that when you use
1733 <c>genkernel</c> to build your kernel, your system will generally detect all
1734 your hardware at boot-time, just like our Installation CD does. Because
1735 genkernel doesn't require any manual kernel configuration, it is an ideal
1736 solution for those users who may not be comfortable compiling their own kernels.
1737 </p>
1738
1739 <p>
1740 Now, let's see how to use genkernel. First, emerge the genkernel ebuild:
1741 </p>
1742
1743 <pre caption="Emerging genkernel">
1744 # <i>emerge genkernel</i>
1745 </pre>
1746
1747 <p>
1748 Next, if you are going to configure a 2.6 kernel, copy over the kernel
1749 configuration used by the Installation CD to the location where genkernel
1750 looks for the default kernel configuration:
1751 </p>
1752
1753 <pre caption="Copying over the Installation CD kernel config">
1754 <comment>(Only do this if you are going to configure a 2.6 kernel)</comment>
1755 # <i>zcat /proc/config.gz &gt; /usr/share/genkernel/x86/kernel-config-2.6</i>
1756 </pre>
1757
1758 <p>
1759 Now, compile your kernel sources by running <c>genkernel all</c>. Be aware
1760 though, as <c>genkernel</c> compiles a kernel that supports almost all
1761 hardware, this compilation will take quite a while to finish!
1762 </p>
1763
1764 <p>
1765 Note that, if your boot partition doesn't use ext2 or ext3 as filesystem you
1766 might need to manually configure your kernel using <c>genkernel --menuconfig
1767 all</c> and add support for your filesystem <e>in</e> the kernel (i.e.
1768 <e>not</e> as a module). Users of EVMS2 or LVM2 will probably want to add
1769 <c>--evms2</c> or <c>--lvm2</c> as argument as well.
1770 </p>
1771
1772 <pre caption="Running genkernel">
1773 # <i>genkernel all</i>
1774 </pre>
1775
1776 <p>
1777 Once <c>genkernel</c> completes, a kernel, full set of modules and
1778 <e>initial root disk</e> (initrd) will be created. We will use the kernel
1779 and initrd when configuring a boot loader later in this document. Write
1780 down the names of the kernel and initrd as you will need it when writing
1781 the bootloader configuration file. The initrd will be started immediately after
1782 booting to perform hardware autodetection (just like on the Installation CD)
1783 before your "real" system starts up.
1784 </p>
1785
1786 <pre caption="Checking the created kernel image name and initrd">
1787 # <i>ls /boot/kernel* /boot/initramfs*</i>
1788 </pre>
1789
1790 <p>
1791 Now, let's perform one more step to get our system to be more like the
1792 Installation CD -- let's emerge <c>coldplug</c>. While the initrd autodetects
1793 hardware that is needed to boot your system, <c>coldplug</c> autodetects
1794 everything else. To emerge and enable <c>coldplug</c>, type the following:
1795 </p>
1796
1797 <pre caption="Emerging and enabling coldplug">
1798 # <i>emerge coldplug</i>
1799 # <i>rc-update add coldplug boot</i>
1800 </pre>
1801
1802 </body>
1803 </section>
1804 <section id="kernel_modules">
1805 <title>Kernel Modules</title>
1806 <subsection>
1807 <title>Configuring the Modules</title>
1808 <body>
1809
1810 <p>
1811 You should list the modules you want automatically loaded in
1812 <path>/etc/modules.autoload.d/kernel-2.4</path> (or <path>kernel-2.6</path>).
1813 You can add extra options to the modules too if you want.
1814 </p>
1815
1816 <p>
1817 To view all available modules, run the following <c>find</c> command. Don't
1818 forget to substitute "&lt;kernel version&gt;" with the version of the kernel you
1819 just compiled:
1820 </p>
1821
1822 <pre caption="Viewing all available modules">
1823 # <i>find /lib/modules/&lt;kernel version&gt;/ -type f -iname '*.o' -or -iname '*.ko'</i>
1824 </pre>
1825
1826 <p>
1827 For instance, to automatically load the <c>3c59x.o</c> module, edit the
1828 <path>kernel-2.4</path> or <path>kernel-2.6</path> file and enter the module
1829 name in it.
1830 </p>
1831
1832 <pre caption="Editing /etc/modules.autoload.d/kernel-2.4">
1833 <comment>(Example for 2.4 kernels)</comment>
1834 # <i>nano -w /etc/modules.autoload.d/kernel-2.4</i>
1835 </pre>
1836
1837 <pre caption="/etc/modules.autoload.d/kernel-2.4 or kernel-2.6">
1838 3c59x
1839 </pre>
1840
1841 <p>
1842 Continue the installation with <uri link="?part=1&amp;chap=8">Configuring
1843 your System</uri>.
1844 </p>
1845
1846 </body>
1847 </subsection>
1848 </section>
1849 </sections>
1850
1851
1852
1853 1.1 xml/htdocs/doc/en/handbook/hb-install-x86+amd64-medium.xml
1854
1855 file : http://sources.gentoo.org/viewcvs.py/gentoo/xml/htdocs/doc/en/handbook/hb-install-x86+amd64-medium.xml?rev=1.1&view=markup
1856 plain: http://sources.gentoo.org/viewcvs.py/gentoo/xml/htdocs/doc/en/handbook/hb-install-x86+amd64-medium.xml?rev=1.1&content-type=text/plain
1857
1858 Index: hb-install-x86+amd64-medium.xml
1859 ===================================================================
1860 <?xml version='1.0' encoding='UTF-8'?>
1861 <!DOCTYPE sections SYSTEM "/dtd/book.dtd">
1862
1863 <!-- The content of this document is licensed under the CC-BY-SA license -->
1864 <!-- See http://creativecommons.org/licenses/by-sa/2.5 -->
1865
1866 <!-- $Header: /var/cvsroot/gentoo/xml/htdocs/doc/en/handbook/hb-install-x86+amd64-medium.xml,v 1.1 2006/08/02 21:15:02 neysx Exp $ -->
1867
1868 <sections>
1869
1870 <version>2.11</version>
1871 <date>2006-07-19</date>
1872
1873 <section>
1874 <title>Hardware Requirements</title>
1875 <subsection>
1876 <title>Introduction</title>
1877 <body>
1878
1879 <p>
1880 Before we start, we first list what hardware requirements you need to
1881 successfully install Gentoo on your box.
1882 </p>
1883
1884 </body>
1885 </subsection>
1886 <subsection>
1887 <title>Hardware Requirements</title>
1888 <body>
1889
1890 <table>
1891 <tr>
1892 <ti/>
1893 <th>Minimal CD</th>
1894 <th>LiveCD</th>
1895 </tr>
1896 <tr>
1897 <th>CPU</th>
1898 <ti>i486 or later</ti>
1899 <ti><b>i686</b> or later</ti>
1900 </tr>
1901 <tr>
1902 <th>Memory</th>
1903 <ti>64 MB</ti>
1904 <ti>128 MB</ti>
1905 </tr>
1906 <tr>
1907 <th>Diskspace</th>
1908 <ti colspan="2">1.5 GB (excluding swap space)</ti>
1909 </tr>
1910 <tr>
1911 <th>Swap space</th>
1912 <ti colspan="2">At least 256 MB</ti>
1913 </tr>
1914 </table>
1915
1916 </body>
1917 </subsection>
1918 </section>
1919 <!-- This part can be propagated to the other architectures as well. -->
1920 <!-- START -->
1921 <section>
1922 <title>The Gentoo Installation CDs</title>
1923 <subsection>
1924 <title>Introduction</title>
1925 <body>
1926
1927 <p>
1928 The <e>Gentoo Installation CDs</e> are bootable CDs which contain a
1929 self-sustained Gentoo environment. They allow you to boot Linux from the CD.
1930 During the boot process your hardware is detected and the appropriate drivers
1931 are loaded. They are maintained by Gentoo developers.
1932 </p>
1933
1934 <p>
1935 All Installation CDs allow you to boot, set up networking, initialize your
1936 partitions and start installing Gentoo from the Internet. We currently provide
1937 two Installation CDs which are equaly suitable to install Gentoo from, as long
1938 as you're planning on performing an Internet-based installation using the
1939 latest version of the available packages.
1940 </p>
1941
1942 <impo>
1943 If you wish to install Gentoo without a working Internet connection or would
1944 like to use one of the provided installers, please use the installation
1945 instructions described in the <uri link="2006.0/index.xml">Gentoo 2006.0
1946 Handbooks</uri>.
1947 </impo>
1948
1949 <p>
1950 The two Installation CDs that we currently provide are:
1951 </p>
1952
1953 <ul>
1954 <li>
1955 The Gentoo <e>Minimal</e> Installation CD, a small, no-nonsense, bootable
1956 CD which sole purpose is to boot the system, prepare the networking and
1957 continue with the Gentoo installation.
1958 </li>
1959 <li>
1960 The Gentoo <e>Installer LiveCD</e> contains everything you need to install
1961 Gentoo. It provides a graphical environment, a graphical as well as console
1962 based installer which automatically carries out the installation for you,
1963 and of course, the installation instructions for your architecture.
1964 </li>
1965 </ul>
1966
1967 <p>
1968 To help you decide which Installation CD you need, we have written down the
1969 major advantages and disadvantages of each Installation CD.
1970 </p>
1971
1972 </body>
1973 </subsection>
1974 <subsection>
1975 <title>Gentoo's Minimal Installation CD</title>
1976 <body>
1977
1978 <p>
1979 The Minimal Installation CD is called <c>install-x86-minimal-2006.0.iso</c>
1980 and takes up only 49 MB of diskspace. You can use this Installation CD to
1981 install Gentoo, but always with a working Internet connection only.
1982 </p>
1983
1984 <table>
1985 <tr>
1986 <th>Minimal Installation CD</th>
1987 <th>Pros and Cons</th>
1988 </tr>
1989 <tr>
1990 <th>+</th>
1991 <ti>Smallest download</ti>
1992 </tr>
1993 <tr>
1994 <th>-</th>
1995 <ti>
1996 Contains no stage3 tarball, no Portage snapshot, no prebuilt packages and is
1997 therefore not suitable for networkless installation
1998 </ti>
1999 </tr>
2000 </table>
2001
2002 </body>
2003 </subsection>
2004 <subsection>
2005 <title>Gentoo's Installer LiveCD</title>
2006 <body>
2007
2008 <p>
2009 The Installer LiveCD is called
2010 <c>livecd-i686-installer-2006.0.iso</c> and takes up 697 MB. You can use
2011 this Installation CD to install Gentoo, and you can even use it to install
2012 Gentoo without a working internet connection, just in case you want to bring
2013 Gentoo to another PC than the one you are currently installing Gentoo on :)
2014 </p>
2015
2016 <table>
2017 <tr>
2018 <th>Installer LiveCD</th>
2019 <th>Pros and Cons</th>
2020 </tr>
2021 <tr>
2022 <th>+</th>
2023 <ti>
2024 Contains everything you need. You can even install without a network
2025 connection.
2026 </ti>
2027 </tr>
2028 <tr>
2029 <th>-</th>
2030 <ti>Huge download</ti>
2031 </tr>
2032 </table>
2033
2034 </body>
2035 </subsection>
2036 <!-- PackageCDs on x86 are outdated
2037 <subsection>
2038 <title>Other CDs</title>
2039 <body>
2040
2041 <p>
2042 You might find a <e>Package CD</e> on one of our mirrors. This CD is not an
2043 Installation CD but an additional resource that can be exploited during a
2044 networkless installation. It contains prebuilt packages (also known as the GRP
2045 set) that allow you to easily and quickly install additional applications (such
2046 as OpenOffice.org, KDE, GNOME, ...) immediately after the networkless Gentoo
2047 installation.
2048 </p>
2049
2050 <p>
2051 If you intend to use the Packages CD to quickly install additional software,
2052 make sure that you use the same subarchitecture as the stage3 tarball you use.
2053 </p>
2054
2055 </body>
2056 </subsection>-->
2057 <subsection>
2058 <title>The Stage3 Tarball</title>
2059 <body>
2060
2061 <p>
2062 A stage3 tarball is an archive containing a minimal Gentoo environment, suitable
2063 to continue the Gentoo installation using the instructions in this manual.
2064 Previously, the Gentoo Handbook described the installation using one of three
2065 stage tarballs. While Gentoo still offers stage1 and stage2 tarballs, the
2066 official installation method uses the stage3 tarball. If you are interested in
2067 performing a Gentoo installation using a stage1 or stage2 tarball, please read
2068 the Gentoo FAQ on <uri link="/doc/en/faq.xml#stage12">How do I Install Gentoo
2069 Using a Stage1 or Stage2 Tarball?</uri>
2070 </p>
2071
2072 <p>
2073 Stage3 tarballs can be downloaded from <path>releases/x86/2006.0/stages/</path>
2074 on any of the <uri link="/main/en/mirrors.xml">Official Gentoo Mirrors</uri>
2075 and are not provided on the LiveCD.
2076 </p>
2077
2078 </body>
2079 </subsection>
2080 </section>
2081 <!-- STOP -->
2082 <section>
2083 <title>Download, Burn and Boot a Gentoo Installation CD</title>
2084 <subsection>
2085 <title>Downloading and Burning the Installation CDs</title>
2086 <body>
2087
2088 <p>
2089 You have chosen to use a Gentoo Installation CD. We'll first start by
2090 downloading and burning the chosen Installation CD. We previously discussed
2091 the several available Installation CDs, but where can you find them?
2092 </p>
2093
2094 <p>
2095 You can download any of the Installation CDs (and, if you want to, a Packages
2096 CD as well) from one of our <uri link="/main/en/mirrors.xml">mirrors</uri>. The
2097 Installation CDs are located in the <path>releases/x86/2006.0/installcd</path>
2098 directory.
2099 </p>
2100
2101 <p>
2102 Inside that directory you'll find ISO-files. Those are full CD images which you
2103 can write on a CD-R.
2104 </p>
2105
2106 <p>
2107 In case you wonder if your downloaded file is corrupted or not, you can check
2108 its MD5 checksum and compare it with the MD5 checksum we provide (such as
2109 <path>install-x86-minimal-2006.0.iso.DIGESTS</path>). You can check the MD5
2110 checksum with the <c>md5sum</c> tool under Linux/Unix or <uri
2111 link="http://www.etree.org/md5com.html">md5sum</uri> for Windows.
2112 </p>
2113
2114 <p>
2115 Another way to check the validity of the downloaded file is to use GnuPG to
2116 verify the cryptographic signature that we provide (the file ending with
2117 <path>.asc</path>). Download the signature file and obtain the public key:
2118 </p>
2119
2120 <pre caption="Obtaining the public key">
2121 $ <i>gpg --keyserver subkeys.pgp.net --recv-keys 17072058</i>
2122 </pre>
2123
2124 <p>
2125 Now verify the signature:
2126 </p>
2127
2128 <pre caption="Verify the cryptographic signature">
2129 $ <i>gpg --verify &lt;signature file&gt; &lt;downloaded iso&gt;</i>
2130 </pre>
2131
2132 <p>
2133 To burn the downloaded ISO(s), you have to select raw-burning. How you
2134 do this is highly program-dependent. We will discuss <c>cdrecord</c> and
2135 <c>K3B</c> here; more information can be found in our <uri
2136 link="/doc/en/faq.xml#isoburning">Gentoo FAQ</uri>.
2137 </p>
2138
2139 <ul>
2140 <li>
2141 With cdrecord, you simply type <c>cdrecord dev=/dev/hdc &lt;downloaded iso
2142 file&gt;</c> (replace <path>/dev/hdc</path> with your CD-RW drive's
2143 device path).
2144 </li>
2145 <li>
2146 With K3B, select <c>Tools</c> &gt; <c>CD</c> &gt; <c>Burn Image</c>. Then
2147 you can locate your ISO file within the 'Image to Burn' area. Finally click
2148 <c>Start</c>.
2149 </li>
2150 </ul>
2151
2152 </body>
2153 </subsection>
2154 <subsection>
2155 <title>Booting the Installation CD</title>
2156 <body>
2157
2158 <impo>
2159 Read this whole subsection before continuing, as you will probably not have the
2160 opportunity to read it before doing things later.
2161 </impo>
2162
2163 <p>
2164 Once you have burned your installation CD, it is time to boot it.
2165 Remove all CDs from your CD drives, reboot your system and enter the BIOS.
2166 This is usually done by hitting DEL, F1 or ESC, depending on your BIOS. Inside
2167 the BIOS, change the boot order so that the CD-ROM is tried before the hard
2168 disk. This is often found under "CMOS Setup". If you don't do this, your system
2169 will just reboot from the hard disk, ignoring the CD-ROM.
2170 </p>
2171
2172 <p>
2173 Now place the installation CD in the CD-ROM drive (duh) and reboot. You
2174 should see a boot prompt. At this screen, you can hit Enter to begin the
2175 boot process with the default boot options, or boot the Installation CD with
2176 custom boot options by specifying a kernel followed by boot options and then
2177 hitting Enter.
2178 </p>
2179
2180 <p>
2181 Specifying a kernel? Yes, we provide several kernels on our Installation CDs.
2182 The default one is <c>gentoo</c>. Other kernels are for specific hardware needs
2183 and the <c>-nofb</c> variants which disable framebuffer.
2184 </p>
2185
2186 <p>
2187 Below you'll find a short overview on the available kernels:
2188 </p>
2189
2190 <table>
2191 <tr>
2192 <th>Kernel</th>
2193 <th>Description</th>
2194 </tr>
2195 <tr>
2196 <ti>gentoo</ti>
2197 <ti>Default 2.6 kernel with support for multiple CPUs</ti>
2198 </tr>
2199 <tr>
2200 <ti>gentoo-nofb</ti>
2201 <ti>Same as <c>gentoo</c> but without framebuffer support</ti>
2202 </tr>
2203 <tr>
2204 <ti>memtest86</ti>
2205 <ti>Test your local RAM for errors</ti>
2206 </tr>
2207 </table>
2208
2209 <p>
2210 You can also provide kernel options. They represent optional settings you can
2211 (de)activate at will. The following list is the same as the one you receive
2212 when you press F2 at the bootscreen.
2213 </p>
2214
2215 <pre caption="Options available to pass to your kernel of choice">
2216 - agpgart loads agpgart (use if you have graphic problems,lockups)
2217 - acpi=on loads support for ACPI firmware
2218 - ide=nodma force disabling of DMA for malfunctioning IDE devices
2219 - doscsi scan for scsi devices (breaks some ethernet cards)
2220 - dopcmcia starts pcmcia service for PCMCIA cdroms
2221 - nofirewire disables firewire modules in initrd (for firewire cdroms,etc)
2222 - nokeymap disables keymap selection for non-us keyboard layouts
2223 - docache cache the entire runtime portion of cd in RAM, allows you
2224 to umount /mnt/cdrom to mount another cdrom.
2225 - nodetect causes hwsetup/kudzu and hotplug not to run
2226 - nousb disables usb module load from initrd, disables hotplug
2227 - nodhcp dhcp does not automatically start if nic detected
2228 - nohotplug disables loading hotplug service
2229 - noapic disable apic (try if having hardware problems nics,scsi,etc)
2230 - noevms disable loading of EVMS2 modules
2231 - nolvm2 disable loading of LVM2 modules
2232 - hdx=stroke allows you to partition the whole harddrive even when your BIOS
2233 can't handle large harddrives
2234 - noload=module1,[module2,[...]]
2235 disable loading of specific kernel modules
2236 </pre>
2237
2238 <p>
2239 Now boot your CD, select a kernel (if you are not happy with the default
2240 <c>gentoo</c> kernel) and boot options. As an example, we show you how
2241 to boot the <c>gentoo</c> kernel, with <c>dopcmcia</c> as kernel
2242 parameters:
2243 </p>
2244
2245 <pre caption="Booting an Installation CD">
2246 boot: <i>gentoo dopcmcia</i>
2247 </pre>
2248
2249 <p>
2250 You will then be greeted with a boot screen and progress bar. If you are
2251 installing Gentoo on a system with a non-US keyboard, make sure you immediately
2252 press Alt-F1 to switch to verbose mode and follow the prompt. If no selection is
2253 made in 10 seconds the default (US keyboard) will be accepted and the boot
2254 process will continue. Once the boot process completes, you will be
2255 automatically logged in to the &quot;Live&quot; Gentoo Linux as
2256 &quot;root&quot;, the super user. You should have a root (&quot;#&quot;) prompt
2257 on the current console and can also switch to other consoles by pressing Alt-F2,
2258 Alt-F3 and Alt-F4. Get back to the one you started on by pressing Alt-F1.
2259 </p>
2260
2261 <p>
2262 Now continue with <uri link="#hardware">Extra Hardware Configuration</uri>.
2263 </p>
2264
2265 </body>
2266 </subsection>
2267 <subsection id="hardware">
2268 <title>Extra Hardware Configuration</title>
2269 <body>
2270
2271 <p>
2272 When the Installation CD boots, it tries to detect all your hardware devices and
2273 loads the appropriate kernel modules to support your hardware. In the
2274 vast majority of cases, it does a very good job. However, in some cases
2275 it may not auto-load the kernel modules you need. If the PCI auto-detection
2276 missed some of your system's hardware, you will have to load the appropriate
2277 kernel modules manually.
2278 </p>
2279
2280 <p>
2281 In the next example we try to load the <c>8139too</c> module (support for
2282 certain kinds of network interfaces):
2283 </p>
2284
2285 <pre caption="Loading kernel modules">
2286 # <i>modprobe 8139too</i>
2287 </pre>
2288
2289 <p>
2290 If you need PCMCIA support, you should start the <c>pcmcia</c> init script:
2291 </p>
2292
2293 <pre caption="Starting the PCMCIA init script">
2294 # <i>/etc/init.d/pcmcia start</i>
2295 </pre>
2296
2297 </body>
2298 </subsection>
2299 <subsection>
2300 <title>Optional: Tweaking Hard Disk Performance</title>
2301 <body>
2302
2303 <p>
2304 If you are an advanced user, you might want to tweak the IDE hard disk
2305 performance using <c>hdparm</c>. With the <c>-tT</c> options you can
2306 test the performance of your disk (execute it several times to get a
2307 more precise impression):
2308 </p>
2309
2310 <pre caption="Testing disk performance">
2311 # <i>hdparm -tT /dev/hda</i>
2312 </pre>
2313
2314 <p>
2315 To tweak, you can use any of the following examples (or experiment
2316 yourself) which use <path>/dev/hda</path> as disk (substitute with your
2317 disk):
2318 </p>
2319
2320 <pre caption="Tweaking hard disk performance">
2321 <comment>Activate DMA:</comment> # <i>hdparm -d 1 /dev/hda</i>
2322 <comment>Activate Safe Performance Options:</comment> # <i>hdparm -d 1 -A 1 -m 16 -u 1 -a 64 /dev/hda</i>
2323 </pre>
2324
2325 </body>
2326 </subsection>
2327 <subsection id="useraccounts">
2328 <title>Optional: User Accounts</title>
2329 <body>
2330
2331 <p>
2332 If you plan on giving other people access to your installation
2333 environment or you want to chat using <c>irssi</c> without root privileges (for
2334 security reasons), you need to create the necessary user accounts and change
2335 the root password.
2336 </p>
2337
2338 <p>
2339 To change the root password, use the <c>passwd</c> utility:
2340 </p>
2341
2342 <pre caption="Changing the root password">
2343 # <i>passwd</i>
2344 New password: <comment>(Enter your new password)</comment>
2345 Re-enter password: <comment>(Re-enter your password)</comment>
2346 </pre>
2347
2348 <p>
2349 To create a user account, we first enter their credentials, followed by
2350 its password. We use <c>useradd</c> and <c>passwd</c> for these tasks.
2351 In the next example, we create a user called &quot;john&quot;.
2352 </p>
2353
2354 <pre caption="Creating a user account">
2355 # <i>useradd -m -G users john</i>
2356 # <i>passwd john</i>
2357 New password: <comment>(Enter john's password)</comment>
2358 Re-enter password: <comment>(Re-enter john's password)</comment>
2359 </pre>
2360
2361 <p>
2362 You can change your user id from root to the newly created user by using
2363 <c>su</c>:
2364 </p>
2365
2366 <pre caption="Changing user id">
2367 # <i>su - john</i>
2368 </pre>
2369
2370 </body>
2371 </subsection>
2372 <subsection>
2373 <title>Optional: Viewing Documentation while Installing</title>
2374 <body>
2375
2376 <p>
2377 If you want to view the Gentoo Handbook (either from-CD or online) during the
2378 installation, make sure you have created a user account (see <uri
2379 link="#useraccounts">Optional: User Accounts</uri>). Then press <c>Alt-F2</c> to
2380 go to a new terminal and log in.
2381 </p>
2382
2383 <p>
2384 If you want to view the documentation on the CD you can immediately run
2385 <c>links</c> to read it:
2386 </p>
2387
2388 <pre caption="Viewing the on-CD documentation">
2389 # <i>links /mnt/cdrom/docs/html/index.html</i>
2390 </pre>
2391
2392 <p>
2393 However, it is preferred that you use the online Gentoo Handbook as it will be
2394 more recent than the one provided on the CD. You can view it using <c>links</c>
2395 as well, but only after having completed the <e>Configuring your Network</e>
2396 chapter (otherwise you won't be able to go on the Internet to view the
2397 document):
2398 </p>
2399
2400 <pre caption="Viewing the Online Documentation">
2401 # <i>links http://www.gentoo.org/doc/en/handbook/handbook-x86.xml</i>
2402 </pre>
2403
2404 <p>
2405 You can go back to your original terminal by pressing <c>Alt-F1</c>.
2406 </p>
2407
2408 </body>
2409 </subsection>
2410 <subsection>
2411 <title>Optional: Starting the SSH Daemon</title>
2412 <body>
2413
2414 <p>
2415 If you want to allow other users to access your computer during the
2416 Gentoo installation (perhaps because those users are going to help you
2417 install Gentoo, or even do it for you), you need to create a user
2418 account for them and perhaps even provide them with your root password
2419 (<e>only</e> do that <e>if</e> you <b>fully trust</b> that user).
2420 </p>
2421
2422 <p>
2423 To fire up the SSH daemon, execute the following command:
2424 </p>
2425
2426 <pre caption="Starting the SSH daemon">
2427 # <i>/etc/init.d/sshd start</i>
2428 </pre>
2429
2430 <p>
2431 To be able to use sshd, you first need to set up your networking. Continue with
2432 the chapter on <uri link="?part=1&amp;chap=3">Configuring your Network</uri>.
2433 </p>
2434
2435 </body>
2436 </subsection>
2437 </section>
2438 </sections>
2439
2440
2441
2442 --
2443 gentoo-doc-cvs@g.o mailing list