/[gentoo]/xml/htdocs/doc/en/gentoo-x86-install.xml
Gentoo

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

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

Revision 1.85 Revision 1.86
29 </author> 29 </author>
30 <author title="Editor"> 30 <author title="Editor">
31 <mail link="zhware@gentoo.org">Stoyan Zhekov</mail> 31 <mail link="zhware@gentoo.org">Stoyan Zhekov</mail>
32 </author> 32 </author>
33 <author title="Editor"> 33 <author title="Editor">
34 <mail link="jhhudso@gentoo.org">Jared Hudson</mail> 34 <mail link="jhhudso@gentoo.org">Jared Hudson</mail>
35 </author> 35 </author>
36 <author title="Editor"> 36 <author title="Editor">
37 <mail link="">Colin Morey</mail> 37 <mail link="">Colin Morey</mail>
38 </author> 38 </author>
39 <abstract>These instructions step you through the process of installing Gentoo 39 <abstract>These instructions step you through the process of installing Gentoo
40 Linux 1.4_rc3. The Gentoo Linux installation process supports various installation 40 Linux 1.4_rc3. The Gentoo Linux installation process supports various installation
41 approaches, depending upon how much of the system you want to custom-build from 41 approaches, depending upon how much of the system you want to custom-build from
42 scratch. 42 scratch.
43 </abstract> 43 </abstract>
44<version>2.3.20</version> 44<version>2.4</version>
45 <date>6 March 2003</date> 45 <date>19 March 2003</date>
46 <chapter> 46 <chapter>
47 <title>About the Install</title> 47 <title>About the Install</title>
48 <section> 48 <section>
49 <body> 49 <body>
50 <p>This new boot CD will boot from nearly any modern IDE CD-ROM drive, as well 50 <p>This new boot CD will boot from nearly any modern IDE CD-ROM drive, as well
51as many SCSI CD-ROM drives, assuming that your CD-ROM and BIOS both support booting. 51as many SCSI CD-ROM drives, assuming that your CD-ROM and BIOS both support booting.
52Included on the CD-ROM is Linux support for IDE (and PCI IDE) (built-in to the 52Included on the CD-ROM is Linux support for IDE (and PCI IDE) (built-in to the
53kernel) as well as support for all SCSI devices (available as modules.) In 53kernel) as well as support for all SCSI devices (available as modules.) In
54addition, we provide modules for literally every kind of network card that 54addition, we provide modules for literally every kind of network card that
55Linux supports, as well as tools to allow you to configure your network and 55Linux supports, as well as tools to allow you to configure your network and
56establish outbound (as well as inbound) <c>ssh</c> connections and to download 56establish outbound (as well as inbound) <c>ssh</c> connections and to download
57files. </p> 57files. </p>
58 <p>To install from the build CD, you will need to have a 486+ processor and 58 <p>To install from the build CD, you will need to have a 486+ processor and
59ideally at least 64 Megabytes of RAM. (Gentoo Linux has been successfully 59ideally at least 64 Megabytes of RAM. (Gentoo Linux has been successfully
60built with 64MB of RAM + 64MB of swap space, but the build process is awfully 60built with 64MB of RAM + 64MB of swap space, but the build process is awfully
360 <section> 360 <section>
361 <body> 361 <body>
362 <p>Now you need to set your system's date and time. 362 <p>Now you need to set your system's date and time.
363 You can do this using the <c>date</c> command.</p> 363 You can do this using the <c>date</c> command.</p>
364<pre caption="Setting your system's date"> 364<pre caption="Setting your system's date">
365# <c>date</c> 365# <c>date</c>
366Thu Feb 27 09:04:42 CST 2003 366Thu Feb 27 09:04:42 CST 2003
367<comment>(If your date is wrong, set your date with this next command)</comment> 367<comment>(If your date is wrong, set your date with this next command)</comment>
368# <c>date 022709042003</c> 368# <c>date 022709042003</c>
369<comment>(date MMDDhhmmCCYY)</comment> 369<comment>(date MMDDhhmmCCYY)</comment>
370</pre> 370</pre>
371 </body> 371 </body>
372 </section> 372 </section>
373 </chapter> 373 </chapter>
374 <chapter> 374 <chapter>
375 <title>Partition Configuration</title> 375 <title>Filesystems, partitions and block devices</title>
376 <section>
377 <title>Introduction to block devices</title>
378 <body>
379<p>
380In this section, we'll take a good look at disk-oriented aspects of Gentoo Linux and Linux in general, including
381Linux filesystems, partitions and block devices. Then, once you're familar with the ins and outs of disks and
382filesystems, you'll be guided through the process of setting up partitions and filesystems for your Gentoo Linux
383install.
384</p>
385<p>
386To begin, I'll introduce "block devices". The most famous block device is
387probably the one that represents the first IDE drive in a Linux system:
388</p>
389<pre caption="/dev/hda, the block device representing the primary master IDE drive in your system">
390/dev/hda
391</pre>
392
393<p>
394If your system uses SCSI drives, then your first hard drive will be:
395</p>
396
397<pre caption="/dev/sda, the block device representing the first logical SCSI drive in your system">
398/dev/sda
399</pre>
400
401<p>The block devices above represent an <i>abstract</i> interface to the disk.
402User programs can use these block devices to interact with your disk without
403worrying about whether your drivers are IDE, SCSI or something else. The
404program can simply address the storage on the disk as a bunch of contiguous,
405randomly-accessible 512-byte blocks. </p>
406</body>
407</section>
376 <section> 408<section>
377 <body> 409<title>Partitions and fdisk</title>
378 <p>Now that the kernel can see the network card and disk controllers, it is time 410<body>
379 to set up disk partitions for Gentoo Linux. 411<p> Under Linux, we create filesystems by using a special command called
380 </p> 412<c>mkfs</c> (or <c>mke2fs</c>, <c>mkreiserfs</c>, etc,) specifying a particular
381 413block device as a command-line argument. </p>
382 <p>Here is a quick overview of the standard Gentoo Linux partition layout. 414
383 We're going to create at least three partitions: a swap partition, a root 415<p> However, although it is theoretically possible to use a "whole disk" block
384 partition (to hold the bulk of Gentoo Linux), and a special boot partition. 416device (one that represents the <i>entire</i> disk) like <c>/dev/hda</c> or
385 The boot partition is designed to hold the boot loader information as well as 417<c>/dev/sda</c> to house a single filesystem, this is almost never done in
386 your Linux kernel(s). The boot partition gives us a safe place to store 418practice. Instead, full disk block devices are split up into smaller, more
387 everything related to booting Linux. During normal day-to-day Gentoo Linux use, 419manageable block devices called "partititons". Partitions are created using a
388 your boot partition should remain <e>unmounted</e>. A working kernel will enable you to recover from most forms of 420tool called <c>fdisk</c>, which is used to create and edit the partition table
389filesystem corruption. Having your kernel in a non-mounted partition 421that's stored on each disk. The partition table defines exactly how to split
390will prevent filesystem corruption from affecting it. 422up the full disk. </p>
391 </p> 423
392 <p>Now, on to filesystem types. Right now, you have five filesystem options: 424<p> We can take a look at a disk's partition table by running <c>fdisk</c>,
393 XFS, ext2, ext3 (ext2 with journaling), jfs, and ReiserFS. ext2 is the tried and true Linux 425specifying a block device that represents a full disk as an argument: </p>
394 filesystem but doesn't have metadata journaling. ext3 is the new version of 426
395 ext2 with both metadata journaling and ordered data writes, effectively 427<note>Alternate interfaces to the disk's partition table include <c>cfdisk</c>,
396 providing data journaling as well. ReiserFS is a B*-tree based filesystem 428<c>parted</c> and <c>partimage</c></note>
397 that has very good small file performance, and greatly outperforms both ext2 and 429
398 ext3 when dealing with small files (files less than 4k), often by a factor of 430<pre caption="Starting up fdisk">
399 10x-15x. ReiserFS also scales extremely well and has metadata journaling. 431# fdisk /dev/hda
400 As of kernel 2.4.18+, ReiserFS is finally rock-solid and highly recommended. 432</pre>
401 XFS is a filesystem with metadata journaling that 433<p>
402 is fully supported under Gentoo Linux's <path>xfs-sources</path> kernel, but 434or
403 is generally not recommended due to its tendency to lose recently-modified 435</p>
404 data if your system locks up or unexpectedly reboots (as a result of power failure, for instance) 436<pre caption="Starting up fdisk to look at the partition table on /dev/sda">
405 Finally, jfs is IBM's own high performance journaling filesystem. Since it is obscure, we cannot comment either positively nor negatively on its stability.</p> 437# fdisk /dev/sda
406 <p>If you're looking for the most standard filesystem, use ext2. If you're looking 438</pre>
407 for the most rugged journaling filesystem, use ext3. If you're looking for a 439
408 high-performance filesystem with journaling support, use ReiserFS; both ext3 and ReiserFS are 440<impo>
409 mature and refined. 441<b>Note that you should <i>not</i> save or make any changes to a disk's
410 Here are our basic recommended filesystem 442partition table if any of its partitions contain filesystems that are in use or
411 sizes and types: 443contain important data. Doing so will generally cause data on the disk to be
412 </p> 444lost.</b>
413 <table> 445</impo>
414 <tr> 446
415 <th>Partition</th> 447<p>
416 <th>Size</th> 448Once in fdisk, you'll be greeted with a prompt that looks like this:
417 <th>Type</th> 449</p>
450
451<pre caption="The fdisk prompt">
452Command (m for help):
453</pre>
454
455
456<p>
457Type <c>p</c> to display your disk's current partition configuration:
458</p>
459
460<pre caption="An example partition configuration">
461Command (m for help): p
462
463Disk /dev/hda: 240 heads, 63 sectors, 2184 cylinders
464Units = cylinders of 15120 * 512 bytes
465
466Device Boot Start End Blocks Id System
467/dev/hda1 1 14 105808+ 83 Linux
468/dev/hda2 15 49 264600 82 Linux swap
469/dev/hda3 50 70 158760 83 Linux
470/dev/hda4 71 2184 15981840 5 Extended
471/dev/hda5 71 209 1050808+ 83 Linux
472/dev/hda6 210 348 1050808+ 83 Linux
473/dev/hda7 349 626 2101648+ 83 Linux
474/dev/hda8 627 904 2101648+ 83 Linux
475/dev/hda9 905 2184 9676768+ 83 Linux
476
477Command (m for help):
478</pre>
479
480<p> This particular disk is configured to house seven Linux filesystems (each
481with a corresponding partition listed as "Linux") as well as a swap partition
482(listed as "Linux swap"). </p>
483
484<p>
485Notice the name of the corresponding partition block
486devices on the left hand side, starting with <c>/dev/hda1</c> and going up to
487<c>/dev/hda9</c>. In the early days of the PC, partitioning software only
488allowed a maximum of four partitions (called "primary" partitions). This was
489too limiting, so a workaround called an <i>extended partitioning</i> was
490created. An extended partition is very similar to a primary partition, and
491counts towards the primary partition limit of four. However, extended
492partitions can hold any number of so-called <i>logical</i> partitions inside
493them, providing an effective means of working around the four partition limit.
494</p>
495
496<p>
497All partitions <c>hda5</c> and higher are logical partitions. The numbers 1
498through 4 are reserved for primary or extended partitions. </p>
499
500<p> So, In our example, <c>hda1</c> through <c>hda3</c> are primary partitions.
501<c>hda4</c> is an extended partition that contains logical partitions
502<c>hda5</c> through <c>hda9</c>. So, in this example, you would never actually
503<i>use</i> <c>/dev/hda4</c> for storing any filesystems directly -- it simply
504acts as a container for partitions <c>hda5</c> through <c>hda9</c>. </p>
505
506<p> Also, notice that each partition has an "Id", also called a "partition
507type". Whenever you create a new partition, you should ensure that the
508partition type is set correctly. '83' is the correct partition type for
509partitions that will be housing Linux filesystems, and '82' is the correct
510partition type for Linux swap partitions. You set the partition type using the
511<c>t</c> option in <c>fdisk</c>. The Linux kernel uses the partition type
512setting to auto-detect fileystems and swap devices on the disk at boot-time.
513</p>
514</body>
515</section>
516<section>
517<title>Using fdisk to set up partitions</title>
518<body>
519
520<p>Now that you've had your introduction to the way disks and partitioning is
521done under Linux, it's time to walk you through the process of setting up disk
522partitions for your Gentoo Linux installation. After we walk you through the
523process of creating partitions on your disk, your partition configuration will
524look like this: </p>
525
526<pre caption="The partition configuration that you will have after following these steps">
527Disk /dev/hda: 30.0 GB, 30005821440 bytes
528240 heads, 63 sectors/track, 3876 cylinders
529Units = cylinders of 15120 * 512 = 7741440 bytes
530
531 Device Boot Start End Blocks Id System
532/dev/hda1 * 1 14 105808+ 83 Linux
533/dev/hda2 15 81 506520 82 Linux swap
534/dev/hda3 82 3876 28690200 83 Linux
535
536Command (m for help):
537</pre>
538
539<p>In our suggested "newbie" partition configuration, we have three partitions.
540The first one (<c>/dev/hda1</c>) at the beginning of the disk is a small
541partition called a boot partition. The boot partition's purpose is to hold all
542the critical data related to booting -- GRUB boot loader information (if you
543will be using GRUB) as well as your Linux kernel(s). The boot partition gives
544us a safe place to store everything related to booting Linux. During normal
545day-to-day Gentoo Linux use, your boot partition should remain <e>unmounted</e>
546for safety. Again, the boot partition is <c>/dev/hda1</c>. If you are setting
547up a SCSI system, your boot partition will likely end up being
548<c>/dev/sda1</c>.</p>
549
550<p>The second partition (<c>/dev/hda2</c>) is used to for swap space. The
551kernel uses swap space as virtual memory when RAM becomes low. This partition,
552relatively speaking, isn't very big either, typically somewhere around 512MB.
553Again, if you're setting up a SCSI system, this partition will likely end up
554being <c>/dev/sda2</c>. </p>
555
556<p>The third partition (<c>/dev/hda3</c>) is quite large and takes up the rest
557of the disk. This partition is called our "root" partition and will be used to
558store your main filesystem that houses Gentoo Linux itself. On a SCSI system,
559this partition would likely end up being <c>/dev/sda3</c>.</p>
560
561
562<p>Before we partition the disk, here's a quick technical overview of the
563suggested partition and filesystem configuration to use when installing Gentoo
564Linux:</p>
565
566<table>
567 <tr>
568 <th>Partition</th>
569 <th>Size</th>
570 <th>Type</th>
418 <th>example device</th> 571 <th>example device</th>
419 </tr> 572 </tr>
420 <tr> 573 <tr>
421 <ti>boot partition, containing kernel(s) and boot information</ti> 574 <ti>boot partition, containing kernel(s) and boot information</ti>
422 <ti>100 Megabytes</ti> 575 <ti>100 Megabytes</ti>
423 <ti>ext2/3 highly recommended (easiest); if ReiserFS then mount with <c>-o notail</c></ti> 576 <ti>ext2/3 highly recommended (easiest); if ReiserFS then mount with <c>-o notail</c></ti>
424 <ti>/dev/hda1</ti> 577 <ti>/dev/hda1</ti>
425 </tr> 578 </tr>
426 <tr> 579 <tr>
427 <ti>swap partition (no longer a 128 Megabyte limit, now 2GB)</ti> 580 <ti>swap partition (no longer a 128 Megabyte limit, now 2GB)</ti>
428 <ti>Generally, configure a swap area that is between one to two times the size of the physical RAM 581 <ti>Generally, configure a swap area that is between one to two times the size of the physical RAM
429 in your system.</ti> 582 in your system.</ti>
430 <ti>Linux swap</ti> 583 <ti>Linux swap</ti>
431 <ti>/dev/hda2</ti> 584 <ti>/dev/hda2</ti>
432 </tr> 585 </tr>
433 <tr> 586 <tr>
434 <ti>root partition, containing main filesystem (/usr, /home, etc)</ti> 587 <ti>root partition, containing main filesystem (/usr, /home, etc)</ti>
435 <ti>&gt;=1.5 Gigabytes</ti> 588 <ti>&gt;=1.5 Gigabytes</ti>
436 <ti>ReiserFS, ext3 recommended; ext2 ok</ti> 589 <ti>ReiserFS, ext3 recommended; ext2 ok</ti>
437 <ti>/dev/hda3</ti> 590 <ti>/dev/hda3</ti>
438 </tr> 591 </tr>
439 </table> 592</table>
440 593
441 594<p>OK, now to create the partitions as in the example and table above. First,
442 <p>At this point, create your partitions using <c>fdisk</c>. Note that your partitions 595enter fdisk by typing <c>fdisk /dev/hda1</c> or <c>fdisk /dev/sda1</c>,
443 should be of type 82 for swap and 83 for regular filesystems (whether ReiserFS, ext2/3 or other). </p> 596depending on whether you're using IDE or SCSI. Then, type <c>p</c> to view your
444 <note><c>cfdisk</c> is included on the install CD, and it is <i>considerably</i> easier to use than 597current partition configuration. Is there anything on the disk that you need
445 <c>fdisk</c>. Just type <c>cfdisk</c> to run it; by default, cfdisk will work with <b>/dev/hda</b>. If /dev/hda is not the hard disk you want to partition, give the right value to cfdisk as a parameter. For example: <c>cfdisk /dev/hde</c></note> 598to keep? If so, <b>stop now</b>. If you continue with these directions, <b>all
446 <note>If <c>fdisk</c> or <c>cfdisk</c> instruct you to do so, please reboot to allow your system to detect the 599existing data on your disk will be erased.</b></p>
447new partition configuration.</note> 600
601<impo>Following these instructions below will cause all prior data on your disk
602to <b>be erased</b>! If there is anything on your drive, please be sure that it
603is non-critical information that you don't mind losing. Also make sure that you
604<b>have selected the correct drive</b> so that you don't mistakenly wipe data
605from the wrong drive.</impo>
606
607<p>Now, it's time to delete any existing partitions. To do this, type <c>d</c>
608and hit Enter. You will then be prompted for the partition number you would like
609to delete. To delete a pre-existing <c>/dev/hda1</c>, you would type:</p>
610
611<pre caption="Deleting a partition">
612Command (m for help): d
613Partition number (1-4): 1
614</pre>
615
616<p>The partition has been scheduled for deletion. It will no longer show up if
617you type <c>p</c>, but it will not be erased until your changes have been
618saved. If you made a mistake and want to abort without saving your changes,
619type <c>q</c> immediately and hit enter and your partition will not be
620deleted.</p>
621<!-- NOTE: THis is not sufficient documentation to cover ATA Raid and I just
622find it confusing, so I'm commenting it out (drobbins)
448 <note>If you are using RAID your partitions will be a little different. You 623<note>If you are using RAID your partitions will be a little different. You
449will have the partitions like this: <path>/dev/ataraid/discX/partY</path> X are 624will have the partitions like this: <path>/dev/ataraid/discX/partY</path> X are
450the arrays you have made, so if you only have made 1 array, then it will be 625the arrays you have made, so if you only have made 1 array, then it will be
451disc0.Y is the partition number as in <path>/dev/hdaY</path> </note> 626disc0.Y is the partition number as in <path>/dev/hdaY</path> </note>
452 <p>Once you've created your partitions, it is time to initialize 627-->
453 the filesystems that will be used to house your data.</p> 628<p>Now, assuming that you do indeed want to wipe out all the partitions on your
454 629system, repeatedly type <c>p</c> to print out a partition listing and then type
630<c>d</c> and the number of the partition to delete it. Eventually, you'll end up
631with a partition table with nothing in it:</p>
632
633<pre caption="An empty partition table">
634Disk /dev/hda: 30.0 GB, 30005821440 bytes
635240 heads, 63 sectors/track, 3876 cylinders
636Units = cylinders of 15120 * 512 = 7741440 bytes
637
638 Device Boot Start End Blocks Id System
639
640Command (m for help):
641</pre>
642
643<p>Now that the in-memory partition table is empty, we're ready to create a
644boot partition. To do this, type <c>n</c> to create a new partition, then
645<c>p</c> to tell fdisk you want a primary partition. Then type <c>1</c> to
646create the first primary partition. When prompted for the first cylinder, hit
647enter. When prompted for the last cylinder, type <c>+100M</c> to create a
648partition 100MB in size. You can see output from these steps below:</p>
649
650<pre caption="Steps to create our boot partition">
651Command (m for help): n
652Command action
653 e extended
654 p primary partition (1-4)
655p
656Partition number (1-4): 1
657First cylinder (1-3876, default 1):
658Using default value 1
659Last cylinder or +size or +sizeM or +sizeK (1-3876, default 3876): +100M
660</pre>
661
662<p>Now, when you type <c>p</c>, you should see the following partition printout:</p>
663
664<pre caption="Our first partition has been created">
665Command (m for help): p
666
667Disk /dev/hda: 30.0 GB, 30005821440 bytes
668240 heads, 63 sectors/track, 3876 cylinders
669Units = cylinders of 15120 * 512 = 7741440 bytes
670
671 Device Boot Start End Blocks Id System
672/dev/hda1 1 14 105808+ 83 Linux
673</pre>
674
675<p>Next, let's create the swap partition. To do this, type <c>n</c> to create a
676new partition, then <c>p</c> to tell fdisk that you want a primary partition. Then
677type <c>2</c> to create the second primary partition, <c>/dev/hda2</c> in our case.
678When prompted for the first cylinder, hit enter. When prompted for the last cylinder,
679type <c>+512M</c> to create a partition 512MB in size. After you've done this, type
680<c>t</c> to set the partition type, and then type in <c>82</c> to set the partition
681type to "Linux Swap". After completing these steps, typing <c>p</c> should display
682a partition table that looks similar to this:</p>
683
684<pre caption="Our swap partition has been created">
685Command (m for help): p
686
687Disk /dev/hda: 30.0 GB, 30005821440 bytes
688240 heads, 63 sectors/track, 3876 cylinders
689Units = cylinders of 15120 * 512 = 7741440 bytes
690
691 Device Boot Start End Blocks Id System
692/dev/hda1 1 14 105808+ 83 Linux
693/dev/hda2 15 81 506520 82 Linux swap
694</pre>
695
696<p>Finally, let's create the root partition. To do this, type <c>n</c> to
697create a new partition, then <c>p</c> to tell fdisk that you want a primary
698partition. Then type <c>3</c> to create the second primary partition,
699<c>/dev/hda3</c> in our case. When prompted for the first cylinder, hit enter.
700When prompted for the last cylinder, hit enter to create a partition that takes
701up the rest of the remaining space on your disk. After completing these steps,
702typing <c>p</c> should display a partition table that looks similar to
703this:</p>
704
705<pre caption="Our root partition has been created">
706Command (m for help): p
707
708Disk /dev/hda: 30.0 GB, 30005821440 bytes
709240 heads, 63 sectors/track, 3876 cylinders
710Units = cylinders of 15120 * 512 = 7741440 bytes
711
712 Device Boot Start End Blocks Id System
713/dev/hda1 1 14 105808+ 83 Linux
714/dev/hda2 15 81 506520 82 Linux swap
715/dev/hda3 82 3876 28690200 83 Linux
716</pre>
717
718<p>
719Finally, we need to set the "bootable" flag on our boot partition and then write
720our changes to disk. To tag <c>/dev/hda1</c> as a "bootable" partition, type
721<c>a</c> at the menu and then type in <c>1</c> for the partition number. If you
722type <c>p</c> now, you'll now see that <c>/dev/hda1</c> has a <c>*</c> in the "Boot"
723column. Now, let's write our changes to disk. To do this, type <c>w</c> and hit
724enter. Your disk partitions are now properly configured for a Gentoo Linux
725install.
726</p>
727
728<note>If <c>fdisk</c> or <c>cfdisk</c> instruct you to do so, please reboot to
729allow your system to detect the new partition configuration.</note>
730</body>
731</section>
732<section>
733<title>Creating filesystems</title>
734<body>
735<p>Now that the partitions have been created, it's time to set up filesystems on
736the boot and root partitions so that they can be mounted and used to store data.
737We will also configure the swap partition to serve as swap storage.
738</p>
739
740<p>Gentoo Linux supports a variety of different types of filesystems; each type has
741its strengths and weaknesses and its own set of performance characteristics. Currently,
742we support the creation of ext2, ext3, XFS, JFS and ReiserFS filesystems.</p>
743
744<p>ext2 is the tried and true Linux filesystem but doesn't have metadata
745journaling, which means that routine ext2 filesystem checks at startup time can
746be quite time-consuming. There is now quite a selection of newer-generation
747<i>journaled</i> filesystems that can be checked for consistency very quickly
748and are thus generally preferred over their non-journaled counterparts.
749Journaled filesystems prevent long delays when you boot your system and your
750filesystem happens to be in an <i>inconsistent</i> state.</p>
751
752<p>ext3 is the journaled version of the ext2 filesystem, providing metadata
753journaling for fast recovery in addition to other enhanced journaling modes
754like full data and ordered data journaling. ext3 is a very good and reliable
755filesystem. While it isn't a performance leader, it offers generally decent
756performance under most conditions and for filesystems of a typical size. Because
757it does not extensively employ the use of "trees" in its internal design, it
758doesn't scale very well, meaning that it is not an ideal choice for very large
759filesystems, or situations where you will be handling very large files or large quantities of
760files in a single directory. When used within its design parameters, ext3 is
761an excellent filesystem.</p>
762
763<p>ReiserFS is a B*-tree based filesystem that has very good overall
764performance and greatly outperforms both ext2 and ext3 when dealing with small
765files (files less than 4k), often by a factor of 10x-15x. ReiserFS also scales
766extremely well and has metadata journaling. As of kernel 2.4.18+, ReiserFS is
767now rock-solid and highly recommended for use both as a general-purpose
768filesystem and for extreme cases such as the creation of large filesystems, the
769use of many small files, very large files, and directories containing tens of
770thousands of files. ReiserFS is the filesystem we recommend by default for all
771non-boot partitions.</p>
772
773<p>XFS is a filesystem with metadata journaling that is fully supported under
774Gentoo Linux's <path>xfs-sources</path> kernel. It comes with a robust
775feature-set and is optimized for scalability. We only recommend using this
776filesystem on Linux systems with high-end SCSI and/or fibre channel storage and
777a uninterruptible power supply. Because XFS aggressively caches in-transit data
778in RAM, improperly designed programs (those that don't take proper precautions
779when writing files to disk, and there are quite a few of them) can lose a good
780deal of data if the system goes down unexpectedly.</p>
781
782<p>JFS is IBM's own high performance journaling filesystem. It has recently
783become production-ready, and there hasn't been a sufficient track record to
784comment either positively nor negatively on its general stability at this
785point.</p>
786
787<p>If you're looking for the most rugged journaling filesystem, use ext3. If
788you're looking for a good general-purpose high-performance filesystem with
789journaling support, use ReiserFS; both ext3 and ReiserFS are mature,
790refined and recommended for general use.</p>
791
792<!-- Corner case, confusing
455 <p>But before creating filesystems, you may want to initialize the 793 <p>But before creating filesystems, you may want to initialize the
456 beginning of your partition using <c>dd</c> if you are using a pre-existing partition that has been used before. 794 beginning of your partition using <c>dd</c> if you are using a pre-existing partition that has been used before.
457 This is particularly helpful when you're going to create a new XFS filesystem on a partition that previously contained 795 This is particularly helpful when you're going to create a new XFS filesystem on a partition that previously contained
458 a ReiserFS filesystem. Doing this will ensure that your new filesystem 796 a ReiserFS filesystem. Doing this will ensure that your new filesystem
459 will not be mis-identified by Linux's filesystem auto-detection code. 797 will not be mis-identified by Linux's filesystem auto-detection code.
460 This can be done as follows: 798 This can be done as follows:
461 </p> 799 </p>
462<pre caption="Initializing first 1024 bytes of your partition"> 800<pre caption="Initializing first 1024 bytes of your partition">
463# <c>dd if=/dev/zero of=/dev/hda3 bs=1k count=1</c> 801# <c>dd if=/dev/zero of=/dev/hda3 bs=1k count=1</c>
464<comment>(Replace /dev/hda3 with the partition you wish to &quot;clean.&quot;)</comment> 802<comment>(Replace /dev/hda3 with the partition you wish to &quot;clean.&quot;)</comment>
465</pre> 803</pre>
466 <warn>The command above will destroy all data from <path>/dev/hda3</path>. 804 <warn>The command above will destroy all data from <path>/dev/hda3</path>.
467 Be careful and check twice which partition you specify for zeroing. 805 Be careful and check twice which partition you specify for zeroing.
468 If you make a mistake it might result in a loss of data. 806 If you make a mistake it might result in a loss of data.
469 </warn> 807 </warn>
808-->
809
810<p>Based on our example above, we will use the following commands to initialize
811all our partitions for use:</p>
812
813<pre caption="Initializing our partitions (example)">
814# mke2fs -j /dev/hda1
815# mkswap /dev/hda2
816# mkreiserfs /dev/hda3
817</pre>
818
819<p>We choose ext3 for our <c>/dev/hda1</c> boot partition because it is a robust journaling
820filesystem supported by all major boot loaders. We used <c>mkswap</c> for our <c>/dev/hda2
821</c> swap partition -- the choice is obvious here. And for our main root filesystem on
822<c>/dev/hda3</c> we choose ReiserFS, since it is a solid journaling filesystem offering excellent
823performance. Now, go ahead and initialize your partitions. Here are the various commands
824available to create various filesystem types:</p>
825
470 <p>Now, initialize your swap partition as follows:</p> 826 <p>To initialize the swap partition:</p>
471<pre caption="Initializing Swap"> 827<pre caption="Initializing Swap">
472# <c>mkswap /dev/hda2</c> 828# <c>mkswap /dev/hda2</c>
473</pre> 829</pre>
474 <p>You can use the <c>mke2fs</c> command to create ext2 filesystems.</p> 830<p>You can use the <c>mke2fs</c> command to create ext2 filesystems.</p>
475<pre caption="Creating an ext2 Filesystem"> 831<pre caption="Creating an ext2 Filesystem">
476# <i>mke2fs /dev/hda1</i> 832# <i>mke2fs /dev/hda1</i>
833</pre>
834<p>If you would like to use ext3, you can create ext3 filesystems using
835 <c>mke2fs -j</c>.</p>
836<pre caption="Creating an ext3 Filesystem">
837# <c>mke2fs -j /dev/hda3</c>
838</pre>
839 <note>You can find out more about using ext3 under Linux 2.4 at
840 <uri>http://www.zip.com.au/~akpm/linux/ext3/ext3-usage.html</uri>.</note>
841 <p>To create ReiserFS filesystems, use the <c>mkreiserfs</c> command.</p>
842<p>Use <c>mkreiserfs</c> to create a ReiserFS filesystem</p>
843<pre caption="Creating a ReiserFS Filesystem">
844# <c>mkreiserfs /dev/hda3</c>
477</pre> 845</pre>
478 <p>To create an XFS filesystem, use the <c>mkfs.xfs</c> command.</p> 846 <p>To create an XFS filesystem, use the <c>mkfs.xfs</c> command.</p>
479<pre caption="Creating a XFS Filesystem"> 847<pre caption="Creating a XFS Filesystem">
480# <c>mkfs.xfs /dev/hda3</c> 848# <c>mkfs.xfs /dev/hda3</c>
481</pre> 849</pre>
482 <note>You may want to add a couple of additional flags to the 850 <note>You may want to add a couple of additional flags to the
483 <c>mkfs.xfs</c> command: <c>-d agcount=3 -l size=32m</c>. 851 <c>mkfs.xfs</c> command: <c>-d agcount=3 -l size=32m</c>.
484 The <c>-d agcount=3</c> command will lower the number of allocation groups. 852 The <c>-d agcount=3</c> command will lower the number of allocation groups.
485 XFS will insist on using at least 1 allocation group per 4 GB of your 853 XFS will insist on using at least 1 allocation group per 4 GB of your
486 partition, so, for example, if you have a 20 GB partition you will need 854 partition, so, for example, if you have a 20 GB partition you will need
487 a minimum agcount of 5. The <c>-l size=32m</c> command increases the 855 a minimum agcount of 5. The <c>-l size=32m</c> command increases the
488 journal size to 32 Mb, increasing performance.</note> 856 journal size to 32 Mb, increasing performance.</note>
489 <p>If you would like to use ext3, you can create ext3 filesystems using 857
490 <c>mke2fs -j</c>.</p>
491<pre caption="Creating an ext3 Filesystem">
492# <c>mke2fs -j /dev/hda3</c>
493</pre>
494 <note>You can find out more about using ext3 under Linux 2.4 at
495 <uri>http://www.zip.com.au/~akpm/linux/ext3/ext3-usage.html</uri>.</note>
496 <p>To create ReiserFS filesystems, use the <c>mkreiserfs</c> command.</p>
497<pre caption="Creating a ReiserFS Filesystem">
498# <c>mkreiserfs /dev/hda3</c>
499</pre>
500 <p>To create JFS filesystems, use the <c>mkfs.jfs</c> command.</p> 858 <p>To create JFS filesystems, use the <c>mkfs.jfs</c> command.</p>
501<pre caption="Creating a JFS Filesystem"> 859<pre caption="Creating a JFS Filesystem">
502# <c>mkfs.jfs /dev/hda3</c> 860# <c>mkfs.jfs /dev/hda3</c>
503</pre> 861</pre>
504 </body> 862 </body>
505 </section> 863 </section>
506 </chapter> 864 </chapter>
507 <chapter> 865 <chapter>
508 <title>Mount Partitions</title> 866 <title>Mount Partitions</title>
509 <section> 867 <section>
510 <body> 868 <body>
511 <p>Now, we will activate our new swap, since we may need the additional virtual memory that it 869 <p>Now, we will activate our newly-initialized swap volume, since we may need the additional virtual memory that it
512 provides later: 870 provides later:
513 </p> 871 </p>
514<pre caption="Activating Swap"> 872<pre caption="Activating Swap">
515# <c>swapon /dev/hda2</c> 873# <c>swapon /dev/hda2</c>
516</pre> 874</pre>
875
517 <p>Next, we will create the <path>/mnt/gentoo</path> and <path>/mnt/gentoo/boot</path> mount points, 876 <p>Next, we will create the <path>/mnt/gentoo</path> and <path>/mnt/gentoo/boot</path> mount points,
518 and we will mount our filesystems to these mount points. </p> 877 and we will mount our filesystems to these mount points. One our boot and root filesystems are
878 mounted, any files we copy or create inside <path>/mnt/gentoo</path> will be placed on our new filesystems.
879 Note that if you are setting up Gentoo
880 Linux with separate <path>/usr</path> or <path>/var</path> filesystems, these would get mounted to
881 <path>/mnt/gentoo/usr</path> and <path>/mnt/gentoo/var</path> respectively.
882 </p>
883
884 <impo>If your <e>boot</e> partition (the one holding the kernel) is ReiserFS, be sure to mount it
885 with the <c>-o notail</c> option so GRUB gets properly installed. Make sure
886 that <c>notail</c> ends up in your new <path>/etc/fstab</path> boot partition entry, too.
887 We will get to that in a bit.
888 </impo>
889
519<pre caption="Creating Mount Points"> 890<pre caption="Creating Mount Points">
520# <c>mkdir /mnt/gentoo</c> 891# <c>mkdir /mnt/gentoo</c>
521# <c>mount /dev/hda3 /mnt/gentoo</c> 892# <c>mount /dev/hda3 /mnt/gentoo</c>
522# <c>mkdir /mnt/gentoo/boot</c> 893# <c>mkdir /mnt/gentoo/boot</c>
523# <c>mount /dev/hda1 /mnt/gentoo/boot</c> 894# <c>mount /dev/hda1 /mnt/gentoo/boot</c>
524</pre> 895</pre>
525 <p> 896
526 If you are setting up Gentoo
527 Linux with a separate <path>/usr</path> or <path>/var</path>, these would get mounted to
528 <path>/mnt/gentoo/usr</path> and <path>/mnt/gentoo/var</path>, respectively.
529 </p>
530 <impo>If your <e>boot</e> partition (the one holding the kernel) is ReiserFS, be sure to mount it
531 with the <c>-o notail</c> option so GRUB gets properly installed. Make sure
532 that <c>notail</c> ends up in your new <path>/etc/fstab</path> boot partition entry, too.
533 We will get to that in a bit.
534 </impo>
535 <impo>If you are having problems mounting your boot partition with ext2, try using 897 <impo>If you are having problems mounting your boot partition with ext2, try using
536 <c>mount /dev/hXX /mnt/gentoo/boot -t ext2 </c> </impo> 898 <c>mount /dev/hXX /mnt/gentoo/boot -t ext2 </c> </impo>
537 </body> 899 </body>
538 </section> 900 </section>
539 </chapter> 901 </chapter>
540 <chapter> 902 <chapter>
903 <title>Stage tarballs and chroot</title>
904 <section>
541 <title>Obtaining the Desired 'stage-x' Tarball</title> 905 <title>Selecting the desired stage tarball</title>
542 <section>
543 <body> 906 <body>
544 <p>If you are using the 3stages LiveCD to install, you already have all of the stage 907
545 tarballs available on the CD.
546 If this is the case, copy the tarball of your choice to <mnt>/mnt/gentoo</mnt>
547 </p> 908<p>
909Now, you need to decide which one you would like to use as a
910basis for the install if you haven't already.</p>
548 911
549 <p>Alternatively, if you have the basic LiveCD, the stage1 tarball is still available on 912<p>If you are using the &quot;from scratch, build everything&quot; install
550 the CD in <path>/mnt/cdrom/gentoo</path>. You will have to download the other stages though, 913method, you will want to use the <path>stage1-x86-1.4_rc3.tar.bz2</path> image.
551 and the best place to which to download them is <path>/mnt/gentoo</path>. 914If you're using one of our bigger CDs like the "3stages" ISO, you will also
552 </p> 915have a choice of a stage2 and stage3 image. These images allow you to save
553 916time at the expense of configurability (we've already chosen compiler
917optimizations and default USE variables for you.) The stages on the CD are
918accessible at <path>/mnt/cdrom/gentoo</path>, and you can type <c>ls /mnt/cdrom/gentoo</c>
919to see what's available on your CD.</p>
920
921<p>If you would like to perform an install using a stage tarball that is
922<i>not</i> on your CD , this is still possible, but you'll need to download the
923stage you want using the following instructions. If you already have the stage
924tarball you want to use (most users), then proceed to the "Extracting the stage
925tarball" section.</p>
926
554<pre caption="Downloading Required Stages"> 927<pre caption="Downloading Required Stages">
555# <c>cd /mnt/gentoo</c> 928# <c>cd /mnt/gentoo</c>
556<comment>Use lynx to get the URL for your tarball:</comment> 929<comment>Use lynx to get the URL for your tarball:</comment>
557# <c>lynx http://www.ibiblio.org/pub/Linux/distributions/gentoo/releases/1.4_rc3/x86/</c> 930# <c>lynx http://www.ibiblio.org/pub/Linux/distributions/gentoo/releases/1.4_rc3/x86/</c>
558<comment>Use <c>Up</c> and <c>Down</c> arrows keys (or the <c>TAB</c> key) to go to the right directory 931<comment>Use <c>Up</c> and <c>Down</c> arrows keys (or the <c>TAB</c> key) to go to the right directory
559Highlight the appropriate stage you want to download 932Highlight the appropriate stage you want to download
560Press <c>d</c> which will initiate the download 933Press <c>d</c> which will initiate the download
561Save the file and quit the browser 934Save the file and quit the browser
562 935
563<b>OR</b> use wget from the command line:</comment> 936<b>OR</b> use wget from the command line:</comment>
564# <c>wget <comment>insert URL to the required stage tarball here.</comment></c> 937# <c>wget <comment>insert URL to the required stage tarball here.</comment></c>
565</pre> 938</pre>
566 </body> 939 </body>
567 </section> 940 </section>
568 </chapter> 941 <section>
569 <chapter>
570 <title>Unpacking the Stage Tarball</title> 942 <title>Extracting the stage tarball</title>
571 <section>
572 <body> 943 <body>
944
573 <p>Now it is time to extract the compressed stage tarball of your choice 945<p>Now it is time to extract the compressed stage tarball of your choice to
574 to <path>/mnt/gentoo</path>. You only need to unpack the stage tarball 946<path>/mnt/gentoo/</path>. Remember, you only need to unpack <b>one</b> stage
575 for the stage you want to start at. So, if you wanted to perform a 947tarball, either a stage1, stage2 or stage3. So, if you wanted to perform a
576 stage3 install of Gentoo, then you would unpack the stage3 tarball. 948stage3 install of Gentoo, then you would just unpack the stage3 tarball.
577 Next, we will <c>chroot</c> over to the new Gentoo Linux build installation to &quot;enter&quot; the new 949Unpack the stage tarball as follows:</p>
578 Gentoo Linux system. 950
579 </p>
580 <impo>Be sure to use the <c>p</c> option with <c>tar</c>. Forgetting to do this will 951<impo>Be sure to use the <c>p</c> option with <c>tar</c>. Forgetting to do this will
581 cause certain files to have incorrect permissions.</impo> 952cause certain files to have incorrect permissions.</impo>
582 <p>If you are using the &quot;from scratch, build everything&quot; install method, 953
583 you will want to use the <path>stage1-x86-1.4_rc3.tar.bz2</path> image.
584 If you're using one of our bigger CDs, you will also have a choice of a stage2 and stage3 image.
585 These images allow you to save time at the expense of configurability (we've already chosen
586 compiler optimizations and default USE variables for you.)
587 </p>
588<pre caption="Unpacking the Stages"> 954<pre caption="Unpacking the Stages">
589# <c>cd /mnt/gentoo</c> 955# <c>cd /mnt/gentoo</c>
956<comment>Change "stage3" to "stage2" or "stage1" if you want to start from these stages instead.</comment>
957<comment>If you downloaded your stage tarball, change the path below to begin with "/mnt/gentoo/"
958instead of "/mnt/cdrom/gentoo/".</comment>
590# <c>tar -xvjpf /mnt/cdrom/gentoo/stage?-*.tbz2</c> 959# <c>tar -xvjpf /mnt/cdrom/gentoo/stage3-*.tbz2</c>
960</pre>
961
962<p>If you downloaded your stage tarball to <path>/mnt/gentoo</path>, you can now delete it by typing
963<c>rm /mnt/gentoo/stage*.tbz2</c>.</p>
964</body>
965</section>
966<section>
967<title>Entering the chroot</title>
968<body>
969<p>
970Next, we will <c>chroot</c> over to the new Gentoo Linux build installation to &quot;enter&quot; the new
971Gentoo Linux system.
972</p>
973
974<pre caption="Prepping and entering the chroot environment">
591# <c>mount -o bind /proc /mnt/gentoo/proc</c> 975# <c>mount /proc /mnt/gentoo/proc</c>
592# <c>cp /etc/resolv.conf /mnt/gentoo/etc/resolv.conf</c> 976# <c>cp /etc/resolv.conf /mnt/gentoo/etc/resolv.conf</c>
593</pre>
594<pre caption="Entering the chroot Environment">
595# <c>chroot /mnt/gentoo /bin/bash</c> 977# <c>chroot /mnt/gentoo /bin/bash</c>
596# <c>env-update</c> 978# <c>env-update</c>
597Regenerating /etc/ld.so.cache... 979Regenerating /etc/ld.so.cache...
598# <c>source /etc/profile</c> 980# <c>source /etc/profile</c>
599<comment>(The above points your shell to the new paths and updated binaries.)</comment> 981<comment>(The above points your shell to the new paths and updated binaries.)</comment>
600</pre> 982</pre>
601 <p>After you execute these commands, you will be &quot;inside&quot; your new Gentoo Linux environment.</p> 983 <p>After you execute these commands, you will be &quot;inside&quot; your new Gentoo Linux environment in <path>/mnt/gentoo</path>.
984 We can perform the rest of the installation process inside the chroot.
985 </p>
602 </body> 986 </body>
603 </section> 987 </section>
604 </chapter> 988 </chapter>
605 <chapter> 989 <chapter>
606 <title>Getting the Current Portage Tree using sync</title> 990 <title>Getting the Current Portage Tree using sync</title>
607 <section> 991 <section>
608 <body> 992 <body>
609 <p>Now, you will need to run <c>emerge sync</c>. This will make sure that 993
610 you have the most current copy of the Portage tree. </p> 994<p>Now, you will need to run <c>emerge sync</c>. This command tells Portage to download
995the most recent copy of the Gentoo Linux Portage tree.
996The Portage tree
997and contains all the scripts (called ebuilds) used to build every package
998under Gentoo Linux. Currently, we have ebuild scripts for close to 4000 packages. nce <c>emerge sync</c>
999completes, you will have a complete Portage tree in <path>/usr/portage</path>.</p>
1000
611<pre caption="Updating Using sync"> 1001<pre caption="Updating Using sync">
612# <c>emerge sync</c> 1002# <c>emerge sync</c>
613# <c>export CONFIG_PROTECT="-*"</c>
614# <c>export USE="-* bootstrap build"</c>
615# <c>emerge portage</c>
616# <c>unset USE</c>
617</pre> 1003</pre>
618 <p>The Portage tree will be downloaded and stored in <path>/usr/portage</path>;
619 it is about 90Mb in size without tarballs.
620 </p>
621 <note>The <c>export CONFIG_PROTECT=&quot;-*&quot;</c> line ensures that any new scripts
622 installed to <path>/etc</path> will overwrite the old scripts (stored in
623 <path>sys-apps/baselayout</path>), bypassing Portage's new config file
624 management support. Type <c>emerge --help config</c> for more details.</note>
625 1004
626 </body> 1005 </body>
627 </section> 1006 </section>
628 </chapter> 1007 </chapter>
629 <chapter> 1008 <chapter>
630 <title>Setting Gentoo optimizations (make.conf)</title> 1009 <title>Setting Gentoo optimizations (make.conf)</title>
631 <section> 1010 <section>
632 <body> 1011 <body>
1012
633 <p>Now that you have a working copy of the Portage tree, 1013<p>Now that you have a working copy of the Portage tree, it is time to
634 it is time to customize the optimization and optional build-time settings to use 1014customize the optimization and optional build-time settings to use on your
635 on your Gentoo Linux system. First 1015Gentoo Linux system. Portage will use these settings when compiling any
636 edit the file <path>/etc/make.conf</path>. In this file, you should set your 1016programs for you. To do this, edit the file <path>/etc/make.conf</path>. In
637 <c>USE</c> flags, which specify optional functionality that you would 1017this file, you should set your <c>USE</c> flags, which specify optional
638 like to be built into packages if available; generally, the defaults (an <e>empty</e> 1018functionality that you would like to be built into packages if available;
639 or unset <c>USE</c> variable) are fine. 1019generally, the defaults (an <e>empty</e> or unset <c>USE</c> variable) are
640 More information on <c>USE</c> flags can be found 1020fine. More information on <c>USE</c> flags can be found <uri
641 <uri link="http://www.gentoo.org/doc/en/use-howto.xml">here</uri>. 1021link="http://www.gentoo.org/doc/en/use-howto.xml">here</uri>. A complete list
642 A complete list of current USE flags can be found 1022of current USE flags can be found <uri
643 <uri link="http://www.gentoo.org/dyn/use-index.xml">here</uri>. 1023link="http://www.gentoo.org/dyn/use-index.xml">here</uri>. </p>
644 </p> 1024
645 <p>You also should set appropriate <c>CHOST</c>, <c>CFLAGS</c> and 1025<p>You also should set appropriate <c>CHOST</c>, <c>CFLAGS</c> and
646 <c>CXXFLAGS</c> settings for the kind of system that you are creating 1026<c>CXXFLAGS</c> settings for the kind of system that you are creating
647 (commented examples can be found further down in the file.) These settings 1027(commented examples can be found further down in the file.) These settings
648 will be used to tell the C and C++ compiler how to optimize the code that 1028will be used to tell the C and C++ compiler how to optimize the code that
649 is generated on your system. It is common for users with Athlon XP processors 1029is generated on your system. It is common for users with Athlon XP processors
650 to specify a "-march=athlon-xp" setting in their CFLAGS and CXXFLAGS settings 1030to specify a "-march=athlon-xp" setting in their CFLAGS and CXXFLAGS settings
651 so that all packages built will be optimized for the instruction set and 1031so that all packages built will be optimized for the instruction set and
652 performance characteristics of their CPU, for example. The <path>/etc/make.conf</path> 1032performance characteristics of their CPU, for example. The <path>/etc/make.conf</path>
653 file contains a general guide for the proper settings of CFLAGS and CXXFLAGS.</p> 1033file contains a general guide for the proper settings of CFLAGS and CXXFLAGS.</p>
654 1034
655 <p>If necessary, you can also set proxy information here if you are behind a 1035<p>If necessary, you can also set proxy information here if you are behind a
656 firewall. 1036firewall. Use the following command to edit <path>/etc/make.conf</path> using <c>nano</c>,
657 </p> 1037a simple visual editor.
1038</p>
658<pre caption="Setting make.conf Options"> 1039<pre caption="Setting make.conf Options">
659# <c>nano -w /etc/make.conf</c> 1040# <c>nano -w /etc/make.conf</c>
660<comment>(Adjust these settings)</comment> 1041<comment>(Edit CHOST, CFLAGS, CXXFLAGS and any necessary USE or proxy settings)</comment>
661</pre> 1042</pre>
662 <note> 1043 <note>
663 People who need to substantially customize the build process should take a look at 1044 People who need to substantially customize the build process should take a look at
664 the <path>/etc/make.globals</path> file. This file comprises gentoo defaults and 1045 the <path>/etc/make.globals</path> file. This file comprises gentoo defaults and
665 should never be touched. If the defaults do not suffice, then new values should 1046 should never be touched. If the defaults do not suffice, then new values should
666 be put in <path>/etc/make.conf</path>, as entries in <path>make.conf</path> 1047 be put in <path>/etc/make.conf</path>, as entries in <path>make.conf</path>
667 <comment>override</comment> the entries in <path>make.globals</path>. If you're 1048 <comment>override</comment> the entries in <path>make.globals</path>. If you're
668 interested in customizing USE settings, look in <path>/etc/make.profile/make.defaults</path>. 1049 interested in customizing USE settings, look in <path>/etc/make.profile/make.defaults</path>.
669 If you want to turn off any USE settings found here, add an appropriate <c>USE=&quot;-foo&quot;</c> 1050 If you want to turn off any USE settings found here, add an appropriate <c>USE=&quot;-foo&quot;</c>
670 in /etc/make.conf (to turn off the <c>foo</c> USE setting.) 1051 in <path>/etc/make.conf</path> to turn off any <c>foo</c> USE setting enabled by default
1052 in <path>/etc/make.globals</path> or <path>/etc/make.profile/make.defaults</path>.
671 </note> 1053 </note>
672 </body> 1054 </body>
673 </section> 1055 </section>
674 </chapter> 1056 </chapter>
675 <chapter> 1057 <chapter>
676 <title>Starting from Stage1</title> 1058 <title>Starting from Stage1</title>
677 <section> 1059 <section>
678 <body> 1060 <body>
1061 <note>If you are not starting from a stage1 tarball, skip this section.</note>
679 <p>The stage1 tarball is for complete customization and optimization. If you have picked this tarball, 1062 <p>The stage1 tarball is for complete customization and optimization. If you have picked this tarball,
680 you are most likely looking to have an uber-optimized system. Have fun, because optimization 1063 you are most likely looking to have an uber-optimized and up-to-date system. Have fun, because optimization
681 is what Gentoo Linux is all about! Installing from a stage1 takes a lot of time, but the result 1064 is what Gentoo Linux is all about! Installing from a stage1 takes a lot of time, but the result
682 is a system that has been optimized from the ground up for your specific machine and needs. 1065 is a system that has been optimized from the ground up for your specific machine and needs.
683 </p> 1066 </p>
684 <p>Now, it is time to start the &quot;bootstrap&quot; process. This process takes about two hours on 1067 <p>Now, it is time to start the &quot;bootstrap&quot; process. This process takes about two hours on
685 my 1200Mhz AMD Athlon system. 1068 my 1200Mhz AMD Athlon system.
686During this time, the extracted build image will be prepared and the GNU compiler suite and Libraries will be built. </p> 1069During this time, the GNU C library, compiler suite and other key system programs will be built. Start the bootstrap
1070as follows:</p>
687<pre caption="Bootstrapping"> 1071<pre caption="Bootstrapping">
688# <c>cd /usr/portage</c> 1072# <c>cd /usr/portage</c>
689# <c>scripts/bootstrap.sh</c> 1073# <c>scripts/bootstrap.sh</c>
690</pre> 1074</pre>
691 <p>The &quot;bootstrap&quot; process will now begin. 1075 <p>The &quot;bootstrap&quot; process will now begin.
692 </p> 1076 </p>
693 <note> 1077 <note>
694 Portage by default uses <c>/var/tmp</c> during package building, often 1078 Portage by default uses <c>/var/tmp</c> during package building, often
695 using several hundred megabytes of temporary storage. If you would like to 1079 using several hundred megabytes of temporary storage. If you would like to
696 change where Portage stores these temporary files, set a new PORTAGE_TMPDIR <e>before</e> 1080 change where Portage stores these temporary files, set a new PORTAGE_TMPDIR <e>before</e>
697 starting the bootstrap process, as follows: 1081 starting the bootstrap process, as follows:
698 </note> 1082 </note>
699<pre caption="Changing Portage's Storage Path"> 1083<pre caption="Changing Portage's Storage Path">
700# <c>export PORTAGE_TMPDIR=&quot;/otherdir/tmp&quot;</c> 1084# <c>export PORTAGE_TMPDIR=&quot;/otherdir/tmp&quot;</c>
701</pre> 1085</pre>
702 <p><c>bootstrap.sh</c> will build <c>binutils</c>, <c>gcc</c>, <c>gettext</c>, 1086 <p><c>bootstrap.sh</c> will build <c>binutils</c>, <c>gcc</c>, <c>gettext</c>,
703 and <c>glibc</c>, rebuilding <c>binutils</c>, <c>gcc</c>, and <c>gettext</c> 1087 and <c>glibc</c>, rebuilding <c>binutils</c>, <c>gcc</c>, and <c>gettext</c>
704 after <c>glibc</c>. Needless to say, this process takes a while. 1088 after <c>glibc</c>. Needless to say, this process takes a while.
705 Once this process completes, your system will be equivalent to a &quot;stage2&quot; system, 1089 Once this process completes, your system will be equivalent to a &quot;stage2&quot; system,
706 which means you can now move on to the stage2 instructions. 1090 which means you can now move on to the stage2 instructions.
707 </p> 1091 </p>
708 </body> 1092 </body>
709 </section> 1093 </section>
710 </chapter> 1094 </chapter>
711 <chapter> 1095 <chapter>
712 <title>Starting from Stage2</title> 1096 <title>Starting from Stage2 and continuing Stage1</title>
713 <section> 1097 <section>
714 <body> 1098 <body>
1099
1100 <note>This section is for those continuing a stage1 install or starting at stage2. If
1101 this is not you (ie. you're using a stage3,) then skip this section.
1102 </note>
1103
715 <p>The stage2 tarball already has the bootstrapping done for you. All that you have 1104 <p>The stage2 tarball already has the bootstrapping done for you. All that you have
716 to do is install the rest of the system. 1105 to do is install the rest of the system.
717 </p> 1106 </p>
718 <note>
719 If you have not already edited /etc/make.conf to fit your specifications,
720now would be a good time to do so.
721 </note>
722<pre caption="Installing the Rest of the System"> 1107<pre caption="Installing the Rest of the System">
723# <c>emerge -p system</c> 1108# <c>emerge -p system</c>
724<comment>(lists the packages to be installed)</comment> 1109<comment>(lists the packages to be installed)</comment>
725# <c>emerge system</c> 1110# <c>emerge system</c>
726</pre> 1111</pre>
727 <p>It is going to take a while 1112 <p>It is going to take a while
728 to finish building the entire base system. Your reward is that it will be 1113 to finish building the entire base system. Your reward is that it will be
729 thoroughly optimized for your system. The drawback is that you have to find a 1114 thoroughly optimized for your system. The drawback is that you have to find a
730 way to keep yourself occupied for some time to come. The author suggests &quot;Star 1115 way to keep yourself occupied for some time to come. The author suggests &quot;Star
731 Wars - Super Bombad Racing&quot; for the PS2. 1116 Wars - Super Bombad Racing&quot; for the PS2.
732 </p> 1117 </p>
733 <p>When this process completes, your system will be the equivalent of a stage3 system. You have 1118 <p>When this process completes, your system will be the equivalent of a stage3 system. You have
734 a couple of choices on how to continue 1119 a couple of choices on how to continue
735 at this point. You can move onto the stage3 instructions and complete those. Doing that will 1120 at this point. You can move onto the stage3 instructions and complete those. Doing that will
736 get your system right up to date with what is in the current Portage tree. This is not necessary, 1121 get your system right up to date with what is in the current Portage tree. This is not necessary,
737 but it is highly recommended. 1122 but it is highly recommended.
738 </p> 1123 </p>
739 </body> 1124 </body>
740 </section> 1125 </section>
741 </chapter> 1126 </chapter>
742 <chapter> 1127 <chapter>
743 <title>Starting from Stage3</title> 1128 <title>Starting from Stage3</title>
744 <section> 1129 <section>
745 <body> 1130 <body>
746 <p>The stage3 tarball is already configured for your system. There is not much to do for this stage, 1131 <note>This section is for those <b>starting</b> with stage3, and not for those who have started
747 but it is a very good idea to update your system to the newest available packages. </p> 1132 with stage1 or stage2 who should skip this section.</note>
1133 <p>The stage3 tarball provides a fully-functional basic Gentoo system, so no building is required.
1134 However, since the stage3 tarball is pre-built, it may be slightly out-of-date. If this is a concern
1135 for you, you can update your stage3 to contain the most up-to-date versions of all system packages
1136 by performing the following steps. Note that this could take a long time if your stage3 is very old;
1137 otherwise, this process will generally be quick and will allow you to benefit from the very latest
1138 Gentoo updates and fixes.
1139 In any case, feel free to skip these
1140 steps and proceed to the next section if you like.
1141 </p>
748 1142
749 <note>If you have not already edited <path>/etc/make.conf</path> to fit your specifications,
750 now would be a good time to do so. </note>
751<pre caption="Getting up-to-date"> 1143<pre caption="Getting up-to-date">
752# <c>emerge sync</c> 1144# <c>export CONFIG_PROTECT="-*"</c>
753# <c>emerge -up world</c> 1145# <c>emerge -up system</c>
754<comment>(lists the packages to be installed)</comment> 1146<comment>(lists the packages that would be installed)</comment>
755# <c>emerge -u world</c> 1147# <c>emerge -u system</c>
1148<comment>(actually merges the packages)</comment>
1149# <c>unset CONFIG_PROTECT</c>
756</pre> 1150</pre>
757 </body> 1151 </body>
758 </section> 1152 </section>
759 </chapter> 1153 </chapter>
760 <chapter> 1154 <chapter>
761 <title>Setting your time zone</title> 1155 <title>Setting your time zone</title>
762 <section> 1156 <section>
763 <body> 1157 <body>
764 <p>Now you need to set your time zone.</p> 1158 <p>Now you need to set your time zone.</p>
765 <p>Look for your time zone (or GMT if you are using Greenwich Mean Time) 1159 <p>Look for your time zone (or GMT if you are using Greenwich Mean Time)
766 in <path>/usr/share/zoneinfo</path>. Then, make a symbolic link to 1160 in <path>/usr/share/zoneinfo</path>. Then, make a symbolic link to
767 /etc/localtime by typing:</p> 1161 /etc/localtime by typing:</p>
768<pre caption="Creating a symbolic link for time zone"> 1162<pre caption="Creating a symbolic link for time zone">
769# <c>ln -sf /usr/share/zoneinfo/path/to/timezonefile /etc/localtime</c> 1163# <c>ln -sf /usr/share/zoneinfo/path/to/timezonefile /etc/localtime</c>
770</pre> 1164</pre>

Legend:
Removed from v.1.85  
changed lines
  Added in v.1.86

  ViewVC Help
Powered by ViewVC 1.1.20