Go to:
Gentoo Home
Documentation
Forums
Lists
Bugs
Planet
Store
Wiki
Get Gentoo!
Gentoo's Bugzilla – Attachment 375 Details for
Bug 1216
Installation Instructions
Home
|
New
–
[Ex]
|
Browse
|
Search
|
Privacy Policy
|
[?]
|
Reports
|
Requests
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
New Install Instructions
build.xml (text/html), 60.26 KB, created by
Michael Lang
on 2002-03-18 09:23:12 UTC
(
hide
)
Description:
New Install Instructions
Filename:
MIME Type:
Creator:
Michael Lang
Created:
2002-03-18 09:23:12 UTC
Size:
60.26 KB
patch
obsolete
><?xml version='1.0'?> ><guide link="/doc/build.html"> ><title>Gentoo Linux 1.0_rc6 Installation Instructions</title> ><author title="Chief Architect"><mail link="drobbins@gentoo.org">Daniel Robbins</mail></author> ><author title="Author">Chris Houser</author> ><author title="Author"><mail link="jerry@gentoo.org">Jerry Alexandratos</mail></author> ><author title="Ghost"><mail link="g2boojum@gentoo.org">Grant Goodyear</mail></author> ><author title="Gentoo Fan"><mail link="mwlang@cybrains.net">Michael Lang</mail></author> > ><abstract>This Gentoo Installation Guide walks you through the most common ways of installing >Gentoo onto your x86-compatable system. The installation steps assumes you have some Linux experience >and are comfortable with setting up disk partitions and creating filesystems.</abstract> > ><version>1.5.0</version> ><date>14 March 2002</date> > ><!-- >############################################################# >## Chapter 1 >## Overview >############################################################# >--><chapter><title>Getting Started</title> > ><!-- ########################### --> ><section><title>Overview</title> ><body> > ><p>The Gentoo Distribution is what is known as a "build from scratch" meta-distribution >which basically means that focus is on providing an easy method of building your entire >Linux box directly from the source. Because of this, your primary objective in getting >the installation going is to get your partitions prepped and then connected to the Internet >so that the source code packages can be downloaded and built by the portage system.</p> > ><p>To install Gentoo, you will need to have a 486+ processor and ideally at least 64 Megabytes of RAM.</p> > ><note>Gentoo linux has been successfully built with 64MB of RAM and >64MB of swap space, but the build process is painfully slow under these >conditions.</note> > ><p>In addition to the "minimal build" CD, which has just enough tools to set up your >partitions and connect to the Internet, there is an alternative "fast binary build" installation >CD which contains everything you need pre-compiled for a "comfortable" system >and is also covered here. This is handy for those in a rush and just want to get Gentoo up and running.</p> > ><note>While the "Fast Binary Build" CD will get you up and running the fastest, you will be >cheating yourself out of Gentoo's primary strength, which >is building each and every package just for your machine and optimized specifically >for your needs. In other words, you are encouraged to "build from scratch" as we >feel the end result is more than worth it and the difficulty of doing so has been >reduced to a fairly simple and elegant process.</note> > ><p>The ISO images, when burned to CD, creates a CD that will boot from nearly any >modern IDE CD-ROM drive, as well as many SCSI CD-ROMs. Included on the CD-ROM >is Linux support for IDE (built-in to the kernel) as well as support for all >SCSI devices (available as modules). In addition, modules for literally every >kind of network card that Linux supports, as well as tools to allow you to configure your >network and establish outbound <c>ssh</c> connections and download files.</p> > ></body> ></section> > ><!-- ########################### --> ><section><title>Choosing an Installation Method</title> ><body> > ><p>This document details several ways of getting Gentoo off the ground >and running (Penguins don't fly, but this one might!). >As such, choose your preferred method from below and skip >ahead to the appropriate section:</p> > ><ol> ><li> > Download the fast binary build ISO image (~615 mb) and burn to CD. You will boot > with this CD, configure your partition and then build your machine directly from > the CD rather than from the Internet. > Jump to <uri link="#doc_chap2">Installing from Fast Binary Build Boot CD</uri>. > > <note>You must have at least a Pentium class or better system to use this method. The > other "from scratch" methods will work for all x86-compatable systems.</note> > <p></p> > </li> ><li> > Download the minimal build ISO image (~17 mb) and burn to CD. You will boot with this CD and > then create your partitions and configure your network card to connect to the > Internet where you can then begin the process of downloading and building > your system directly from the source. > Jump to <uri link="#doc_chap3">Installing from Minimal Boot CD</uri>. > <p></p> > </li> ><li> > Download the minimal build tarball file (~9 mb) to your existing linux system. You will > piggy-back on your current distro's network configuration, prep a partition to > hold Gentoo and get a basic working Gentoo sub-environment operational from which > you can then download and build your complete Gentoo system. > Jump to <uri link="#doc_chap4">Installing from Existing Distro</uri>. > </li> ></ol> > ><important>All ISO CD images and tarballs may be found at: > <uri>http://www.ibiblio.org/gentoo/snapshots/build/</uri></important> ><p></p> ><note>If you are planning on using the "minimal build" CD install method, you will want to use the ><c>"build-i<comment>x</comment>86"</c> tbz2 image. But, if you are using the "fast binary" >install method, you should use the <c>"build-i<comment>5</comment>86"</c> tbz2 image. The "build-i586" image >is included on the "build-i586" ISO; it contains a fully-bootstrapped i586-optimized Gentoo Linux system and a snapshot of >our Portage tree. With the "build-i586" image, there is no need to boostrap or to run "emerge rsync" to grab the Portage >tree from cvs.gentoo.org.</note> > ></body> ></section> ></chapter> > > ><!-- >############################################################# >## Chapter 2 >## Fast Binary Install >############################################################# >--><chapter><title>Installing from Fast Binary Build CD</title> > ><!-- ########################### --> ><section><title>Booting up</title> ><body> > ><p>To begin installing with the fast binary Build CD, grab the latest >(<path>build-i586-1.0_rc6.iso</path> at the time of this writing) >~614mb ISO file and burn to a blank CD then reboot your computer with >this CD in the drive.</p> > ><note>You may have to change boot device order in your CMOS Settings so that >CD-ROM is checked before booting to Hard drive.</note> > ><p>When the CD successfully boots, you will be greeted with a bunch of text and a ><c>boot:</c> prompt at the bottom of the screen. At this prompt, hit enter, >and Linux will begin loading from the CD.</p> > ><p>Next, you'll be greeted with a small list of commands available on the boot >CD, including <c>nano</c> (a pico editor clone) and instructions for setting up >the network. Then, you'll be prompted to select your preferred keymap, >followed by PCI autodection. The PCI autodetection process will automatically >load the appropriate kernel modules for many popular PCI SCSI and ethernet >devices. After this, you can hit enter to enter the minimal boot CD Linux >environment. You should have a root ("<c>#</c>") prompt on the current >console. <note>You can also open new consoles by typing alt-f2, alt-f3, etc and then >hitting enter.</note></p> ></body></section> > ><!-- ########################### --> ><section><title>Loading Hardware Access Modules</title> ><body> ><p>Now, if you want to be able to access any SCSI hardware that wasn't detected >during the PCI autodetection process, you'll need to load the appropriate >modules from /lib/modules, again using <c>modprobe</c>:</p> > ><pre> ># <i>modprobe aic7xxx</i> ># <i>modprobe sr_mod</i> ># <i>modprobe sd_mod</i> ></pre> > ><p>Above, we modprobe the <c>aic7xxx</c> SCSI driver and then make sure that SCSI CD-ROM (<c>sr_mod</c>) >and disk (<c>sd_mod</c>) support is loaded.</p> > ><note><c>hdparm</c> is now included on -r10 and later of the iso. If any of your drives require tweaking, now >would be a good time to do so.</note> > ><note>If you are doing a "fast binary" install and plan to use only those packages included on the CD, >then setting up a network is not required. However, we always recommend doing it if possible since it can come >in handy a lot of the time. To set up your network card, see instructions for Loading your Network Adaptor below. ></note> > ><p>You are now ready to start setting up your partitions. >Jump to <uri link="#doc_chap5">Setting up Partitions</uri>.</p> > ></body> ></section> ></chapter> > ><!-- >############################################################# >## Chapter 3 >## Minimal Build Install >############################################################# >--> ><chapter><title>Installing from Minimal Build CD</title> > ><!-- ########################### --> ><section><title>Booting Up</title> ><body> > ><p>To begin the install process, first grab the latest 16Mb build CD >ISO image (<path>build-ix86-1.0_rc6-r17.iso</path> is the latest at the time >this article was written) from from the images site noted above.</p> > ><note>The Pentium+ fast binary CD can also be used as a >"from scratch" CD for i486+ systems.</note> > ><p>Once you're done downloading the ISO image file, burn the ISO image to a >CD using your preferred CD burning software then boot your computer with >the CD in the drive.</p> > ><note>You may have to change boot device order in your CMOS Settings so that >CD-ROM is checked before booting to Hard drive.</note> > ><p>When the CD successfully boots, you will be greeted with a bunch of text and a ><c>boot:</c> prompt at the bottom of the screen. At this prompt, hit enter, >and Linux will begin loading from the CD.</p> > ><p>Next, you'll be greeted with a small list of commands available on the boot >CD, including <c>nano</c> (a pico editor clone) and instructions for setting up >the network. Then, you'll be prompted to select your preferred keymap, >followed by PCI autodection. The PCI autodetection process will automatically >load the appropriate kernel modules for many popular PCI SCSI and ethernet >devices. After this, you can hit enter to enter the minimal boot CD Linux >environment. You should have a root ("<c>#</c>") prompt on the current >console. <note>You can also open new consoles by typing alt-f2, alt-f3, etc and then >hitting enter.</note></p> ></body></section> > ><!-- ########################### --> ><section><title>Loading Hardware Access Modules</title> ><body> > ><p>We're almost ready to begin installing Gentoo Linux, but first we need take >the necessary steps so that the kernel recognizes our network cards, and >optionally any SCSI hardware that is in our system that PCI autodetection >missed.</p> > ><p>If you want to be able to access any SCSI hardware that wasn't detected >during the PCI autodetection process, you'll need to load the appropriate >modules from /lib/modules, again using <c>modprobe</c>:</p> > ><pre> ># <i>modprobe aic7xxx</i> ># <i>modprobe sr_mod</i> ># <i>modprobe sd_mod</i> ></pre> > ><p>Above, we modprobe the <c>aic7xxx</c> SCSI driver and then make sure that SCSI CD-ROM (<c>sr_mod</c>) >and disk (<c>sd_mod</c>) support is loaded.</p> > ><note><c>hdparm</c> is now included on -r10 and later of the iso. If any of your drives require tweaking, now >would be a good time to do so.</note> ></body> ></section> > ><!-- ########################### --> ><section><title>Loading your Network Adaptor</title> ><body> ><p>If you are installing on a laptop and your network card is a PCMCIA card, >then your first step is to get the PCMCIA module loaded to support your cardbus.</p> > ><pre> ># <i>insmod pcmcia_core</i> ># <i>insmod i82365</i> ># <i>insmod ds</i> ># <i>cardmgr -f</i> ></pre> > ><p>As the cardmgr detects which hardware is present, your speaker should emit a >few reassuring beeps, and your PCMCIA network card should hum to life. You can >of course insert the PCMCIA card after loading cardmgr too, if that's >preferrable.</p> > ><warn>Technically, you do not need to run ><i>cardmgr</i> if you know <e>exactly</e> which module your PCMCIA card requires. >But if you don't, loading all PCMCIA modules and seeing which sticks won't work, >as all PCMCIA modules load obligingly and hang around for a PCMCIA card to >drop by. <i>cardmgr</i> will also unload the module(s) for any card when you >remove it.</warn> > ><p>If you are not using cardmgr to auto-load the appropriate network card module, >then you need to load it using the <c>modprobe</c> command. >To view a list of all available network card modules, type <c>ls >/lib/modules/*/kernel/drivers/net/*</c>. To load a particular module, >type:</p> > ><pre> ># <i>modprobe pcnet32</i> > <comment>(replace pcnet32 with your NIC module)</comment> ></pre> > ><note>Some of the more popular network cards are eepro100 and tulip. So try these first if you >don't know which module is right for your card. If modprobe is successful in loading the >module, then you will get the next <c>#</c> prompt with no error messages displayed.</note> ></body> ></section> > ><!-- ########################### --> ><section><title>Configuring Network</title> ><body> > ><p>The new -r11+ boot CDs allow you to configure a working network, allowing you to use <c>ssh</c>, <c>scp</c> or <c>wget</c> >as needed before even beginning the installation process. Even if you don't need to do these things now, >you should go ahead and set up networking now. Once set up, Portage will be able to use your configured network >once you are inside the chroot environment (required for installing Gentoo Linux).</p> ></body> ></section> > ><!-- ########################### --> ><section><title>DHCP</title> ><body> > ><p>Network configuration is simple with DHCP; If your ISP is not using >DHCP, skip down to the static configuration section below. </p> > ><pre caption="Network configuration with DHCP"> ># <i>dhcpcd eth0</i> ></pre> > ><note> >Some ISPs require you to provide a hostname. To do that, >add a <c>-h myhostname</c> flag to the dhcpcd command line above. ></note> > ><p>If you receive <i>dhcpConfig</i> warnings, don't panic; the errors >are most likely cosmetic. Skip down to Network testing below.</p> ></body> ></section> > ><!-- ########################### --> ><section><title>Static configuration</title> ><body> > ><p>We need to setup just enough networking so that we can download >sources for the system build, as well as the required localhost interface. >Type in the following commands, replacing >$IFACE with your network interface (typically <c>eth0</c>), $IPNUM >with your IP address, $BCAST with your broadcast address, and $NMASK >with your network mask. For the <c>route</c> command, replace >$GTWAY with your default gateway. ></p> ><pre> ># <i>/sbin/ifconfig $IFACE $IPNUM broadcast $BCAST netmask $NMASK</i> ># <i>/sbin/route add -net default gw $GTWAY netmask 0.0.0.0 metric 1</i> ></pre> ><p>Now, it's time to create the <path>/etc/resolv.conf</path> >file so that name resolution (finding Web/FTP sites by name, rather than just by IP address) will work.</p> > ><note>At the moment the only editor installed by default is <c>nano</c>, a >small and very easy-to-use visual editor. Use <c>nano</c> with the <c>-w</c> >option to turn off automatic line-wrapping. ></note> > ><p>Here is a template to follow for creating your /etc/resolv.conf file: ></p> ><pre caption="/etc/resolv.conf template"> >domain mydomain.com >nameserver 10.0.0.1 >nameserver 10.0.0.2 ></pre> ><p>Replace <c>10.0.0.1</c> and <c>10.0.0.2</c> with the IP addresses of your >primary and secondary DNS servers respectively.</p> ></body> ></section> > ><!-- ########################### --> ><section><title>Network testing</title> ><body> > ><p>Now that your network has been configured, the <c>/sbin/ifconfig -a</c> command should show (hopefully!) >that your network card is working >(look for <e>UP</e> and <e>RUNNING</e> in the output). ></p> ><pre caption="/sbin/ifconfig for a working network card"> >eth0 Link encap:Ethernet HWaddr 00:50:BA:8F:61:7A > inet addr:192.168.0.2 Bcast:192.168.0.255 Mask:255.255.255.0 > inet6 addr: fe80::50:ba8f:617a/10 Scope:Link > UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1 > RX packets:1498792 errors:0 dropped:0 overruns:0 frame:0 > TX packets:1284980 errors:0 dropped:0 overruns:0 carrier:0 > collisions:1984 txqueuelen:100 > RX bytes:485691215 (463.1 Mb) TX bytes:123951388 (118.2 Mb) > Interrupt:11 ></pre> ><!-- ><note> >If you have a static ppp link, you can !!! do this...!!! ></note> >--> ></body> ></section> > ><!-- ########################### --> ><section><title>Networking is go!</title> ><body> ><p>Networking should now be configured and useable. You should be able to use the included ><c>ssh</c>, <c>scp</c> and <c>wget</c> commands to connect to other machines on your LAN or the Internet.</p> > ><p>You are now ready to start setting up your partitions. >Jump to <uri link="#doc_chap5">Setting up Partitions</uri>.</p> > ></body> ></section> ></chapter> > ><!-- >############################################################# >## Chapter 4 >## Other Distro Install >############################################################# >--><chapter><title>Installing from Existing Distro</title> > ><!-- ########################### --> ><section><title>Overview</title> ><body> ><p>Many users will be encountering Gentoo after having already installed another >popular distro such as Red Hat, Mandrake, Slackware, etc. on their machines. As such, >you will be able to install Gentoo without burning a CD. The basic strategy is to free >up at least one partition so that you many install Gentoo to a clean, mountable partition.</p> > ><note>One of the main advantages of this approach is that you do not need a CD Burner >in order to install Gentoo. However, if you want to install on of the more advanced >file systems discussed in <uri link="#doc_chap5">Setting up Partitions</uri>, you will >need to compile support for that filesystem into your current distro's kernel and also >download the appropriate packages for making the filesystems.</note> > ><p>This guide walks you through setting up Gentoo on a Linux system that has the following >configuration:</p> > ><p> <table> > <tr> > <th>Name</th> > <th>Partition</th> > <th>Description</th> > </tr> > <tr> > <ti>Boot</ti> > <ti><path>/dev/hda1</path></ti> > <ti>boot partition, containing kernel(s) and boot information</ti> > </tr> > <tr> > <ti>Root</ti> > <ti><path>/dev/hda2</path></ti> > <ti>root partition, containing main filesystem > (<path>/etc</path>, <path>/usr</path>, <path>/bin</path>, etc)</ti> > </tr> > <tr> > <ti>Swap</ti> > <ti><path>/dev/hda3</path></ti> > <ti>swap partition (no longer a 128 Megabyte limit)</ti> > </tr> > <tr> > <ti>Data</ti> > <ti><path>/dev/hda4</path></ti> > <ti>data partition, containing <path>/home</path></ti> > </tr> > </table> ></p> > ><impo>Your configuration will likely differ slightly from the above. For example, Mandrake's default installation >does not have the Boot partition, but rather, places the boot images in the /boot directory of the Root partition. >You will need to spend some time figuring out which partitions you have. Once you have figured out your partitions >and paths, you will be able to translate the literal paths here to suit your environment.</impo> > ><note>The installation steps here will allow you to install Gentoo without damaging your existing distro's setup. >In other words you'll be able to boot to your current distro as well as Gentoo's distro when we're done.</note> > ></body> ></section> > ><!-- ########################### --> ><section><title>Determine where to Install Gentoo</title> ><body> > ><p>If you have a second hard drive or additional unpartitioned space on your current hard drive, then >you are in great shape to begin installing Gentoo. However, if your current hard drive is fully partitioned, >then you will need to choose a partition from your currently available partitions to become Gentoo's Root.</p> > ><warn>It is highly recommended that you start by logging in only as root and only to a console to avoid >"file busy" problems that may arise from having various apps and files opened.</warn> > ><note>If you have a boot disk from your existing distro or can burn the minimal build CD for Gentoo, then >a separate partition is not absolutely required as you can build Gentoo in a sub-directory of your current >Root partition and then boot from a boot disk, delete the old system, and move the files in the >chroot directory to root. However, this alternative <i>will</i> destroy your current distro.</note> > ><p>If you already have the extra partition sitting around with no data on it, then you can just proceed >to the next chapter, <uri link="#doc_chap5">Setting up Partitions</uri> and begin setting up your partitions.</p> > ><p>Probably the easiest partition to free up is the Data partition, especially if you have enough room to copy >all files on this partition to your current Root partition. To do this, do the following:</p> > ><pre> ># <i>mkdir /tmphome</i> ># <i>mv /home/* /tmphome</i> <comment>// be sure you have enough disk space!</comment> ># <i>umount /home</i> ># <i>rmdir /home</i> ># <i>mv /tmphome /home</i> ></pre> > ><impo>It is recommended that you go ahead and comment out the line for mounting to /home from your ><path>/etc/fstab</path> as you will no longer be mounting to this partition when booting to >your current distro. ></impo> > ><p>Now you are ready to continue with setting up your partitions. Because you already have a fully >functional distro, you can get away with only setting up the file system for the new Gentoo Root >partition. In other words, you can utilize your current Boot and Swap partitions with Gentoo.</p> > ><impo>When instructed to create the <path>/mnt/gentoo</path> directory and such, just create these >on your current distro's Root partition.</impo> > ></body> ></section> > ><!-- ################# BAH!!! ################## > >Can't do this without bootstrapping twice (can't emerge util-linux >which has the mount cmd in it), so I'm commenting out. I also had >the mistaken assumption as I started to write this that when you >chroot you flipped over the kernel (VMWare like). Since this doesn't happen, >the user has to compile new file system into existing distro's kernel. IMO, >this is too much. > >However, I leave this in here for future authors review in case someone more >knowledgeable can figure out how to do this. > >- Michael: mwlang@cybrains.net > ><section>Prepping for file systems other than ext2</section> ><body> > ><note>Follow this step only if you want to be able to utilize a partition other than ext2 as described >in the next chapter on <uri link="#doc_chap5">Setting up Partitions</uri>.</note> > ><impo>It is assumed that your system has kernel support for the file systems you want to utilize (such as XFS or Rieserfs) >already built in. However, distros do not always install the file system makers such as mkfs.xfs and mkreiserfs. >This step walks you through getting these programs installed the <e>Gentoo way.</e> If you do not have a fast >Internet connection, then you might want to locate the xfsprogs and fe2progs packages for your current distro and >install them the traditional way for your distro.</impo> > ><p>To enable your system to utilize some of the more advanced partitions, you can get your first taste of what >Gentoo's portage system is all about. To begin, create a directory for gentoo on your existing Root partition >and extract the tarball (<path>build-ix86-1.0_rc6-r11.tbz2</path> at the time of this writing).</p> > ><pre> ># mkdir /gentoo ># cd /gentoo ># tar -xvjpf /path/to/downloaded/tarball/build-*.tbz2 ># mount -o bind /proc /gentoo/proc ># chroot /gentoo /bin/bash >< /pre> > >// ok, at this point, I discovered that mounting within the Gentoo "shell" doesn't work and also >// found out that chroot doesn't flip over the kernel. bad assumption! bad! :-p''' > >// the whole idea of this section was to pop into a gentoo shell, emerge what I needed for the exotic >// filesystem makers, then mount and untar gentoo a 2nd time onto the new root partition for gentoo > ></body> ></section> > >############## END BAH!! ##############--> > ></chapter> > ><!-- >############################################################# >## Chapter 5 >## Setting up Partitions >############################################################# >--><chapter><title>Setting up Partitions</title> > ><!-- ########################### --> ><section> ><body> > ><p>Now that the kernel can see our network card and disk controllers, it's time >to set up disk partitions for Gentoo Linux.</p> > ><note>If you are installing from an existing distro, you <e>can</e> utilize your existing distro's Boot >partition as well as your existing Swap partition. You <e>cannot</e>, however use your existing >distro's Root partition if you want to be able to boot to it as well as Gentoo. Keep these points >in mind as you read the instructions for setting up partitions here. > ><p>Also, many distros don't have a separate boot partition by default. This is perfectly >alright. You will find all your boot images in your current distro's /boot directory and it is here >that you will copy your final bzImage file.</p> ></note> > ><p>Here's a quick overview of the standard Gentoo Linux partition layout. >We're going to create at least three partitions: a swap partition, a root >partition (to hold the bulk of Gentoo Linux), and a special boot partition. >The boot partition is designed to hold GRUB boot loader information as well as >your Linux kernel(s). The boot partition gives us a safe place to store >everything related to booting Linux. During normal day-to-day Gentoo Linux use, >your boot partition should remain <e>unmounted</e>. This prevents your kernel >from being made unavailable to GRUB (due to filesystem corruption) in the event >of a system crash, preventing the chicken-and-egg problem where GRUB can't read >your kernel (since your filesystem isn't consistent) but you can't bring your >filesystem back to a consistent state (since you can't boot!) </p> > ><p>Now, on to filesystem types. Right now, you have four filesystem options: >XFS, ext2, ext3 (journaling) and ReiserFS. ext2 is the tried and true Linux >filesystem but doesn't have metadata journaling. ext3 is the new version of >ext2 with both metadata journaling and ordered data writes, effectively >providing data journaling as well. ReiserFS is a B*-tree based filesystem >that promises very good small file performance, and greatly outperforms both ext2 and >ext3 when dealing with small files (files less than 4k), often by a factor of >10x-15x. However, we do <e>not</e> recommend ReiserFS at this time, >due to repeated occurances of file-system corruption with the 2.4.x series >kernels. ReiserFS has metadata journaling, but no data journaling. XFS >is a high-performance enterprise-class filesystem with metadata journaling that >is fully supported under Gentoo Linux. ></p> ><p>If you're looking for the most standard filesystem, use ext2. If you're looking >for the most rugged journalled filesystem, use ext3. If you're looking for a >high-performance filesystem with journaling support, use XFS; both ext3 and XFS are >mature and refined. All filesystems except ReiserFS are production-ready. >Here are our basic recommended filesystem >sizes and types:</p> > > <table> > <tr> > <th>Partition</th> > <th>Size</th> > <th>Type</th> > <th>example device</th> > </tr> > <tr> > <ti>boot partition, containing kernel(s) and boot information</ti> > <ti>>10 Megabytes</ti> > <ti>ext2/3 highly recommended (easiest); if ReiserFS then mount with <c>-o notail</c></ti> > <ti>/dev/hda1</ti> > </tr> > <tr> > <ti>swap partition (no longer a 128 Megabyte limit)</ti> > <ti>>=2*Amount of RAM in this system is recommended but no longer (as of kernel 2.4.10) required</ti> > <ti>Linux swap</ti> > <ti>/dev/hda2</ti> > </tr> > <tr> > <ti>root partition, containing main filesystem (/usr, /home, etc)</ti> > <ti>>=1.5 Gigabytes</ti> > <ti>XFS, ext3 recommended; ext2 ok</ti> > <ti>/dev/hda3</ti> > </tr> > </table> > ><note>At this point, create your partitions using fdisk. Note that your partitions >should be of type 0x82 if swap and 0x83 for regular filesystems (whether XFS, ReiserFS <e>or</e> ext2). ></note> > ><note>You can find more in-depth discussion of file systems at ><uri>>http://www.gentoo.org/index-articles.html</uri></note> > ><p>Once you've created your partitions using <c>fdisk</c>, it's time to initialize >the filesystems that will be used to house our data. Initialize swap as follows:</p> ><pre> ># <i>mkswap /dev/hda2</i> ></pre> ><p>You can use the <c>mke2fs</c> command to create ext2 filesystems:</p> ><pre> ># <i>mke2fs /dev/hda1</i> ></pre> ><p>To create an XFS filesystem, use the <c>mkfs.xfs</c> command:</p> ><pre> ># <i>mkfs.xfs /dev/hda3</i> ></pre> ><note> >You may want to add a couple of additional flags to the <c>mkfs.xfs</c> command: <c>-d agcount=3 -l size=32m</c>. >The <c>-d agcount=3</c> command will lower >the number of allocation groups. XFS will insist on using at least 1 allocation group per 4 GB of your partition, >so, for example, if you hava a 20 GB partition you will need a minimum agcount of 5. The <c>-l size=32m</c> command >increases the journal size to 32 Mb, increasing performance. ></note> ><warn> >If you are installing an XFS partition over a previous ReiserFS partition, later attempts to mount may fail without >an explicit <c>mount -t xfs</c>. The solution is to zero out the partition before creating the XFS filesystem: ><c>dd if=/dev/zero of=/dev/hd<comment>x</comment> bs=1k</c>. ></warn> ><p>If you'd like to use ext3, you can create ext3 filesystems using <c>mke2fs -j</c>:</p> ><pre> ># <i>mke2fs -j /dev/hda3</i> ></pre> ><p>To create ReiserFS filesystems, use the <c>mkreiserfs</c> command:</p> ><pre> ># <i>mkreiserfs /dev/hda3</i> ></pre> > ><warn>Again, we do not recommend ReiserFS at this time. While ReiserFS has >worked fine for many, filesystem corruption has been too common a problem with >ReiserFS and the 2.4.x series kernels.</warn> > ><note>You can find out more about using ext3 under Linux 2.4 at ><uri>http://www.zip.com.au/~akpm/linux/ext3/ext3-usage.html</uri>.</note> ></body> ></section> ></chapter> > ><!-- >############################################################# >## Chapter 6 >## Mounting Partitions >############################################################# >--><chapter><title>Mounting Partitions</title> > ><!-- ########################### --> ><section> ><body> > ><p> >If you are not installing from an existing distro, then you need to activate our new swap, >since we may need the additional virtual memory that provides later: ></p> > ><pre> ># <i>swapon /dev/hda2</i> ></pre> > ><p>Next, we'll create the <path>/mnt/gentoo</path> and <path>/mnt/gentoo/boot</path> mountpoints, >and we'll mount our filesystems to these mountpoints. ></p> ><pre> ># <i>mkdir /mnt/gentoo</i> ># <i>mount /dev/hda3 /mnt/gentoo</i> ># <i>mkdir /mnt/gentoo/boot</i> ># <i>mount /dev/hda1 /mnt/gentoo/boot</i> ></pre> ><p>If you are setting up Gentoo > Linux with a separate <path>/usr</path> or <path>/var</path>, these would get mounted to > <path>/mnt/gentoo/usr</path> and <path>/mnt/gentoo/var</path>, respectively. ></p> > <impo>If your <e>boot</e> partition (the one holding the kernel) is ReiserFS, be sure to mount it > with the <c>-o notail</c> option so GRUB gets properly installed. Make sure > that <c>notail</c> ends up in your new <path>/etc/fstab</path> boot partition entry, too. > We'll get to that in a bit.</impo> ></body> ></section> ></chapter> > ><!-- >############################################################# >## Chapter 7 >## Mounting the CD-ROM >############################################################# >--><chapter><title>Mounting the CD-ROM</title> > ><note>If you're installing from another distro and didn't burn a CD image, then move on >to the next step.</note> > ><!-- ########################### --> ><section> ><body> ><p>Even though we've booted from the CD-ROM, the CD-ROM itself is not mounted under our minimal >Linux boot CD environment. We'll need to mount it so that we can access the compressed build image >tarball contained on the CD-ROM. To mount the CD-ROM, one typically types: ></p> ><pre> ># <i>mount /dev/cdroms/cdrom0 /mnt/cdrom -o ro -t iso9660</i> ></pre> ><p>With the CD-ROM mounted, you should be able to see the <c>build-???.tbz2</c> file by typing ><c>ls /mnt/cdrom</c>.</p> ></body> ></section> ></chapter> > ><!-- >############################################################# >## Chapter 8 >## Unpacking and chroot >############################################################# >--><chapter><title>Unpacking and chroot</title> ><section> ><body> > ><p>Now it's time to extract the compressed build image tarball to <path>/mnt/gentoo</path>. >Then, we'll <c>chroot</c> over to the new Gentoo Linux build installation. ></p> > ><impo>Be sure to use the <c>p</c> option with <c>tar</c>. Forgetting to do this will cause >certain files to contain incorrect permissions.</impo> > ><pre> ># <i>cd /mnt/gentoo</i> ># <i>tar -xvjpf /mnt/cdrom/build-*.tbz2</i> ># <i>mount -o bind /proc /mnt/gentoo/proc</i> <comment>// see note below if installing from other distro</comment> ># <i>cp /etc/resolv.conf /mnt/gentoo/etc/resolv.conf</i> ></pre> > ><note>If you are installing from another distro and you're not currently on a 2.4.x kernel, then the <i>mount -o bind</i> >may cause some problems. Instead use the following: ><pre> ># <i> mount -t proc none /mnt/gentoo/proc</i> ></pre> ></note> > ><p>If you want to use the many pre-built packages included on the i586 CD, an additional step is needed at this point:</p> ><pre> ># <i>mkdir /mnt/gentoo/usr/portage/packages</i> ># <i>mount -o bind /mnt/cdrom/packages /mnt/gentoo/usr/portage/packages</i> ></pre> > ><p>Now, all users (both "ix86" and "i586" guys) should use the following commands to initialize your new Gentoo Linux >chroot environment:</p> > ><pre> ># <i>chroot /mnt/gentoo /bin/bash</i> ># <i>env-update</i> >Regenerating /etc/ld.so.cache... ># <i>source /etc/profile</i> >(none) / # <comment>ooh! A new prompt!</comment> ></pre> > ><p>After you execute these commands, you'll be "inside" your new Gentoo Linux environment. ></p> > ></body> ></section> ></chapter> > ><!-- >############################################################# >## Chapter 9 >## Rsync >############################################################# >--><chapter><title>Rsync</title> > ><!-- ########################### --> ><section> ><body> ><p>Now, "build from scratch" people will need to run <c>emerge rsync</c>. This command will tell <c>emerge</c> to >connect to cvs.gentoo.org and download the latest version of our Portage ports tree.</p> > ><p>If you are doing a "fast binary" install, this step is <i>optional</i>, since a Portage tree snapshot was already >added to your build image. You can choose to <c>emerge rsync</c> if you want to have the latest and greatest packages, >or you can choose to skip the step to ensure that you will use only the pre-built binary packages included on your >"i586" CD. If you want or need to <c>emerge rsync</c>, simply type:</p> ><pre> ># <i>emerge rsync</i> ></pre> ><p>The Portage tree will be downloaded; it's about 10Mb in size.</p> ></body> ></section> ></chapter> > > ><!-- >############################################################# >## Chapter 10 >## Bootstrap >############################################################# >--><chapter> ><title>Bootstrap</title> ><section> ><body> > ><impo>If you are using the "fast binary" install method, then we've already >bootstrapped for you. There is no reason for you to bootstrap again, unless >you decided to do an <c>emerge rsync</c> and want to ensure that you have an >up-to-the-minute current Gentoo Linux system. Most "fast binary" installers >will <i>not</i> want to bootstrap again, since it can take up to an hour even >on very fast machines.</impo> > ><impo>Another important note: If you're installing this CD at FOSDEM, type ><c>nano -w /etc/hosts</c> and add a line to this file that reads <c>10.1.1.1 cvs.gentoo.org</c>. >This will trick your system into using the our local mirror at FOSDEM rather >than connecting to our actual server in Austin, Texas, USA. This will make >things go a lot faster :). Remember to remove this line from <path>/etc/hosts</path> >when you get home so that your system will connect to the <i>real</i> cvs.gentoo.org >from that point forward.</impo> > ><p>Now that you have a working copy of the Portage tree, "ix86" installers need >to bootstrap their Gentoo Linux system. "i586" installers already have a >bootstrapped system and should generally skip the entire bootstrap process and >skip down to the <e>Building the base system</e> section below.</p> > ><p>Bootstrappers should first edit the file <path>/etc/make.conf</path>. In >this file, you should set your <c>USE</c> flags, which specify optional >functionality that you would like to be built into packages; the commented-out >defaults are recommended. You also should set appropriate <c>CHOST</c>, <c> >CFLAGS</c> and <c>CXXFLAGS</c> settings for the kind of system that you are >creating. If necessary, you can also set proxy information here if you are >behind a firewall. </p> > ><pre> ># <i>nano -w /etc/make.conf</i> <comment>(Adjust these settings)</comment> ></pre> > ><note> >People who need to substantially tweak the build process should take a look at >the <path>/etc/make.globals</path> file. This file comprises gentoo defaults and >should never be touched. If the defaults do not suffice, then new values should >be put in <path>/etc/make.conf</path>, as entries in <path>make.conf</path> ><comment>override</comment> the entries in <path>make.globals</path>. ></note> > ><p>Now, it's time to start the "bootstrap" process. This process will last 1-2 hours depending on >how zippy your machine is; it takes about 45 minutes on my 900Mhz AMD Athlon system. During this >time, the extracted build image will be prepped for compiling the rest of the system. The GNU >compiler suite will be built, as well as the GNU C library. These are time consuming builds and >make up the bulk of the bootstrap process:</p> > ><pre> ># <i>cd /usr/portage</i> ># <i>scripts/bootstrap.sh</i> ></pre> > ><p>The "bootstrap" process will now begin.</p> > ><note> >Portage by default uses <c>/var/tmp</c> during package building, often >using several hundred megabytes of temporary storage. If you would like to >change where Portage stores these temporary files, set a new PORTAGE_TMPDIR ><e>before</e> starting the bootstrap process, as follows: ></note> > ><pre> ># <i>export PORTAGE_TMPDIR="/otherdir/tmp"</i> ></pre> > ><p>The <c>bootstrap.sh</c> will build <c>binutils</c>, <c>gcc</c>, <c>gettext</c>, >and <c>glibc</c>, rebuilding <c>binutils</c>, <c>gcc</c>, and <c>gettext</c> >after <c>glibc</c> is built. Needless to say, this process takes a while. >Have a nice nap.</p> > ></body> ></section> ></chapter> > ><!-- >############################################################# >## Chapter 11 >## Building the Base System >############################################################# >--><chapter><title>Building the Base System</title> > ><!-- ########################### --> ><section> ><body> > ><p>Once your build image has been bootstrapped (again, "i586" users have a >pre-bootstrapped system), it's time to build or install the rest of the base >system. If you are using the "fast binary" i586 install, pre-built packages >will be automatically used if available in order to save time. >Otherwise, packages will be auto-built from sources. >The following commands will work for both "ix86" and "i586" installers:</p> > ><pre> ># <i>export CONFIG_PROTECT=""</i> ># <i>emerge --usepkg --pretend system</i> > <comment>[lists the packages to be installed]</comment> ># <i>emerge --usepkg system</i> ><comment>The --usepkg option tells emerge to check for a >pre-built binary package first and to use it if available.</comment> ></pre> > ><note>The <c>export CONFIG_PROTECT=""</c> line ensures that any new scripts >installed to <path>/etc</path> will overwrite the old scripts (stored in ><path>sys-apps/baselayout</path>), bypassing Portage's new config file >management support. Type <c>emerge --help config</c> for more details.</note> > ><p> If you're doing a "build from scratch" install, it's going to take a while >to finish building the entire base system. Your reward is that it will be >thoroughly optimized for your system. The drawback is that you have to find a >way to keep yourself occupied for some time to come. The author suggests "Star >Wars - Super Bombad Racing" for the PS2.</p> > ></body> ></section> ></chapter> > ><!-- >############################################################# >## Chapter 12 >## Installing Kernel and System Logger >############################################################# >--><chapter><title>Installing the Kernel and System Logger</title> > ><!-- ########################### --> ><section> ><body> ><p> >At the moment the Gentoo Linux default system does not include a kernel; >you have to install it yourself. Here are the steps to compile and configure >your own custom kernel: ></p> ><pre> ># <i>emerge --usepkg sys-kernel/linux-sources</i> ># <i>cd /usr/src/linux</i> ># <i>make menuconfig</i> ># <i>make dep clean bzImage modules modules_install</i> ># <i>mv /boot/bzImage /boot/bzImage.orig</i> <comment>[if bzImage already exists]</comment> ># <i>cp /usr/src/linux/arch/i386/boot/bzImage /boot</i> ></pre> > ><note>For those installing from another distro, reviewing your current distro's ><path>/etc/modules.autoload</path> file (be sure to look outside your current Gentoo console!) >can remove the guesswork out of deciding which modules >you will want to use with your new kernel. You can also choose to build these into the >kernel rather than as modules as your current distro has done.</note> > ><impo>For your kernel to function properly, there are several options that you will >need to ensure are in the kernel proper -- that is, they should <e>be enabled and not >compiled as modules. You will need to enable the "Experimental Features" >options to see several of these selections.</e> >Under the "File systems" section, be sure to enable the "Device File System" (note that >you <e>don't</e> need to enable the "/dev/pts file system support" option). You'll also >need to enable the "Virtual Memory Filesystem". Be sure to enable "ReiserFS" if you have >any ReiserFS partitions; the same goes for "Ext3". If you're using XFS, enable the >"SGI XFS filesystem support" >option. It's always a good idea to leave ext2 >enabled whether you are using it or not. Also, most people using IDE hard drives will >want to enable the "USE DMA by default" option; otherwise, your IDE drives may perform >very poorly. Of course, remember to enable "IDE disk" support as well -- otherwise your >kernel won't be able to see your IDE disks. ></impo> > ><note>For those who want rock-solid stability, >it is now possible to install Gentoo Linux with a 2.2 kernel. >Such stability will come at a price: >you will lose many of the nifty features that >are new to the 2.4 series kernels (such as XFS and tmpfs >filesystems, iptables, and more), although the Gentoo 2.2. kernel sources have been >patched with Reiserfs and devfs support. >Gentoo linux bootscripts require either tmpfs or ramdisk support in the kernel, so >2.2 kernel users need to make sure that ramdisk support is compiled in (ie, not a module). >It is <comment>vital</comment> that a <e>gentoo=notmpfs</e> flag be added to the kernel >line in <path>/boot/grub/menu.lst</path> for the 2.2 kernel so that a ramdisk is mounted >for the bootscripts instead of tmpfs. If you choose not to use devfs, then ><e>gentoo=notmpfs,nodevfs</e> should be used instead. ></note> > ><p> >Your new custom kernel (and modules) are now installed. Now you need to choose a system >logger that you would like to install. We offer sysklogd, which is the traditional set >of system logging daemons. We also have syslog-ng as well as metalog. Power users seem >to gravitate away from sysklogd (not very good performance) and towards syslog-ng and >metalog. If in doubt, you may want to try metalog, since it seems to be quite popular. >To merge your logger of choice, type <e>one</e> of the next three lines: ></p> > ><pre> ># <i>emerge --usepkg sys-apps/sysklogd</i> ># <i>rc-update add sysklogd default</i> ><comment>or</comment> ># <i>emerge --usepkg app-admin/syslog-ng</i> ># <i>rc-update add syslog-ng default</i> ><comment>or</comment> ># <i>emerge --usepkg app-admin/metalog</i> ># <i>rc-update add metalog default</i> ></pre> ><warn> >In the case of syslog-ng you need to create ><path>/etc/syslog-ng/syslog-ng.conf</path>. >See <path>/etc/syslog-ng</path> >for a sample configuration file. ></warn> ><impo> >Metalog flushes output to the disk in blocks, so messages aren't immediately recorded into >the system logs. If you are trying to debug a daemon, this performance-enhancing behavior is less than helpful. When your >Gentoo Linux system is up and running, you can send >metalog a USR1 signal to temporarily turn off this message buffering (meaning that ><i>tail -f <path>/var/log/everything/current</path></i> will now work >in real time, as expected), >and a USR2 signal to turn buffering back on >again. ></impo> ></body> ></section> ></chapter> > ><!-- >############################################################# >## Chapter 13 >## Install Additional Packages >############################################################# >--><chapter><title>Install additional packages</title> > ><!-- ########################### --> ><section> ><body> ><p> >You may need to install some additional packages in the Portage tree >if you are using any optional features like XFS or LVM. If you're >using XFS, you should emerge the <c>xfsprogs</c> ebuild: ></p> ><pre> ># <i>emerge --usepkg sys-apps/xfsprogs</i> ></pre> ><p> >If you're using LVM, you should emerge the <c>lvm-user</c> ebuild: ></p> ><pre> ># <i>emerge --usepkg sys-apps/lvm-user</i> ></pre> ></body> ></section> ></chapter> > ><!-- >############################################################# >## Chapter 14 >## Final Configuration >############################################################# >--><chapter><title>Final configuration</title> > ><!-- ########################### --> ><section> ><body> ><p>Your Gentoo Linux system is almost ready for use. All we need to do now is configure >a few important system files and install the GRUB boot loader. >The first file we need to >configure is <path>/etc/fstab</path>. Remember that you should use >the <c>notail</c> option for your boot partition if you chose to create a ReiserFS filesystem on it. >Remember to specify <c>ext2</c>, <c>ext3</c> or <c>reiserfs</c> filesystem types as appropriate.</p> > >Use something like the <path>/etc/fstab</path> listed below, but of course be sure to replace "BOOT", >"ROOT" and "SWAP" with the actual block devices you are using (such as <c>hda1</c>, etc.) > ><note>If you are installing from another distro, you have a head start on editing these various >configuration files as your distro already has fully configured configuration files. >As such, you may wish to start another console session outside the current >Gentoo session and copy files into your gentoo directory structure and edit these files >as appropriate. To avoid confusion, remember that the instructions here are <e>all inside the >Gentoo console we chroot'd earlier</e></note> > ><pre> ><comment> ># /etc/fstab: static file system information. ># ># noatime turns of atimes for increased performance (atimes normally aren't ># needed; notail increases performance of ReiserFS (at the expense of storage ># efficiency). It's safe to drop the noatime options if you want and to ># switch between notail and tail freely. > ># <fs> <mountpoint> <type> <opts> <dump/pass> > ># NOTE: If your BOOT partition is ReiserFS, add the notail option to opts. ></comment> >/dev/BOOT /boot ext2 noauto,noatime 1 2 >/dev/ROOT / ext3 noatime 0 1 >/dev/SWAP none swap sw 0 0 >/dev/cdroms/cdrom0 /mnt/cdrom iso9660 noauto,ro 0 0 >proc /proc proc defaults 0 0 ></pre> > ><p></p> ><note>If you are installing from another distro, you may not have a Boot partition to mount as this may >simply be a /boot directory on your current Root partition. If this is the case, simply comment >out the boot mount line in Gentoo's fstab skeleton shown above.</note> ></body> ></section> > > ><!-- ########################### --> ><section><title>Set the root password</title> ><body> ><p>Before you forget, set the root password by typing:</p> ><pre> ># <i>passwd</i> ></pre> ></body> ></section> > > ><!-- ########################### --> ><section><title>/etc/localtime</title> ><body> ><p>Look for your timezone (or GMT if you using Greenwich Mean Time) in ><path>/usr/share/zoneinfo</path>. Then, make a symbolic link by typing:</p> > ><pre> ># <i>ln -sf /usr/share/zoneinfo/path/to/timezonefile /etc/localtime</i> ></pre> ></body> ></section> > ><!-- ########################### --> ><section><title>/etc/hostname</title> ><body> ><p>Edit this file so that it contains your fully-qualified domain name on a single line, i.e. <c>mymachine.mydomain.com</c>. ></p> ></body> ></section> > ><!-- ########################### --> ><section><title>/etc/hosts</title> ><body> ><p>This file contains a list of ip addresses and their associated hostnames. It's used by the system to resolve the IP addresses >of any hostnames that may not be in your nameservers. Here's a template for this file: ></p><pre> >127.0.0.1 localhost ><comment># the next line contains your IP for your local LAN, and your associated machine name</comment> >192.168.1.1 mymachine.mydomain.com mymachine ></pre> ></body> ></section> > ><!-- ########################### --> ><section><title>Final network configuration</title> ><body> ><p> >Add the names of any modules that are necessary for the proper functioning of your system to ><path>/etc/modules.autoload</path> file (you can also add any options you >need to the same line.) When Gentoo Linux boots, these modules will be automatically >loaded. Of particular importance is your ethernet card module, if you happened to compile >it as a module: ></p> ><pre caption="/etc/modules.autoload"> >3c59x ></pre> > ><warn>For those installing from existing distro, don't simply copy this file over as it >may be loading modules you decided to build into the kernel. Review carefully before saving changes ></warn> > ><p>Edit the <path>/etc/conf.d/net</path> script to get your network configured for your >first boot: ></p> ><pre> ># <i>nano -w /etc/conf.d/net</i> ># <i>rc-update add net.eth0 default</i> ></pre> ><p> >If you have multiple network cards you need to create additional <path>net.eth<comment>x</comment></path> >scripts for each one (<comment>x</comment> = 1, 2, ...): ></p> ><pre caption="Multiple network interfaces"> ># <i>cd /etc/init.d</i> ># <i>cp net.eth0 net.eth<comment>x</comment></i> ># <i>rc-update add net.eth<comment>x</comment> default</i> ></pre> ><p> >If you have a PCMCIA card installed, have a quick look into >/etc/init.d/pcmcia to verify that things seem all right for your setup, >then add ><pre> >depend() { > need pcmcia >} ></pre> >on top of your <path>/etc/init.d/net.eth<comment>x</comment></path> file, >for the pcmcia drivers to be autoloaded whenever your network is loaded. ></p> ></body> ></section> > ><!-- ########################### --> ><section><title>Configure basic settings</title> ><body> ><pre caption="basic configuration"> ># <i>nano -w /etc/rc.conf</i> ></pre> ><p> >Follow the directions in the file to configure the basic settings. ></p> ></body> ></section> ></chapter> > ><!-- >############################################################# >## Chapter 15 >## Configuring a Boot Loader >############################################################# >--><chapter><title>Configuring a Boot Loader</title> > ><!-- ########################### --> ><section><title>Overview</title> ><body> ><p>Before you can successfully boot to your new Gentoo installation, you must configure a boot >loader by telling it where your Gentoo boot image file is and where Gentoo resides on your >computer. The boot loader is the very first thing your computer will be looking for when you >reboot your machine and its job is to simply direct the boot up process to the appropriate >OS image file so that the specified operating system can begin to load and boot up.</p> > ><p>For those installing Gentoo via another distro and have Lilo as their current >boot loader, you have the option of converting over to GRUB, or continuing to use Lilo >as your boot loader. You will probably find Lilo easiest to get working in this senario as >working boot loader and configuration file are readily available for configuring. See the next >section, <uri link="#doc_chap15_sect2">Configuring Lilo</uri>.</p> > ><p>For those installing from CD, you are encouraged to use the GRUB boot loader as it has much >better support for loading a variety of different operating systems as well as decoupling each >operating system's boot image from the boot loader itself. This means that, unlike Lilo, you >do not have to regenerate the boot images that are written to the MBR (Master Boot Record) >each time you build a kernel. If you wish to use GRUB, then skip the Configuring Lilo section >altogether and begin with <uri link="#doc_chap15_sect3">Configuring GRUB section below</uri>.</p> > ></body> ></section> > ><!-- ########################### --> ><section><title>Configuring Lilo</title> ><body> ><p>If you are installing from a current distro, then in all likelihood, you >have lilo already installed as your current dual booter. If you currently >use GRUB or if you are installing from CD, then skip on ahead to Configuring >GRUB as this section is for installing from a current distro with Lilo >as their current booter.</p> > ><p>Once your bzImage is built, you need to access your current distro's boot directory. >The following will exit your gentoo console and allow you to copy the new bzImage to its >appropriate location:</p> > ><pre> ># <i> exit</i> <comment> // returns to your current distro's console</comment> ># <i> cp /mnt/gentoo/boot/bzImage /boot/bzImage</i> ></pre> > ><p>Now edit <path>/etc/lilo.conf</path> to add an entry for Gentoo, following the example set forth >in your current lilo.conf. Alternatively, you can just do the following if you have installed >Gentoo to <path>/dev/hda4</path> (just an example, use your real path!)</p> > ><pre> >image=/boot/bzImage > label=Gentoo > root=<i>/dev/hda4</i> <comment>// set this to <i>your</i> Gentoo partition!</comment> ></pre> > ><p>Finally, run Lilo to regenerate the boot image and write changes to the MBR:</p> > ><pre> ># <i>lilo -v</i> ></pre> > ><p>If you did everything correctly, lilo should have reported no errors and you should have seen >your new Gentoo entry written to MBR. You are now set to choose Gentoo when you reboot.</p> > ><impo>If you rebuild your kernel at a later date, you must re-run lilo after copying the new bzImage >file to the <path>/boot</path> directory.</impo> > ><p>After configuring Lilo, skip ahead to <uri link="#doc_chap16">Installation Complete!</uri></p> > ></body> ></section> > ><!-- ########################### --> ><section><title>Configuring GRUB</title> ><body> ><p> >The most critical part of understanding GRUB is getting comfortable with how GRUB refers to hard drives and partitions. >Your Linux partition <path>/dev/hda1</path> is called <path>(hd0,0)</path> under GRUB. Notice the parenthesis around the hd0,0 - they are required. >Hard drives count from zero rather than "a", and partitions start at zero rather than one. So, <path>/dev/hdb3</path> gets translated to <path>(hd1,2)</path>, and <path>/dev/hdd7</path> gets translated to <path>(hd3,6)</path>. After you've gotten the feel for that, convert your boot and root partition names to the GRUB format and write them down. Now, it's time to install GRUB. ></p> > ><note>You will find excellent documentation for GRUB at <uri>http://www.gnu.org/manual/grub-0.90/grub.html</uri> ></note> > ><p>The easiest way to install grub is to simply type <c>grub</c> at your chrooted shell prompt: ></p> > ><pre> ># <i>grub</i> ></pre> > ><p>You'll be presented with the <c>grub></c> grub command-line prompt. Now, you need to type in the >right commands to install the GRUB boot record onto your hard drive. In my example configuration, >I want to install the GRUB boot record on my hard drive's MBR (master boot record), so that >the first thing I see when I turn on the computer is the GRUB prompt. In my case, the commands >I want to type are:</p> > ><pre>grub> <i>root (hd0,0)</i> >grub> <i>setup (hd0)</i> >grub> <i>quit</i> ></pre> > ><p>Here's how the two commands work. The first <c>root ( )</c> command tells GRUB >the location of your boot partition (in our example, <path>/dev/hda1</path> or ><path>(hd0,0)</path> in GRUB terminology. Then, the second <c>setup ( )</c> command tells GRUB where to install the >boot record - it will be configure to look for its special files at the <c>root >( )</c> location that you specified. In my case, I want the boot record on the >MBR of the hard drive, so I simply specify <path>/dev/hda</path> (also known as <path>(hd0)</path>). If I were using >another boot loader and wanted to set up GRUB as a secondary boot-loader, I >could install GRUB to the boot record of a particular partition. In that case, >I'd specify a particular partition rather than the entire disk. Once the GRUB >boot record has been >successfully installed, you can type <c>quit</c> to quit GRUB. Gentoo Linux is >installed, but we need to create the <path>/boot/grub/menu.lst</path> file so that >we get a nice GRUB boot menu when the system reboots. Here's how to do it.</p> > ><p>Now, create the menu.lst file (<c>nano -w /boot/grub/menu.lst</c>), and add the following to it:</p> > ><pre> >default 0 >timeout 30 >splashimage=(hd0,0)/boot/grub/splash.xpm.gz > >title=My example Gentoo Linux >root (hd0,0) >kernel /boot/bzImage root=/dev/hda3 > ><comment># Below needed only for people who dual-boot</comment> >title=Windows NT Workstation >root (hd0,5) >chainloader +1 ></pre> > ><note> >The <path>menu.lst</path> file should end in "lst" as in "list", not "1st" as in "first". Also, (hd0,0) should be >written without any spaces inside the parentheses. ></note> > ><p>After saving this file, Gentoo Linux installation is complete. Selecting the first option will >tell GRUB to boot Gentoo Linux without a fuss. The second part of the menu.lst file is optional, and shows you how to >use GRUB to boot a bootable Windows partition.</p> > ><note>Above, <path>(hd0,0)</path> should point to your "boot" partition >(<path>/dev/hda1</path> in our example config) and <path>/dev/hda3</path> should point to >your root filesystem. <path>(hd0,5)</path> contains the NT boot >loader.</note> > ><p>Also, if you need to pass any options to the kernel, simply >add them to the end of the <c>kernel</c> command. We're already passing one option >(<c>root=/dev/hda3</c>), but you can pass others as well. In particular, you can >turn off devfs by default (not recommended unless you know what you're doing) by >adding the <c>gentoo=nodevfs</c> option to the <c>kernel</c> command.</p> > ><note>Unlike in earlier versions of Gentoo Linux, you no longer have to add ><c>devfs=mount</c> to the end of the <c>kernel</c> line to enable devfs. In rc6 >devfs is enabled by default. ></note> > ></body> ></section> > ></chapter> > ><!-- >############################################################# >## Chapter 16 >## Installation Complete >############################################################# >--><chapter><title>Installation Complete!</title> > ><!-- ########################### --> ><section> ><body> ><p>Now, Gentoo Linux is installed. The only remaining step is to exit the chrooted shell, safely unmount your partitions >and reboot the system:</p> ><pre> ># <i>exit</i> ><codenote>This exits the chrooted shell; you can also type <c>^D</c></codenote> ># <i>cd / </i> ># <i>umount /mnt/gentoo/boot</i> ># <i>umount /mnt/gentoo/proc</i> ># <i>umount /mnt/gentoo</i> ># <i>reboot</i> ></pre> ><note> >After rebooting, it is a good idea to run the <c>update-modules</c> command to create >the <path>/etc/modules.conf</path> file. Instead of modifying this file directly, you should >generally make changes to the files in <path>/etc/modules.d</path>. ></note> ><p>If you have any questions or would like to get involved with Gentoo Linux development, >consider joining our gentoo-user and gentoo-dev mailing lists >(there's a "click to subscribe" link on our <uri link="http://www.gentoo.org">main page</uri>). ></p> ><p>If you wish to continue with installing X Windows, Sound, etc., then this ><uri link="http://www.gentoo.org/doc/desktop.html">Desktop Guide</uri> will get you well on your way.</p> ></body> ></section> > ><!-- ########################### --> ><section><title>Resources</title> ><body> ><p>To learn more about GRUB, visit <uri>http://www.gnu.org/manual/grub-0.90/grub.html</uri></p> > ><p>For more in-depth Linux installation (non-distro specific), you may wish to check >out the following: <uri>http://www.linuxdocs.org/HOWTOs/HOWTO-INDEX/os.html</uri>.</p> > ><p>For in-depth review of Linux filesystems and each's strengths and weaknesses, visit ><uri>http://www.gentoo.org/index-articles.html</uri>. You will also find other articles >about Linux sub-systems here.</p> > ><p>You may also wish to visit <uri>http://www.zip.com.au/~akpm/linux/ext3/ext3-usage.html</uri> >to find out more about using ext3 under Linux 2.4.</p> > ><p>You can find a whole community of Gentoo users and fans willing to help you with installation issues >and troubleshooting on IRC at irc.opensourceprojects.net on the #gentoo channel. You can also subscribe >to a mailing list just for new Gentoo users and those installing and configuring Gentoo at ><uri link="http://lists.gentoo.org/mailman/listinfo/gentoo-newbies">Gentoo-Newbies</uri></p> > ></body> ></section> > ></chapter> ></guide>
<?xml version='1.0'?> <guide link="/doc/build.html"> <title>Gentoo Linux 1.0_rc6 Installation Instructions</title> <author title="Chief Architect"><mail link="drobbins@gentoo.org">Daniel Robbins</mail></author> <author title="Author">Chris Houser</author> <author title="Author"><mail link="jerry@gentoo.org">Jerry Alexandratos</mail></author> <author title="Ghost"><mail link="g2boojum@gentoo.org">Grant Goodyear</mail></author> <author title="Gentoo Fan"><mail link="mwlang@cybrains.net">Michael Lang</mail></author> <abstract>This Gentoo Installation Guide walks you through the most common ways of installing Gentoo onto your x86-compatable system. The installation steps assumes you have some Linux experience and are comfortable with setting up disk partitions and creating filesystems.</abstract> <version>1.5.0</version> <date>14 March 2002</date> <!-- ############################################################# ## Chapter 1 ## Overview ############################################################# --><chapter><title>Getting Started</title> <!-- ########################### --> <section><title>Overview</title> <body> <p>The Gentoo Distribution is what is known as a "build from scratch" meta-distribution which basically means that focus is on providing an easy method of building your entire Linux box directly from the source. Because of this, your primary objective in getting the installation going is to get your partitions prepped and then connected to the Internet so that the source code packages can be downloaded and built by the portage system.</p> <p>To install Gentoo, you will need to have a 486+ processor and ideally at least 64 Megabytes of RAM.</p> <note>Gentoo linux has been successfully built with 64MB of RAM and 64MB of swap space, but the build process is painfully slow under these conditions.</note> <p>In addition to the "minimal build" CD, which has just enough tools to set up your partitions and connect to the Internet, there is an alternative "fast binary build" installation CD which contains everything you need pre-compiled for a "comfortable" system and is also covered here. This is handy for those in a rush and just want to get Gentoo up and running.</p> <note>While the "Fast Binary Build" CD will get you up and running the fastest, you will be cheating yourself out of Gentoo's primary strength, which is building each and every package just for your machine and optimized specifically for your needs. In other words, you are encouraged to "build from scratch" as we feel the end result is more than worth it and the difficulty of doing so has been reduced to a fairly simple and elegant process.</note> <p>The ISO images, when burned to CD, creates a CD that will boot from nearly any modern IDE CD-ROM drive, as well as many SCSI CD-ROMs. Included on the CD-ROM is Linux support for IDE (built-in to the kernel) as well as support for all SCSI devices (available as modules). In addition, modules for literally every kind of network card that Linux supports, as well as tools to allow you to configure your network and establish outbound <c>ssh</c> connections and download files.</p> </body> </section> <!-- ########################### --> <section><title>Choosing an Installation Method</title> <body> <p>This document details several ways of getting Gentoo off the ground and running (Penguins don't fly, but this one might!). As such, choose your preferred method from below and skip ahead to the appropriate section:</p> <ol> <li> Download the fast binary build ISO image (~615 mb) and burn to CD. You will boot with this CD, configure your partition and then build your machine directly from the CD rather than from the Internet. Jump to <uri link="#doc_chap2">Installing from Fast Binary Build Boot CD</uri>. <note>You must have at least a Pentium class or better system to use this method. The other "from scratch" methods will work for all x86-compatable systems.</note> <p></p> </li> <li> Download the minimal build ISO image (~17 mb) and burn to CD. You will boot with this CD and then create your partitions and configure your network card to connect to the Internet where you can then begin the process of downloading and building your system directly from the source. Jump to <uri link="#doc_chap3">Installing from Minimal Boot CD</uri>. <p></p> </li> <li> Download the minimal build tarball file (~9 mb) to your existing linux system. You will piggy-back on your current distro's network configuration, prep a partition to hold Gentoo and get a basic working Gentoo sub-environment operational from which you can then download and build your complete Gentoo system. Jump to <uri link="#doc_chap4">Installing from Existing Distro</uri>. </li> </ol> <important>All ISO CD images and tarballs may be found at: <uri>http://www.ibiblio.org/gentoo/snapshots/build/</uri></important> <p></p> <note>If you are planning on using the "minimal build" CD install method, you will want to use the <c>"build-i<comment>x</comment>86"</c> tbz2 image. But, if you are using the "fast binary" install method, you should use the <c>"build-i<comment>5</comment>86"</c> tbz2 image. The "build-i586" image is included on the "build-i586" ISO; it contains a fully-bootstrapped i586-optimized Gentoo Linux system and a snapshot of our Portage tree. With the "build-i586" image, there is no need to boostrap or to run "emerge rsync" to grab the Portage tree from cvs.gentoo.org.</note> </body> </section> </chapter> <!-- ############################################################# ## Chapter 2 ## Fast Binary Install ############################################################# --><chapter><title>Installing from Fast Binary Build CD</title> <!-- ########################### --> <section><title>Booting up</title> <body> <p>To begin installing with the fast binary Build CD, grab the latest (<path>build-i586-1.0_rc6.iso</path> at the time of this writing) ~614mb ISO file and burn to a blank CD then reboot your computer with this CD in the drive.</p> <note>You may have to change boot device order in your CMOS Settings so that CD-ROM is checked before booting to Hard drive.</note> <p>When the CD successfully boots, you will be greeted with a bunch of text and a <c>boot:</c> prompt at the bottom of the screen. At this prompt, hit enter, and Linux will begin loading from the CD.</p> <p>Next, you'll be greeted with a small list of commands available on the boot CD, including <c>nano</c> (a pico editor clone) and instructions for setting up the network. Then, you'll be prompted to select your preferred keymap, followed by PCI autodection. The PCI autodetection process will automatically load the appropriate kernel modules for many popular PCI SCSI and ethernet devices. After this, you can hit enter to enter the minimal boot CD Linux environment. You should have a root ("<c>#</c>") prompt on the current console. <note>You can also open new consoles by typing alt-f2, alt-f3, etc and then hitting enter.</note></p> </body></section> <!-- ########################### --> <section><title>Loading Hardware Access Modules</title> <body> <p>Now, if you want to be able to access any SCSI hardware that wasn't detected during the PCI autodetection process, you'll need to load the appropriate modules from /lib/modules, again using <c>modprobe</c>:</p> <pre> # <i>modprobe aic7xxx</i> # <i>modprobe sr_mod</i> # <i>modprobe sd_mod</i> </pre> <p>Above, we modprobe the <c>aic7xxx</c> SCSI driver and then make sure that SCSI CD-ROM (<c>sr_mod</c>) and disk (<c>sd_mod</c>) support is loaded.</p> <note><c>hdparm</c> is now included on -r10 and later of the iso. If any of your drives require tweaking, now would be a good time to do so.</note> <note>If you are doing a "fast binary" install and plan to use only those packages included on the CD, then setting up a network is not required. However, we always recommend doing it if possible since it can come in handy a lot of the time. To set up your network card, see instructions for Loading your Network Adaptor below. </note> <p>You are now ready to start setting up your partitions. Jump to <uri link="#doc_chap5">Setting up Partitions</uri>.</p> </body> </section> </chapter> <!-- ############################################################# ## Chapter 3 ## Minimal Build Install ############################################################# --> <chapter><title>Installing from Minimal Build CD</title> <!-- ########################### --> <section><title>Booting Up</title> <body> <p>To begin the install process, first grab the latest 16Mb build CD ISO image (<path>build-ix86-1.0_rc6-r17.iso</path> is the latest at the time this article was written) from from the images site noted above.</p> <note>The Pentium+ fast binary CD can also be used as a "from scratch" CD for i486+ systems.</note> <p>Once you're done downloading the ISO image file, burn the ISO image to a CD using your preferred CD burning software then boot your computer with the CD in the drive.</p> <note>You may have to change boot device order in your CMOS Settings so that CD-ROM is checked before booting to Hard drive.</note> <p>When the CD successfully boots, you will be greeted with a bunch of text and a <c>boot:</c> prompt at the bottom of the screen. At this prompt, hit enter, and Linux will begin loading from the CD.</p> <p>Next, you'll be greeted with a small list of commands available on the boot CD, including <c>nano</c> (a pico editor clone) and instructions for setting up the network. Then, you'll be prompted to select your preferred keymap, followed by PCI autodection. The PCI autodetection process will automatically load the appropriate kernel modules for many popular PCI SCSI and ethernet devices. After this, you can hit enter to enter the minimal boot CD Linux environment. You should have a root ("<c>#</c>") prompt on the current console. <note>You can also open new consoles by typing alt-f2, alt-f3, etc and then hitting enter.</note></p> </body></section> <!-- ########################### --> <section><title>Loading Hardware Access Modules</title> <body> <p>We're almost ready to begin installing Gentoo Linux, but first we need take the necessary steps so that the kernel recognizes our network cards, and optionally any SCSI hardware that is in our system that PCI autodetection missed.</p> <p>If you want to be able to access any SCSI hardware that wasn't detected during the PCI autodetection process, you'll need to load the appropriate modules from /lib/modules, again using <c>modprobe</c>:</p> <pre> # <i>modprobe aic7xxx</i> # <i>modprobe sr_mod</i> # <i>modprobe sd_mod</i> </pre> <p>Above, we modprobe the <c>aic7xxx</c> SCSI driver and then make sure that SCSI CD-ROM (<c>sr_mod</c>) and disk (<c>sd_mod</c>) support is loaded.</p> <note><c>hdparm</c> is now included on -r10 and later of the iso. If any of your drives require tweaking, now would be a good time to do so.</note> </body> </section> <!-- ########################### --> <section><title>Loading your Network Adaptor</title> <body> <p>If you are installing on a laptop and your network card is a PCMCIA card, then your first step is to get the PCMCIA module loaded to support your cardbus.</p> <pre> # <i>insmod pcmcia_core</i> # <i>insmod i82365</i> # <i>insmod ds</i> # <i>cardmgr -f</i> </pre> <p>As the cardmgr detects which hardware is present, your speaker should emit a few reassuring beeps, and your PCMCIA network card should hum to life. You can of course insert the PCMCIA card after loading cardmgr too, if that's preferrable.</p> <warn>Technically, you do not need to run <i>cardmgr</i> if you know <e>exactly</e> which module your PCMCIA card requires. But if you don't, loading all PCMCIA modules and seeing which sticks won't work, as all PCMCIA modules load obligingly and hang around for a PCMCIA card to drop by. <i>cardmgr</i> will also unload the module(s) for any card when you remove it.</warn> <p>If you are not using cardmgr to auto-load the appropriate network card module, then you need to load it using the <c>modprobe</c> command. To view a list of all available network card modules, type <c>ls /lib/modules/*/kernel/drivers/net/*</c>. To load a particular module, type:</p> <pre> # <i>modprobe pcnet32</i> <comment>(replace pcnet32 with your NIC module)</comment> </pre> <note>Some of the more popular network cards are eepro100 and tulip. So try these first if you don't know which module is right for your card. If modprobe is successful in loading the module, then you will get the next <c>#</c> prompt with no error messages displayed.</note> </body> </section> <!-- ########################### --> <section><title>Configuring Network</title> <body> <p>The new -r11+ boot CDs allow you to configure a working network, allowing you to use <c>ssh</c>, <c>scp</c> or <c>wget</c> as needed before even beginning the installation process. Even if you don't need to do these things now, you should go ahead and set up networking now. Once set up, Portage will be able to use your configured network once you are inside the chroot environment (required for installing Gentoo Linux).</p> </body> </section> <!-- ########################### --> <section><title>DHCP</title> <body> <p>Network configuration is simple with DHCP; If your ISP is not using DHCP, skip down to the static configuration section below. </p> <pre caption="Network configuration with DHCP"> # <i>dhcpcd eth0</i> </pre> <note> Some ISPs require you to provide a hostname. To do that, add a <c>-h myhostname</c> flag to the dhcpcd command line above. </note> <p>If you receive <i>dhcpConfig</i> warnings, don't panic; the errors are most likely cosmetic. Skip down to Network testing below.</p> </body> </section> <!-- ########################### --> <section><title>Static configuration</title> <body> <p>We need to setup just enough networking so that we can download sources for the system build, as well as the required localhost interface. Type in the following commands, replacing $IFACE with your network interface (typically <c>eth0</c>), $IPNUM with your IP address, $BCAST with your broadcast address, and $NMASK with your network mask. For the <c>route</c> command, replace $GTWAY with your default gateway. </p> <pre> # <i>/sbin/ifconfig $IFACE $IPNUM broadcast $BCAST netmask $NMASK</i> # <i>/sbin/route add -net default gw $GTWAY netmask 0.0.0.0 metric 1</i> </pre> <p>Now, it's time to create the <path>/etc/resolv.conf</path> file so that name resolution (finding Web/FTP sites by name, rather than just by IP address) will work.</p> <note>At the moment the only editor installed by default is <c>nano</c>, a small and very easy-to-use visual editor. Use <c>nano</c> with the <c>-w</c> option to turn off automatic line-wrapping. </note> <p>Here is a template to follow for creating your /etc/resolv.conf file: </p> <pre caption="/etc/resolv.conf template"> domain mydomain.com nameserver 10.0.0.1 nameserver 10.0.0.2 </pre> <p>Replace <c>10.0.0.1</c> and <c>10.0.0.2</c> with the IP addresses of your primary and secondary DNS servers respectively.</p> </body> </section> <!-- ########################### --> <section><title>Network testing</title> <body> <p>Now that your network has been configured, the <c>/sbin/ifconfig -a</c> command should show (hopefully!) that your network card is working (look for <e>UP</e> and <e>RUNNING</e> in the output). </p> <pre caption="/sbin/ifconfig for a working network card"> eth0 Link encap:Ethernet HWaddr 00:50:BA:8F:61:7A inet addr:192.168.0.2 Bcast:192.168.0.255 Mask:255.255.255.0 inet6 addr: fe80::50:ba8f:617a/10 Scope:Link UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1 RX packets:1498792 errors:0 dropped:0 overruns:0 frame:0 TX packets:1284980 errors:0 dropped:0 overruns:0 carrier:0 collisions:1984 txqueuelen:100 RX bytes:485691215 (463.1 Mb) TX bytes:123951388 (118.2 Mb) Interrupt:11 </pre> <!-- <note> If you have a static ppp link, you can !!! do this...!!! </note> --> </body> </section> <!-- ########################### --> <section><title>Networking is go!</title> <body> <p>Networking should now be configured and useable. You should be able to use the included <c>ssh</c>, <c>scp</c> and <c>wget</c> commands to connect to other machines on your LAN or the Internet.</p> <p>You are now ready to start setting up your partitions. Jump to <uri link="#doc_chap5">Setting up Partitions</uri>.</p> </body> </section> </chapter> <!-- ############################################################# ## Chapter 4 ## Other Distro Install ############################################################# --><chapter><title>Installing from Existing Distro</title> <!-- ########################### --> <section><title>Overview</title> <body> <p>Many users will be encountering Gentoo after having already installed another popular distro such as Red Hat, Mandrake, Slackware, etc. on their machines. As such, you will be able to install Gentoo without burning a CD. The basic strategy is to free up at least one partition so that you many install Gentoo to a clean, mountable partition.</p> <note>One of the main advantages of this approach is that you do not need a CD Burner in order to install Gentoo. However, if you want to install on of the more advanced file systems discussed in <uri link="#doc_chap5">Setting up Partitions</uri>, you will need to compile support for that filesystem into your current distro's kernel and also download the appropriate packages for making the filesystems.</note> <p>This guide walks you through setting up Gentoo on a Linux system that has the following configuration:</p> <p> <table> <tr> <th>Name</th> <th>Partition</th> <th>Description</th> </tr> <tr> <ti>Boot</ti> <ti><path>/dev/hda1</path></ti> <ti>boot partition, containing kernel(s) and boot information</ti> </tr> <tr> <ti>Root</ti> <ti><path>/dev/hda2</path></ti> <ti>root partition, containing main filesystem (<path>/etc</path>, <path>/usr</path>, <path>/bin</path>, etc)</ti> </tr> <tr> <ti>Swap</ti> <ti><path>/dev/hda3</path></ti> <ti>swap partition (no longer a 128 Megabyte limit)</ti> </tr> <tr> <ti>Data</ti> <ti><path>/dev/hda4</path></ti> <ti>data partition, containing <path>/home</path></ti> </tr> </table> </p> <impo>Your configuration will likely differ slightly from the above. For example, Mandrake's default installation does not have the Boot partition, but rather, places the boot images in the /boot directory of the Root partition. You will need to spend some time figuring out which partitions you have. Once you have figured out your partitions and paths, you will be able to translate the literal paths here to suit your environment.</impo> <note>The installation steps here will allow you to install Gentoo without damaging your existing distro's setup. In other words you'll be able to boot to your current distro as well as Gentoo's distro when we're done.</note> </body> </section> <!-- ########################### --> <section><title>Determine where to Install Gentoo</title> <body> <p>If you have a second hard drive or additional unpartitioned space on your current hard drive, then you are in great shape to begin installing Gentoo. However, if your current hard drive is fully partitioned, then you will need to choose a partition from your currently available partitions to become Gentoo's Root.</p> <warn>It is highly recommended that you start by logging in only as root and only to a console to avoid "file busy" problems that may arise from having various apps and files opened.</warn> <note>If you have a boot disk from your existing distro or can burn the minimal build CD for Gentoo, then a separate partition is not absolutely required as you can build Gentoo in a sub-directory of your current Root partition and then boot from a boot disk, delete the old system, and move the files in the chroot directory to root. However, this alternative <i>will</i> destroy your current distro.</note> <p>If you already have the extra partition sitting around with no data on it, then you can just proceed to the next chapter, <uri link="#doc_chap5">Setting up Partitions</uri> and begin setting up your partitions.</p> <p>Probably the easiest partition to free up is the Data partition, especially if you have enough room to copy all files on this partition to your current Root partition. To do this, do the following:</p> <pre> # <i>mkdir /tmphome</i> # <i>mv /home/* /tmphome</i> <comment>// be sure you have enough disk space!</comment> # <i>umount /home</i> # <i>rmdir /home</i> # <i>mv /tmphome /home</i> </pre> <impo>It is recommended that you go ahead and comment out the line for mounting to /home from your <path>/etc/fstab</path> as you will no longer be mounting to this partition when booting to your current distro. </impo> <p>Now you are ready to continue with setting up your partitions. Because you already have a fully functional distro, you can get away with only setting up the file system for the new Gentoo Root partition. In other words, you can utilize your current Boot and Swap partitions with Gentoo.</p> <impo>When instructed to create the <path>/mnt/gentoo</path> directory and such, just create these on your current distro's Root partition.</impo> </body> </section> <!-- ################# BAH!!! ################## Can't do this without bootstrapping twice (can't emerge util-linux which has the mount cmd in it), so I'm commenting out. I also had the mistaken assumption as I started to write this that when you chroot you flipped over the kernel (VMWare like). Since this doesn't happen, the user has to compile new file system into existing distro's kernel. IMO, this is too much. However, I leave this in here for future authors review in case someone more knowledgeable can figure out how to do this. - Michael: mwlang@cybrains.net <section>Prepping for file systems other than ext2</section> <body> <note>Follow this step only if you want to be able to utilize a partition other than ext2 as described in the next chapter on <uri link="#doc_chap5">Setting up Partitions</uri>.</note> <impo>It is assumed that your system has kernel support for the file systems you want to utilize (such as XFS or Rieserfs) already built in. However, distros do not always install the file system makers such as mkfs.xfs and mkreiserfs. This step walks you through getting these programs installed the <e>Gentoo way.</e> If you do not have a fast Internet connection, then you might want to locate the xfsprogs and fe2progs packages for your current distro and install them the traditional way for your distro.</impo> <p>To enable your system to utilize some of the more advanced partitions, you can get your first taste of what Gentoo's portage system is all about. To begin, create a directory for gentoo on your existing Root partition and extract the tarball (<path>build-ix86-1.0_rc6-r11.tbz2</path> at the time of this writing).</p> <pre> # mkdir /gentoo # cd /gentoo # tar -xvjpf /path/to/downloaded/tarball/build-*.tbz2 # mount -o bind /proc /gentoo/proc # chroot /gentoo /bin/bash < /pre> // ok, at this point, I discovered that mounting within the Gentoo "shell" doesn't work and also // found out that chroot doesn't flip over the kernel. bad assumption! bad! :-p''' // the whole idea of this section was to pop into a gentoo shell, emerge what I needed for the exotic // filesystem makers, then mount and untar gentoo a 2nd time onto the new root partition for gentoo </body> </section> ############## END BAH!! ##############--> </chapter> <!-- ############################################################# ## Chapter 5 ## Setting up Partitions ############################################################# --><chapter><title>Setting up Partitions</title> <!-- ########################### --> <section> <body> <p>Now that the kernel can see our network card and disk controllers, it's time to set up disk partitions for Gentoo Linux.</p> <note>If you are installing from an existing distro, you <e>can</e> utilize your existing distro's Boot partition as well as your existing Swap partition. You <e>cannot</e>, however use your existing distro's Root partition if you want to be able to boot to it as well as Gentoo. Keep these points in mind as you read the instructions for setting up partitions here. <p>Also, many distros don't have a separate boot partition by default. This is perfectly alright. You will find all your boot images in your current distro's /boot directory and it is here that you will copy your final bzImage file.</p> </note> <p>Here's a quick overview of the standard Gentoo Linux partition layout. We're going to create at least three partitions: a swap partition, a root partition (to hold the bulk of Gentoo Linux), and a special boot partition. The boot partition is designed to hold GRUB boot loader information as well as your Linux kernel(s). The boot partition gives us a safe place to store everything related to booting Linux. During normal day-to-day Gentoo Linux use, your boot partition should remain <e>unmounted</e>. This prevents your kernel from being made unavailable to GRUB (due to filesystem corruption) in the event of a system crash, preventing the chicken-and-egg problem where GRUB can't read your kernel (since your filesystem isn't consistent) but you can't bring your filesystem back to a consistent state (since you can't boot!) </p> <p>Now, on to filesystem types. Right now, you have four filesystem options: XFS, ext2, ext3 (journaling) and ReiserFS. ext2 is the tried and true Linux filesystem but doesn't have metadata journaling. ext3 is the new version of ext2 with both metadata journaling and ordered data writes, effectively providing data journaling as well. ReiserFS is a B*-tree based filesystem that promises very good small file performance, and greatly outperforms both ext2 and ext3 when dealing with small files (files less than 4k), often by a factor of 10x-15x. However, we do <e>not</e> recommend ReiserFS at this time, due to repeated occurances of file-system corruption with the 2.4.x series kernels. ReiserFS has metadata journaling, but no data journaling. XFS is a high-performance enterprise-class filesystem with metadata journaling that is fully supported under Gentoo Linux. </p> <p>If you're looking for the most standard filesystem, use ext2. If you're looking for the most rugged journalled filesystem, use ext3. If you're looking for a high-performance filesystem with journaling support, use XFS; both ext3 and XFS are mature and refined. All filesystems except ReiserFS are production-ready. Here are our basic recommended filesystem sizes and types:</p> <table> <tr> <th>Partition</th> <th>Size</th> <th>Type</th> <th>example device</th> </tr> <tr> <ti>boot partition, containing kernel(s) and boot information</ti> <ti>>10 Megabytes</ti> <ti>ext2/3 highly recommended (easiest); if ReiserFS then mount with <c>-o notail</c></ti> <ti>/dev/hda1</ti> </tr> <tr> <ti>swap partition (no longer a 128 Megabyte limit)</ti> <ti>>=2*Amount of RAM in this system is recommended but no longer (as of kernel 2.4.10) required</ti> <ti>Linux swap</ti> <ti>/dev/hda2</ti> </tr> <tr> <ti>root partition, containing main filesystem (/usr, /home, etc)</ti> <ti>>=1.5 Gigabytes</ti> <ti>XFS, ext3 recommended; ext2 ok</ti> <ti>/dev/hda3</ti> </tr> </table> <note>At this point, create your partitions using fdisk. Note that your partitions should be of type 0x82 if swap and 0x83 for regular filesystems (whether XFS, ReiserFS <e>or</e> ext2). </note> <note>You can find more in-depth discussion of file systems at <uri>>http://www.gentoo.org/index-articles.html</uri></note> <p>Once you've created your partitions using <c>fdisk</c>, it's time to initialize the filesystems that will be used to house our data. Initialize swap as follows:</p> <pre> # <i>mkswap /dev/hda2</i> </pre> <p>You can use the <c>mke2fs</c> command to create ext2 filesystems:</p> <pre> # <i>mke2fs /dev/hda1</i> </pre> <p>To create an XFS filesystem, use the <c>mkfs.xfs</c> command:</p> <pre> # <i>mkfs.xfs /dev/hda3</i> </pre> <note> You may want to add a couple of additional flags to the <c>mkfs.xfs</c> command: <c>-d agcount=3 -l size=32m</c>. The <c>-d agcount=3</c> command will lower the number of allocation groups. XFS will insist on using at least 1 allocation group per 4 GB of your partition, so, for example, if you hava a 20 GB partition you will need a minimum agcount of 5. The <c>-l size=32m</c> command increases the journal size to 32 Mb, increasing performance. </note> <warn> If you are installing an XFS partition over a previous ReiserFS partition, later attempts to mount may fail without an explicit <c>mount -t xfs</c>. The solution is to zero out the partition before creating the XFS filesystem: <c>dd if=/dev/zero of=/dev/hd<comment>x</comment> bs=1k</c>. </warn> <p>If you'd like to use ext3, you can create ext3 filesystems using <c>mke2fs -j</c>:</p> <pre> # <i>mke2fs -j /dev/hda3</i> </pre> <p>To create ReiserFS filesystems, use the <c>mkreiserfs</c> command:</p> <pre> # <i>mkreiserfs /dev/hda3</i> </pre> <warn>Again, we do not recommend ReiserFS at this time. While ReiserFS has worked fine for many, filesystem corruption has been too common a problem with ReiserFS and the 2.4.x series kernels.</warn> <note>You can find out more about using ext3 under Linux 2.4 at <uri>http://www.zip.com.au/~akpm/linux/ext3/ext3-usage.html</uri>.</note> </body> </section> </chapter> <!-- ############################################################# ## Chapter 6 ## Mounting Partitions ############################################################# --><chapter><title>Mounting Partitions</title> <!-- ########################### --> <section> <body> <p> If you are not installing from an existing distro, then you need to activate our new swap, since we may need the additional virtual memory that provides later: </p> <pre> # <i>swapon /dev/hda2</i> </pre> <p>Next, we'll create the <path>/mnt/gentoo</path> and <path>/mnt/gentoo/boot</path> mountpoints, and we'll mount our filesystems to these mountpoints. </p> <pre> # <i>mkdir /mnt/gentoo</i> # <i>mount /dev/hda3 /mnt/gentoo</i> # <i>mkdir /mnt/gentoo/boot</i> # <i>mount /dev/hda1 /mnt/gentoo/boot</i> </pre> <p>If you are setting up Gentoo Linux with a separate <path>/usr</path> or <path>/var</path>, these would get mounted to <path>/mnt/gentoo/usr</path> and <path>/mnt/gentoo/var</path>, respectively. </p> <impo>If your <e>boot</e> partition (the one holding the kernel) is ReiserFS, be sure to mount it with the <c>-o notail</c> option so GRUB gets properly installed. Make sure that <c>notail</c> ends up in your new <path>/etc/fstab</path> boot partition entry, too. We'll get to that in a bit.</impo> </body> </section> </chapter> <!-- ############################################################# ## Chapter 7 ## Mounting the CD-ROM ############################################################# --><chapter><title>Mounting the CD-ROM</title> <note>If you're installing from another distro and didn't burn a CD image, then move on to the next step.</note> <!-- ########################### --> <section> <body> <p>Even though we've booted from the CD-ROM, the CD-ROM itself is not mounted under our minimal Linux boot CD environment. We'll need to mount it so that we can access the compressed build image tarball contained on the CD-ROM. To mount the CD-ROM, one typically types: </p> <pre> # <i>mount /dev/cdroms/cdrom0 /mnt/cdrom -o ro -t iso9660</i> </pre> <p>With the CD-ROM mounted, you should be able to see the <c>build-???.tbz2</c> file by typing <c>ls /mnt/cdrom</c>.</p> </body> </section> </chapter> <!-- ############################################################# ## Chapter 8 ## Unpacking and chroot ############################################################# --><chapter><title>Unpacking and chroot</title> <section> <body> <p>Now it's time to extract the compressed build image tarball to <path>/mnt/gentoo</path>. Then, we'll <c>chroot</c> over to the new Gentoo Linux build installation. </p> <impo>Be sure to use the <c>p</c> option with <c>tar</c>. Forgetting to do this will cause certain files to contain incorrect permissions.</impo> <pre> # <i>cd /mnt/gentoo</i> # <i>tar -xvjpf /mnt/cdrom/build-*.tbz2</i> # <i>mount -o bind /proc /mnt/gentoo/proc</i> <comment>// see note below if installing from other distro</comment> # <i>cp /etc/resolv.conf /mnt/gentoo/etc/resolv.conf</i> </pre> <note>If you are installing from another distro and you're not currently on a 2.4.x kernel, then the <i>mount -o bind</i> may cause some problems. Instead use the following: <pre> # <i> mount -t proc none /mnt/gentoo/proc</i> </pre> </note> <p>If you want to use the many pre-built packages included on the i586 CD, an additional step is needed at this point:</p> <pre> # <i>mkdir /mnt/gentoo/usr/portage/packages</i> # <i>mount -o bind /mnt/cdrom/packages /mnt/gentoo/usr/portage/packages</i> </pre> <p>Now, all users (both "ix86" and "i586" guys) should use the following commands to initialize your new Gentoo Linux chroot environment:</p> <pre> # <i>chroot /mnt/gentoo /bin/bash</i> # <i>env-update</i> Regenerating /etc/ld.so.cache... # <i>source /etc/profile</i> (none) / # <comment>ooh! A new prompt!</comment> </pre> <p>After you execute these commands, you'll be "inside" your new Gentoo Linux environment. </p> </body> </section> </chapter> <!-- ############################################################# ## Chapter 9 ## Rsync ############################################################# --><chapter><title>Rsync</title> <!-- ########################### --> <section> <body> <p>Now, "build from scratch" people will need to run <c>emerge rsync</c>. This command will tell <c>emerge</c> to connect to cvs.gentoo.org and download the latest version of our Portage ports tree.</p> <p>If you are doing a "fast binary" install, this step is <i>optional</i>, since a Portage tree snapshot was already added to your build image. You can choose to <c>emerge rsync</c> if you want to have the latest and greatest packages, or you can choose to skip the step to ensure that you will use only the pre-built binary packages included on your "i586" CD. If you want or need to <c>emerge rsync</c>, simply type:</p> <pre> # <i>emerge rsync</i> </pre> <p>The Portage tree will be downloaded; it's about 10Mb in size.</p> </body> </section> </chapter> <!-- ############################################################# ## Chapter 10 ## Bootstrap ############################################################# --><chapter> <title>Bootstrap</title> <section> <body> <impo>If you are using the "fast binary" install method, then we've already bootstrapped for you. There is no reason for you to bootstrap again, unless you decided to do an <c>emerge rsync</c> and want to ensure that you have an up-to-the-minute current Gentoo Linux system. Most "fast binary" installers will <i>not</i> want to bootstrap again, since it can take up to an hour even on very fast machines.</impo> <impo>Another important note: If you're installing this CD at FOSDEM, type <c>nano -w /etc/hosts</c> and add a line to this file that reads <c>10.1.1.1 cvs.gentoo.org</c>. This will trick your system into using the our local mirror at FOSDEM rather than connecting to our actual server in Austin, Texas, USA. This will make things go a lot faster :). Remember to remove this line from <path>/etc/hosts</path> when you get home so that your system will connect to the <i>real</i> cvs.gentoo.org from that point forward.</impo> <p>Now that you have a working copy of the Portage tree, "ix86" installers need to bootstrap their Gentoo Linux system. "i586" installers already have a bootstrapped system and should generally skip the entire bootstrap process and skip down to the <e>Building the base system</e> section below.</p> <p>Bootstrappers should first edit the file <path>/etc/make.conf</path>. In this file, you should set your <c>USE</c> flags, which specify optional functionality that you would like to be built into packages; the commented-out defaults are recommended. You also should set appropriate <c>CHOST</c>, <c> CFLAGS</c> and <c>CXXFLAGS</c> settings for the kind of system that you are creating. If necessary, you can also set proxy information here if you are behind a firewall. </p> <pre> # <i>nano -w /etc/make.conf</i> <comment>(Adjust these settings)</comment> </pre> <note> People who need to substantially tweak the build process should take a look at the <path>/etc/make.globals</path> file. This file comprises gentoo defaults and should never be touched. If the defaults do not suffice, then new values should be put in <path>/etc/make.conf</path>, as entries in <path>make.conf</path> <comment>override</comment> the entries in <path>make.globals</path>. </note> <p>Now, it's time to start the "bootstrap" process. This process will last 1-2 hours depending on how zippy your machine is; it takes about 45 minutes on my 900Mhz AMD Athlon system. During this time, the extracted build image will be prepped for compiling the rest of the system. The GNU compiler suite will be built, as well as the GNU C library. These are time consuming builds and make up the bulk of the bootstrap process:</p> <pre> # <i>cd /usr/portage</i> # <i>scripts/bootstrap.sh</i> </pre> <p>The "bootstrap" process will now begin.</p> <note> Portage by default uses <c>/var/tmp</c> during package building, often using several hundred megabytes of temporary storage. If you would like to change where Portage stores these temporary files, set a new PORTAGE_TMPDIR <e>before</e> starting the bootstrap process, as follows: </note> <pre> # <i>export PORTAGE_TMPDIR="/otherdir/tmp"</i> </pre> <p>The <c>bootstrap.sh</c> will build <c>binutils</c>, <c>gcc</c>, <c>gettext</c>, and <c>glibc</c>, rebuilding <c>binutils</c>, <c>gcc</c>, and <c>gettext</c> after <c>glibc</c> is built. Needless to say, this process takes a while. Have a nice nap.</p> </body> </section> </chapter> <!-- ############################################################# ## Chapter 11 ## Building the Base System ############################################################# --><chapter><title>Building the Base System</title> <!-- ########################### --> <section> <body> <p>Once your build image has been bootstrapped (again, "i586" users have a pre-bootstrapped system), it's time to build or install the rest of the base system. If you are using the "fast binary" i586 install, pre-built packages will be automatically used if available in order to save time. Otherwise, packages will be auto-built from sources. The following commands will work for both "ix86" and "i586" installers:</p> <pre> # <i>export CONFIG_PROTECT=""</i> # <i>emerge --usepkg --pretend system</i> <comment>[lists the packages to be installed]</comment> # <i>emerge --usepkg system</i> <comment>The --usepkg option tells emerge to check for a pre-built binary package first and to use it if available.</comment> </pre> <note>The <c>export CONFIG_PROTECT=""</c> line ensures that any new scripts installed to <path>/etc</path> will overwrite the old scripts (stored in <path>sys-apps/baselayout</path>), bypassing Portage's new config file management support. Type <c>emerge --help config</c> for more details.</note> <p> If you're doing a "build from scratch" install, it's going to take a while to finish building the entire base system. Your reward is that it will be thoroughly optimized for your system. The drawback is that you have to find a way to keep yourself occupied for some time to come. The author suggests "Star Wars - Super Bombad Racing" for the PS2.</p> </body> </section> </chapter> <!-- ############################################################# ## Chapter 12 ## Installing Kernel and System Logger ############################################################# --><chapter><title>Installing the Kernel and System Logger</title> <!-- ########################### --> <section> <body> <p> At the moment the Gentoo Linux default system does not include a kernel; you have to install it yourself. Here are the steps to compile and configure your own custom kernel: </p> <pre> # <i>emerge --usepkg sys-kernel/linux-sources</i> # <i>cd /usr/src/linux</i> # <i>make menuconfig</i> # <i>make dep clean bzImage modules modules_install</i> # <i>mv /boot/bzImage /boot/bzImage.orig</i> <comment>[if bzImage already exists]</comment> # <i>cp /usr/src/linux/arch/i386/boot/bzImage /boot</i> </pre> <note>For those installing from another distro, reviewing your current distro's <path>/etc/modules.autoload</path> file (be sure to look outside your current Gentoo console!) can remove the guesswork out of deciding which modules you will want to use with your new kernel. You can also choose to build these into the kernel rather than as modules as your current distro has done.</note> <impo>For your kernel to function properly, there are several options that you will need to ensure are in the kernel proper -- that is, they should <e>be enabled and not compiled as modules. You will need to enable the "Experimental Features" options to see several of these selections.</e> Under the "File systems" section, be sure to enable the "Device File System" (note that you <e>don't</e> need to enable the "/dev/pts file system support" option). You'll also need to enable the "Virtual Memory Filesystem". Be sure to enable "ReiserFS" if you have any ReiserFS partitions; the same goes for "Ext3". If you're using XFS, enable the "SGI XFS filesystem support" option. It's always a good idea to leave ext2 enabled whether you are using it or not. Also, most people using IDE hard drives will want to enable the "USE DMA by default" option; otherwise, your IDE drives may perform very poorly. Of course, remember to enable "IDE disk" support as well -- otherwise your kernel won't be able to see your IDE disks. </impo> <note>For those who want rock-solid stability, it is now possible to install Gentoo Linux with a 2.2 kernel. Such stability will come at a price: you will lose many of the nifty features that are new to the 2.4 series kernels (such as XFS and tmpfs filesystems, iptables, and more), although the Gentoo 2.2. kernel sources have been patched with Reiserfs and devfs support. Gentoo linux bootscripts require either tmpfs or ramdisk support in the kernel, so 2.2 kernel users need to make sure that ramdisk support is compiled in (ie, not a module). It is <comment>vital</comment> that a <e>gentoo=notmpfs</e> flag be added to the kernel line in <path>/boot/grub/menu.lst</path> for the 2.2 kernel so that a ramdisk is mounted for the bootscripts instead of tmpfs. If you choose not to use devfs, then <e>gentoo=notmpfs,nodevfs</e> should be used instead. </note> <p> Your new custom kernel (and modules) are now installed. Now you need to choose a system logger that you would like to install. We offer sysklogd, which is the traditional set of system logging daemons. We also have syslog-ng as well as metalog. Power users seem to gravitate away from sysklogd (not very good performance) and towards syslog-ng and metalog. If in doubt, you may want to try metalog, since it seems to be quite popular. To merge your logger of choice, type <e>one</e> of the next three lines: </p> <pre> # <i>emerge --usepkg sys-apps/sysklogd</i> # <i>rc-update add sysklogd default</i> <comment>or</comment> # <i>emerge --usepkg app-admin/syslog-ng</i> # <i>rc-update add syslog-ng default</i> <comment>or</comment> # <i>emerge --usepkg app-admin/metalog</i> # <i>rc-update add metalog default</i> </pre> <warn> In the case of syslog-ng you need to create <path>/etc/syslog-ng/syslog-ng.conf</path>. See <path>/etc/syslog-ng</path> for a sample configuration file. </warn> <impo> Metalog flushes output to the disk in blocks, so messages aren't immediately recorded into the system logs. If you are trying to debug a daemon, this performance-enhancing behavior is less than helpful. When your Gentoo Linux system is up and running, you can send metalog a USR1 signal to temporarily turn off this message buffering (meaning that <i>tail -f <path>/var/log/everything/current</path></i> will now work in real time, as expected), and a USR2 signal to turn buffering back on again. </impo> </body> </section> </chapter> <!-- ############################################################# ## Chapter 13 ## Install Additional Packages ############################################################# --><chapter><title>Install additional packages</title> <!-- ########################### --> <section> <body> <p> You may need to install some additional packages in the Portage tree if you are using any optional features like XFS or LVM. If you're using XFS, you should emerge the <c>xfsprogs</c> ebuild: </p> <pre> # <i>emerge --usepkg sys-apps/xfsprogs</i> </pre> <p> If you're using LVM, you should emerge the <c>lvm-user</c> ebuild: </p> <pre> # <i>emerge --usepkg sys-apps/lvm-user</i> </pre> </body> </section> </chapter> <!-- ############################################################# ## Chapter 14 ## Final Configuration ############################################################# --><chapter><title>Final configuration</title> <!-- ########################### --> <section> <body> <p>Your Gentoo Linux system is almost ready for use. All we need to do now is configure a few important system files and install the GRUB boot loader. The first file we need to configure is <path>/etc/fstab</path>. Remember that you should use the <c>notail</c> option for your boot partition if you chose to create a ReiserFS filesystem on it. Remember to specify <c>ext2</c>, <c>ext3</c> or <c>reiserfs</c> filesystem types as appropriate.</p> Use something like the <path>/etc/fstab</path> listed below, but of course be sure to replace "BOOT", "ROOT" and "SWAP" with the actual block devices you are using (such as <c>hda1</c>, etc.) <note>If you are installing from another distro, you have a head start on editing these various configuration files as your distro already has fully configured configuration files. As such, you may wish to start another console session outside the current Gentoo session and copy files into your gentoo directory structure and edit these files as appropriate. To avoid confusion, remember that the instructions here are <e>all inside the Gentoo console we chroot'd earlier</e></note> <pre> <comment> # /etc/fstab: static file system information. # # noatime turns of atimes for increased performance (atimes normally aren't # needed; notail increases performance of ReiserFS (at the expense of storage # efficiency). It's safe to drop the noatime options if you want and to # switch between notail and tail freely. # <fs> <mountpoint> <type> <opts> <dump/pass> # NOTE: If your BOOT partition is ReiserFS, add the notail option to opts. </comment> /dev/BOOT /boot ext2 noauto,noatime 1 2 /dev/ROOT / ext3 noatime 0 1 /dev/SWAP none swap sw 0 0 /dev/cdroms/cdrom0 /mnt/cdrom iso9660 noauto,ro 0 0 proc /proc proc defaults 0 0 </pre> <p></p> <note>If you are installing from another distro, you may not have a Boot partition to mount as this may simply be a /boot directory on your current Root partition. If this is the case, simply comment out the boot mount line in Gentoo's fstab skeleton shown above.</note> </body> </section> <!-- ########################### --> <section><title>Set the root password</title> <body> <p>Before you forget, set the root password by typing:</p> <pre> # <i>passwd</i> </pre> </body> </section> <!-- ########################### --> <section><title>/etc/localtime</title> <body> <p>Look for your timezone (or GMT if you using Greenwich Mean Time) in <path>/usr/share/zoneinfo</path>. Then, make a symbolic link by typing:</p> <pre> # <i>ln -sf /usr/share/zoneinfo/path/to/timezonefile /etc/localtime</i> </pre> </body> </section> <!-- ########################### --> <section><title>/etc/hostname</title> <body> <p>Edit this file so that it contains your fully-qualified domain name on a single line, i.e. <c>mymachine.mydomain.com</c>. </p> </body> </section> <!-- ########################### --> <section><title>/etc/hosts</title> <body> <p>This file contains a list of ip addresses and their associated hostnames. It's used by the system to resolve the IP addresses of any hostnames that may not be in your nameservers. Here's a template for this file: </p><pre> 127.0.0.1 localhost <comment># the next line contains your IP for your local LAN, and your associated machine name</comment> 192.168.1.1 mymachine.mydomain.com mymachine </pre> </body> </section> <!-- ########################### --> <section><title>Final network configuration</title> <body> <p> Add the names of any modules that are necessary for the proper functioning of your system to <path>/etc/modules.autoload</path> file (you can also add any options you need to the same line.) When Gentoo Linux boots, these modules will be automatically loaded. Of particular importance is your ethernet card module, if you happened to compile it as a module: </p> <pre caption="/etc/modules.autoload"> 3c59x </pre> <warn>For those installing from existing distro, don't simply copy this file over as it may be loading modules you decided to build into the kernel. Review carefully before saving changes </warn> <p>Edit the <path>/etc/conf.d/net</path> script to get your network configured for your first boot: </p> <pre> # <i>nano -w /etc/conf.d/net</i> # <i>rc-update add net.eth0 default</i> </pre> <p> If you have multiple network cards you need to create additional <path>net.eth<comment>x</comment></path> scripts for each one (<comment>x</comment> = 1, 2, ...): </p> <pre caption="Multiple network interfaces"> # <i>cd /etc/init.d</i> # <i>cp net.eth0 net.eth<comment>x</comment></i> # <i>rc-update add net.eth<comment>x</comment> default</i> </pre> <p> If you have a PCMCIA card installed, have a quick look into /etc/init.d/pcmcia to verify that things seem all right for your setup, then add <pre> depend() { need pcmcia } </pre> on top of your <path>/etc/init.d/net.eth<comment>x</comment></path> file, for the pcmcia drivers to be autoloaded whenever your network is loaded. </p> </body> </section> <!-- ########################### --> <section><title>Configure basic settings</title> <body> <pre caption="basic configuration"> # <i>nano -w /etc/rc.conf</i> </pre> <p> Follow the directions in the file to configure the basic settings. </p> </body> </section> </chapter> <!-- ############################################################# ## Chapter 15 ## Configuring a Boot Loader ############################################################# --><chapter><title>Configuring a Boot Loader</title> <!-- ########################### --> <section><title>Overview</title> <body> <p>Before you can successfully boot to your new Gentoo installation, you must configure a boot loader by telling it where your Gentoo boot image file is and where Gentoo resides on your computer. The boot loader is the very first thing your computer will be looking for when you reboot your machine and its job is to simply direct the boot up process to the appropriate OS image file so that the specified operating system can begin to load and boot up.</p> <p>For those installing Gentoo via another distro and have Lilo as their current boot loader, you have the option of converting over to GRUB, or continuing to use Lilo as your boot loader. You will probably find Lilo easiest to get working in this senario as working boot loader and configuration file are readily available for configuring. See the next section, <uri link="#doc_chap15_sect2">Configuring Lilo</uri>.</p> <p>For those installing from CD, you are encouraged to use the GRUB boot loader as it has much better support for loading a variety of different operating systems as well as decoupling each operating system's boot image from the boot loader itself. This means that, unlike Lilo, you do not have to regenerate the boot images that are written to the MBR (Master Boot Record) each time you build a kernel. If you wish to use GRUB, then skip the Configuring Lilo section altogether and begin with <uri link="#doc_chap15_sect3">Configuring GRUB section below</uri>.</p> </body> </section> <!-- ########################### --> <section><title>Configuring Lilo</title> <body> <p>If you are installing from a current distro, then in all likelihood, you have lilo already installed as your current dual booter. If you currently use GRUB or if you are installing from CD, then skip on ahead to Configuring GRUB as this section is for installing from a current distro with Lilo as their current booter.</p> <p>Once your bzImage is built, you need to access your current distro's boot directory. The following will exit your gentoo console and allow you to copy the new bzImage to its appropriate location:</p> <pre> # <i> exit</i> <comment> // returns to your current distro's console</comment> # <i> cp /mnt/gentoo/boot/bzImage /boot/bzImage</i> </pre> <p>Now edit <path>/etc/lilo.conf</path> to add an entry for Gentoo, following the example set forth in your current lilo.conf. Alternatively, you can just do the following if you have installed Gentoo to <path>/dev/hda4</path> (just an example, use your real path!)</p> <pre> image=/boot/bzImage label=Gentoo root=<i>/dev/hda4</i> <comment>// set this to <i>your</i> Gentoo partition!</comment> </pre> <p>Finally, run Lilo to regenerate the boot image and write changes to the MBR:</p> <pre> # <i>lilo -v</i> </pre> <p>If you did everything correctly, lilo should have reported no errors and you should have seen your new Gentoo entry written to MBR. You are now set to choose Gentoo when you reboot.</p> <impo>If you rebuild your kernel at a later date, you must re-run lilo after copying the new bzImage file to the <path>/boot</path> directory.</impo> <p>After configuring Lilo, skip ahead to <uri link="#doc_chap16">Installation Complete!</uri></p> </body> </section> <!-- ########################### --> <section><title>Configuring GRUB</title> <body> <p> The most critical part of understanding GRUB is getting comfortable with how GRUB refers to hard drives and partitions. Your Linux partition <path>/dev/hda1</path> is called <path>(hd0,0)</path> under GRUB. Notice the parenthesis around the hd0,0 - they are required. Hard drives count from zero rather than "a", and partitions start at zero rather than one. So, <path>/dev/hdb3</path> gets translated to <path>(hd1,2)</path>, and <path>/dev/hdd7</path> gets translated to <path>(hd3,6)</path>. After you've gotten the feel for that, convert your boot and root partition names to the GRUB format and write them down. Now, it's time to install GRUB. </p> <note>You will find excellent documentation for GRUB at <uri>http://www.gnu.org/manual/grub-0.90/grub.html</uri> </note> <p>The easiest way to install grub is to simply type <c>grub</c> at your chrooted shell prompt: </p> <pre> # <i>grub</i> </pre> <p>You'll be presented with the <c>grub></c> grub command-line prompt. Now, you need to type in the right commands to install the GRUB boot record onto your hard drive. In my example configuration, I want to install the GRUB boot record on my hard drive's MBR (master boot record), so that the first thing I see when I turn on the computer is the GRUB prompt. In my case, the commands I want to type are:</p> <pre>grub> <i>root (hd0,0)</i> grub> <i>setup (hd0)</i> grub> <i>quit</i> </pre> <p>Here's how the two commands work. The first <c>root ( )</c> command tells GRUB the location of your boot partition (in our example, <path>/dev/hda1</path> or <path>(hd0,0)</path> in GRUB terminology. Then, the second <c>setup ( )</c> command tells GRUB where to install the boot record - it will be configure to look for its special files at the <c>root ( )</c> location that you specified. In my case, I want the boot record on the MBR of the hard drive, so I simply specify <path>/dev/hda</path> (also known as <path>(hd0)</path>). If I were using another boot loader and wanted to set up GRUB as a secondary boot-loader, I could install GRUB to the boot record of a particular partition. In that case, I'd specify a particular partition rather than the entire disk. Once the GRUB boot record has been successfully installed, you can type <c>quit</c> to quit GRUB. Gentoo Linux is installed, but we need to create the <path>/boot/grub/menu.lst</path> file so that we get a nice GRUB boot menu when the system reboots. Here's how to do it.</p> <p>Now, create the menu.lst file (<c>nano -w /boot/grub/menu.lst</c>), and add the following to it:</p> <pre> default 0 timeout 30 splashimage=(hd0,0)/boot/grub/splash.xpm.gz title=My example Gentoo Linux root (hd0,0) kernel /boot/bzImage root=/dev/hda3 <comment># Below needed only for people who dual-boot</comment> title=Windows NT Workstation root (hd0,5) chainloader +1 </pre> <note> The <path>menu.lst</path> file should end in "lst" as in "list", not "1st" as in "first". Also, (hd0,0) should be written without any spaces inside the parentheses. </note> <p>After saving this file, Gentoo Linux installation is complete. Selecting the first option will tell GRUB to boot Gentoo Linux without a fuss. The second part of the menu.lst file is optional, and shows you how to use GRUB to boot a bootable Windows partition.</p> <note>Above, <path>(hd0,0)</path> should point to your "boot" partition (<path>/dev/hda1</path> in our example config) and <path>/dev/hda3</path> should point to your root filesystem. <path>(hd0,5)</path> contains the NT boot loader.</note> <p>Also, if you need to pass any options to the kernel, simply add them to the end of the <c>kernel</c> command. We're already passing one option (<c>root=/dev/hda3</c>), but you can pass others as well. In particular, you can turn off devfs by default (not recommended unless you know what you're doing) by adding the <c>gentoo=nodevfs</c> option to the <c>kernel</c> command.</p> <note>Unlike in earlier versions of Gentoo Linux, you no longer have to add <c>devfs=mount</c> to the end of the <c>kernel</c> line to enable devfs. In rc6 devfs is enabled by default. </note> </body> </section> </chapter> <!-- ############################################################# ## Chapter 16 ## Installation Complete ############################################################# --><chapter><title>Installation Complete!</title> <!-- ########################### --> <section> <body> <p>Now, Gentoo Linux is installed. The only remaining step is to exit the chrooted shell, safely unmount your partitions and reboot the system:</p> <pre> # <i>exit</i> <codenote>This exits the chrooted shell; you can also type <c>^D</c></codenote> # <i>cd / </i> # <i>umount /mnt/gentoo/boot</i> # <i>umount /mnt/gentoo/proc</i> # <i>umount /mnt/gentoo</i> # <i>reboot</i> </pre> <note> After rebooting, it is a good idea to run the <c>update-modules</c> command to create the <path>/etc/modules.conf</path> file. Instead of modifying this file directly, you should generally make changes to the files in <path>/etc/modules.d</path>. </note> <p>If you have any questions or would like to get involved with Gentoo Linux development, consider joining our gentoo-user and gentoo-dev mailing lists (there's a "click to subscribe" link on our <uri link="http://www.gentoo.org">main page</uri>). </p> <p>If you wish to continue with installing X Windows, Sound, etc., then this <uri link="http://www.gentoo.org/doc/desktop.html">Desktop Guide</uri> will get you well on your way.</p> </body> </section> <!-- ########################### --> <section><title>Resources</title> <body> <p>To learn more about GRUB, visit <uri>http://www.gnu.org/manual/grub-0.90/grub.html</uri></p> <p>For more in-depth Linux installation (non-distro specific), you may wish to check out the following: <uri>http://www.linuxdocs.org/HOWTOs/HOWTO-INDEX/os.html</uri>.</p> <p>For in-depth review of Linux filesystems and each's strengths and weaknesses, visit <uri>http://www.gentoo.org/index-articles.html</uri>. You will also find other articles about Linux sub-systems here.</p> <p>You may also wish to visit <uri>http://www.zip.com.au/~akpm/linux/ext3/ext3-usage.html</uri> to find out more about using ext3 under Linux 2.4.</p> <p>You can find a whole community of Gentoo users and fans willing to help you with installation issues and troubleshooting on IRC at irc.opensourceprojects.net on the #gentoo channel. You can also subscribe to a mailing list just for new Gentoo users and those installing and configuring Gentoo at <uri link="http://lists.gentoo.org/mailman/listinfo/gentoo-newbies">Gentoo-Newbies</uri></p> </body> </section> </chapter> </guide>
View Attachment As Raw
Actions:
View
Attachments on
bug 1216
: 375