Die neue Boot CD startet von fast jedem modernen IDE CD-ROM Laufwerk, sowie von vielen SCSI CD-ROMs, vorausgesetzt Ihr CD-ROM-Laufwerk und BIOS unterstützt das Booten von CD. Die Installations CD-ROM unterstützt IDE Kontroller (inklusive PCI IDE Kontroller) (eingebaut im Kernel) sowie alle SCSI Geräte (über Kernelmodule). Zusätzlich stellt sie Module für buchstäblich jede Netzwerkkarte zur Verfügung die Linux unterstützt, sowie Tools die es ermöglichen, das Netzwerk zu konfigurieren sowie aus- und eingehende Verbindungen für
Um von der Installations CD zu installieren, wird ein 486+ Prozessor benötigt und idealerweise mindestens 64 Megabyte RAM. (Gentoo Linux konnte erfolgreich mit 64 MB RAM + 64 MB Swap installiert werden, aber die Installation unter diesen Bedingungen ist extrem langsam.)
Um die Installation zu starten, laden Sie zuerst eines unserer CD ISO Images von http://www.ibiblio.org/gentoo/releases/build/. Im Augenblick haben wir zwei CDs verfügbar. Unsere erste CD ist gentoo-ix86-1.2.iso. Dieses Image ist recht klein (16MB) und enthält ein minimales "chrootfähiges" Image (stage1-ix86-1.2.tbz2) -- alles was Sie benötigen um ein Gentoo Linux System von Grund auf aufzubauen. (Die Quelldateien werden dabei automatisch aus dem Internet geladen.) Unsere zweite CD ist gentoo-i686-1.2.iso. Dieses Image ist etwas größer (100+MB) -- Es enthält das gleiche Material wie auf unserem 16MB Image, plus einem vorkompiliertem i686 Basissystem (stage3-i686-1.2.tbz2) sowie ein teilweise kompiliertes i686 Basissystem (stage2-i686-1.2.tbz2) in TAR-Archiven. Die beiden neuen TAR-Archive benötigen einen Pentium Pro oder besser (auf einem K6-System und niedriger nicht einsetzbar). Wenn Sie ein i686+ System verwenden und nicht alles von Grund auf neu kompilieren wollen, können Sie damit die Installationsdauer von Gentoo Linux deutlich verkürzen.
Gentoo Linux kann über drei "stage" tar Dateien installiert werden. Welche der drei Dateien Sie auswählen sollten, hängt davon ab, wieviel von Ihrem System Sie selbst kompilieren möchten. Das stage1 Tar-Archiv wird verwendet, wenn Sie einen bootstrap durchführen wollen, also ihr gesamtes System inklusive Kompiler selbst übersetzen wollen. Stage2 wird verwendet, um das gesamte System auf Basis eines bereits für Sie durchgeführten bootstrappings zu installieren. Stage3 enthält ein einfaches Basis Gentoo Linux System.
Sollten Sie also mit stage1, stage2 oder stage3 beginnen? Von stage1 zu beginnen erlaubt Ihnen vollkommene Kontrolle über Optimierungen und optionale Erweiterungen, die auf Ihrem System dann von Anfang an aktiviert sind. Stage1 ist daher gut geeignet für Power-User, die wissen was sie tun. Stage2 Installationen erlauben Ihnen hingegen, den bootstrap Vorgang zu überspringen - was absolut kein Problem darstellt, falls sie an den von uns voreingestellten Optimierungen des stage files nichts auszusetzen haben. Die Auswahl eines stage3 Archivs erlaubt die zügigste Installation eines Gentoo Linux, bedeutet allerdings auch, daß Ihr Basissystem mit den Optimierungseinstellungen konfiguriert ist, die wir für Sie ausgewählt haben. Da bei "major releases" von Gentoo Linux aber verschiedene, speziell für diverse gebräuchliche Prozessoren optimierte stage3 Archive zur Verfügung gestellt werden, kann dies auch durchaus für Sie ausreichend sein. Sollen Sie Gentoo Linux zum ersten Mal installieren, dann sollten Sie sich überlegen, vielleicht ein stage3 Archiv zu verwenden.
Wie beginnt also jetzt der Installationsvorgang? Zuerst sollten Sie sich für eines der LiveCD ISO Images von
Die LiveCDs sind komplette CD Imagedateien die mit einer Brennsoftware auf CDR oder CD-RW Medien gebrannt werden sollten. Zum aktuellen Zeitpunkt gibt es zwei LiveCD varianten. Die erste namens "gentoo-basic" ist etwa 40 MB groß und enthält nur eine stage1 Archivdatei. Sie finden Sie im
Die zweite LiveCD Variante, die wir zur Zeit anbieten, nennt sich "gentoo-3stages." Die CD befindet sich ebenso unter
Sollten Sie sich fragen, was mit den i686, pentium3, athlon, athlon-mp stages, LiveCDs und GRP (Gentoo Reference Platform) passiert ist... - Gentoo 1.4_rc4 ist nur als ein relativ rudimentäre Vorabversion (Release Candidate) gedacht. 1.4_final wird (wieder) stages für all die üblichen x86 Architekturen und GRP enthalten. Sollten Sie stages, die für solche anderen x86 Architekturen optimiert sind, oder GRP verwenden wollen, dann verwenden Sie die 1.4_rc2 Dokumentation, die sie unter
Lassen Sie uns jetzt noch ein mal kurz den Installationsprozess skizzieren: Zuerst laden Sie eine LiveCD, brennen und booten sie. Nachdem Sie sich als root angemeldet haben, erstellen Sie Partitionen und legen Dateisysteme an, entpacken entweder eine stage1, stage2 oder stage3 Archivdatei. Falls Sie stage1 oder stage2 verwenden, vollziehen Sie die notwendigen Schritte um das System auf den Stand von stage3 zu bringen. Sobald Ihr System stage3 erreicht hat, können Sie es konfigurieren (Konfigurationsdateien anpassen, einen boot loader installieren etc), booten und Sie haben ein volll funktionsfähiges Gentoo Linux System. Abhängig von der gewählten Installationsstufe, von der Sie starten, hier die benötigten Schritte:
stage tarball | requirements for installation |
---|---|
Beginnen Sie mit dem Booten der LiveCD. Sie sollten einen tollen Boot-Bildschrim mit dem Gentoo Linux Logo sehen. Start by booting the LiveCD. Hier können Sie Enter drücken um den Startvorgang zu beginnen, oder aber die LiveCD mit eigenen Bootoptionen starten, indem Sie den Kernel gefolgt von Bootoptionen eingeben und Enter drücker. Beispielsweise
Verfügbare kernel. | Beschreibung |
---|---|
Verfügbare Bootoptionen. | Beschreibung |
---|---|
Sobald Sie Enter gedrückt haben, begrüßt Sie die Bootausgabe des Standard Kernels, d.h. der
kernel und initrd Nachrichten, gefolgt von der normalen Gentoo Linux Bootsequenz. Sie werden automatisch als "
Wahrscheinlich haben Sie auch schon bemerkt, daß oberhalb Ihres
Sollte die PCI Autoerkennung einen Teil Ihrer Hardware übersehen haben,
dann müssen Sie die passenden Kernelmodule von Hand nachladen.
Um eine Liste mit verfügbaren Modulen für Netzwerkkarten anzuzeigen, tippen Sie
#modprobe pcnet32 (ersetzen Sie pcnet32 durch ein passendes Modul für ihre Netzwerkkarte)
Genauso gehen Sie vor, falls Sie auf SCSI Geräte, die während der Bootphase nicht erkannt wurden, zugreifen wollen. Sie müssen dann die passenden Module aus /lib/modules laden, und zwar wieder mittels
#modprobe aic7xxx (ersetzen Sie aic7xxx mit Ihrem SCSI-Adapter Modul) #modprobe sd_mod (sd_mod ist das Modul für die SCSI Festplatten Unterstützung)
Sollten Sie ein Hardware RAID verwenden, dann müssen Sie die ATA-RAID Module für Ihren RAID Kontroller laden.
#modprobe ataraid #modprobe pdcraid (Promise Raid Controller) #modprobe hptraid (Highpoint Raid Controller)
Die Gentoo LiveCD sollte normalerweise DMA für Ihre Festplatten aktiviert haben, falls nicht, dann kann
Ersetzen Sie hdX mit dem Gerätenamen Ihrer Festplatte. # hdparm -d 1 /dev/hdXAktiviert DMA # hdparm -d1 -A1 -m16 -u1 -a64 /dev/hdX(Aktiviert DMA und andere sichere, die Performance erhöhende Einstellungen) # hdparm -X66 /dev/hdX(Erzwingt die Aktivierung von Ultra-DMA -- gefährlich -- dies kann einige Geräte total verkonfigurieren!)
Falls Sie eine 1.4_rc3 (oder größer) LiveCD verwenden, dann kann es sein, daß Ihre Netzwerkkonfiguration schon
automatisch für Sie vorgenommen wurde. Falls dies der Fall ist, dann sollten Sie die vielen netzwerkfähigen Programme der
LiveCD wie
Falls Ihre Netzwerkanbindung für Sie konfiguriert wurde, dann sollte der
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
Sie sollten vielleicht auch versuchen, den DNS Server Ihres Providers zu pingen (dieser findet sich
nach erfolgreicher Autokonfiguration in
#ping -c 3 www.yahoo.com
Können Sie ihr Netzwerk jetzt bereits verwenden? Falls ja, dann können Sie den Rest dieses Abschnitts überspringen.
Vorausgesetzt, sie benötigen PPPoE um ins Internet zu kommen, dann macht es Ihnen die LiveCD
relativ einfach denn (jede Version) enthält bereits
#adsl-setup #adsl-start
Sollte etwas schiefgehen, dann prüfen Sie genau, ob Sie Ihren Benutzernamen und das Passwort wirklich
korrekt angegeben haben. Das können Sie durch Öffnen von
Am einfachsten können Sie ihr Netzwerk durch The simplest way to set up networking if it didn't get configured automatically is to run the
#net-setup eth0
Natürlich können Sie Ihr Netzwerk aber auch wie im Folgenden beschrieben, manuell einrichten.
Die Netzwerkkonfiguration mittels DHCP ist einfach; sollte Ihr Provider kein DHCP verwenden, springen Sie zum Abschnitt über statische Konfiguration weiter unten.
#dhcpcd eth0
Sollten Sie irgendwelche dhcpConfig Warnmeldungen sehen, dann keine Panik, diese Fehlermeldungen sind höchst wahrscheinlich nur kosmetischer Natur. Springen Sie zum Abschnitt über den Netzwerktest weiter unten.
Als nächsten Schritt müssen wir Ihr Netzwerk zumindest so weit einrichten, daß die Quellen für
die Installation heruntergeladen werden können. Tippen Sie die folgenden Befehle ab und ersetzen Sie
$IFACE durch Ihr Netzwerkinterface (normalerweise ist das
#ifconfig $IFACE $IPNUM broadcast $BCAST netmask $NMASK #/sbin/route add -net default gw $GTWAY netmask 0.0.0.0 metric 1
Nun wird es Zeit die
Dies ist eine Vorlage, die Sie verwenden können, um Ihre /etc/resolv.conf Datei anzulegen:
domain meinedomaene.de nameserver 10.0.0.1 nameserver 10.0.0.2
Ersetzen Sie
Sollten Sie hinter einem Proxy sein, dann müssen Sie diesen erst einrichten, bevor Sie fortfahren können. Um den Proxy entsprechend einzutragen, werden einige Shell Variablen exportiert.
#export http_proxy="machine.company.com:1234" #export ftp_proxy="$http_proxy" #export RSYNC_PROXY="$http_proxy"
Die Netzwerkverbindung sollte jetzt eingerichtet und verwendbar sein. Sie sollten die auf der LiveCD enthaltenen
Programme
Als nächstes müssen Sie das Datum und die Zeit ihres Systems einstellen. Dies können Sie mit Hilfe des
#date Thu Feb 27 09:04:42 CST 2003(Sollte ihr Datum nicht korrekt sein, dann setzen Sie es mit Hilfe des nächsten Befehls) #date 022709042003 (date MMDDhhmmCCYY)
In diesem Abschnitt werden wir einen Blick auf die Festplatten-bezogenen Aspekte von Gentoo Linux und Linux allgemein werfen. Dies beinhaltet Dateisysteme, Partitionen und Geräte (block devices). Sobald Sie mit dem Thema Festplatten und Dateisysteme vertraut sind, werden wir Sie durch den Einrichtungsprozess von Partitionen und Dateisystemen ihrer Gentoo Linux Installation führen.
Um loszulegen, wollen wir uns "block devices" ansehen. Das bekannteste "block device" is wahrscheinlich das, das die erste IDE Festplatte in einem Linux System bezeichnet:
/dev/hda
Sollten Sie SCSI verwenden, dann ist Ihre erste Festplatte:
/dev/sda
Die oben aufgeführten block devices repräsentieren ein abstraktes Interface zu Ihrer Festplatte. Benutzerprogramme können diese block devices verwenden, um mit ihrer Festplatte zu interagieren, ohne sich darüber Gedanken machen zu müssen, ob es eine IDE, SCSI oder sonst eine Platte ist. Das Programm kann einfach den Speicher auf der Festplatte als eine zusammenhängende Menge von zufällig, also per random-access, zugreifbaren 512-Byte großen Blöcken ansprechen.
Unter Linux werden Dateisysteme durch einen besonderen Befehl namens
Obwohl es theoretisch möglich wäre, eine "komplette Festplatte" als Blockdevice
(eines das die gesamte Festplatte repräsentiert) wie
Wie können uns die Partitionstabelle durch Ausführen von
# fdisk /dev/hda
oder
# fdisk /dev/sda
Sobald Sie sich in fdsik befinden, begrüßt Sie ein Prompt, der in etwa so aussieht:
Command (m for help):
Tippen Sie jetzt
Command (m for help): p Disk /dev/hda: 240 heads, 63 sectors, 2184 cylinders Units = cylinders of 15120 * 512 bytes Device Boot Start End Blocks Id System /dev/hda1 1 14 105808+ 83 Linux /dev/hda2 15 49 264600 82 Linux swap /dev/hda3 50 70 158760 83 Linux /dev/hda4 71 2184 15981840 5 Extended /dev/hda5 71 209 1050808+ 83 Linux /dev/hda6 210 348 1050808+ 83 Linux /dev/hda7 349 626 2101648+ 83 Linux /dev/hda8 627 904 2101648+ 83 Linux /dev/hda9 905 2184 9676768+ 83 Linux Command (m for help):
Die Festplatte dieses beispiels ist so eingerichtet, daß sie sieben Linux Dateisysteme enthält (jedes davon auf einer entsprechenden, als "Linux" aufgeführten Partition) außerdem enthält es eine Swap-Partition (aufgeführt als "Linux Swap").
Beachten Sie auch die zugehörigen Partitions-Blockdevices links, beginnend mit
Alle Partitionen ab
In unserem Beispiel sind folglich
Beachten Sie außerdem, daß jede Partition eine "Id" besitzt, die auch als "Partitionstyp"
bezeichnet wird. Jedes Mal wenn Sie eine neue Partition anöegen, sollten Sie darauf achten,
daß auch der Partitionstyp richtig gesetzt ist. '83' ist der richtige Typ für Partitionen,
die ein Linuxdateisystem enthalten und '82' ist der korrekty Typ für Linux Swap Partitionen.
Den Partitionstyp setzen Sie durch den
Nachdem Sie nun Ihre Einführung hatten, wie die Partitionsverwaltung unter Linux erfolgt, wird es Zeit, schnell den Prozess wie Sie ihre Festplattenpartitionen für Gentoo Linux einrichten, durchzugehen. Nachdem wir durchgesprochen haben, wie Partitionen auf Ihrer Festplatte angelegt werden, wird Ihre Partitionskonfiguration etwa so aussehen:
Disk /dev/hda: 30.0 GB, 30005821440 bytes 240 heads, 63 sectors/track, 3876 cylinders Units = cylinders of 15120 * 512 = 7741440 bytes Device Boot Start End Blocks Id System /dev/hda1 * 1 14 105808+ 83 Linux /dev/hda2 15 81 506520 82 Linux swap /dev/hda3 82 3876 28690200 83 Linux Command (m for help):
In unserem empfohlenen Partitionsschema für "newbies" verwenden wir drei Partitionen.
Die erste (
Es wird empfohlen, die Bootpartitionen am Anfang der Festplatte einzurichten. Obwohl das jetzt nicht mehr unbedingt notwendig ist, ist es eine gebräuchliche Tradition aus den Tagen, als der LILO Bootloader noch keine Kernel jenseits des Festplattenzylinders 1024 laden konnte.
Die zweite Partition (
Die dritte Partition (
Bevor wir gleich loslegen und die Festplatte partitionieren, sehen Sie hier noch eine technische Übersicht über die vorgeschlagenen Partitionen und die Einrichtung von Dateisystemen für die Installation von Gentoo Linux:
Partition | Größe | Typ | Beispiel device |
---|---|---|---|
Gut, legen wir also die Partitionen, wie im Beispiel und der obigen Tabelle
beschrieben, an. Zuerst öffnen wir fdisk durch Eingabe von
Löschen wir also alle bestehenden Partitionen. Dazu tippen Sie
Command (m for help): d Partition number (1-4): 1
Die Partition wird zum Löschen vorgemerkt. Sie wird nicht mehr angezeigt, wenn
Sie
Nehmen wir aber an, Sie willen wirklich alle Partitionen auf Ihrem System löschen,
dann geben Sie mehrfach
Disk /dev/hda: 30.0 GB, 30005821440 bytes 240 heads, 63 sectors/track, 3876 cylinders Units = cylinders of 15120 * 512 = 7741440 bytes Device Boot Start End Blocks Id System Command (m for help):
Nachdem die, noch im Speicher befindliche, Partitionstabelle leer ist,
können wir jetzt eine Bootpartition anlegen. Dazu geben Sie
Command (m for help): n Command action e extended p primary partition (1-4) p Partition number (1-4): 1 First cylinder (1-3876, default 1): Using default value 1 Last cylinder or +size or +sizeM or +sizeK (1-3876, default 3876): +100M
Wenn Sie jetzt
Command (m for help): p Disk /dev/hda: 30.0 GB, 30005821440 bytes 240 heads, 63 sectors/track, 3876 cylinders Units = cylinders of 15120 * 512 = 7741440 bytes Device Boot Start End Blocks Id System /dev/hda1 1 14 105808+ 83 Linux
Next, let's create the swap partition. To do this, type
Command (m for help): p Disk /dev/hda: 30.0 GB, 30005821440 bytes 240 heads, 63 sectors/track, 3876 cylinders Units = cylinders of 15120 * 512 = 7741440 bytes Device Boot Start End Blocks Id System /dev/hda1 1 14 105808+ 83 Linux /dev/hda2 15 81 506520 82 Linux swap
Finally, let's create the root partition. To do this, type
Command (m for help): p Disk /dev/hda: 30.0 GB, 30005821440 bytes 240 heads, 63 sectors/track, 3876 cylinders Units = cylinders of 15120 * 512 = 7741440 bytes Device Boot Start End Blocks Id System /dev/hda1 1 14 105808+ 83 Linux /dev/hda2 15 81 506520 82 Linux swap /dev/hda3 82 3876 28690200 83 Linux
Finally, we need to set the "bootable" flag on our boot partition and then write
our changes to disk. To tag
Now that the partitions have been created, it's time to set up filesystems on the boot and root partitions so that they can be mounted and used to store data. We will also configure the swap partition to serve as swap storage.
Gentoo Linux supports a variety of different types of filesystems; each type has its strengths and weaknesses and its own set of performance characteristics. Currently, we support the creation of ext2, ext3, XFS, JFS and ReiserFS filesystems.
ext2 is the tried and true Linux filesystem but doesn't have metadata journaling, which means that routine ext2 filesystem checks at startup time can be quite time-consuming. There is now quite a selection of newer-generation journaled filesystems that can be checked for consistency very quickly and are thus generally preferred over their non-journaled counterparts. Journaled filesystems prevent long delays when you boot your system and your filesystem happens to be in an inconsistent state.
ext3 is the journaled version of the ext2 filesystem, providing metadata journaling for fast recovery in addition to other enhanced journaling modes like full data and ordered data journaling. ext3 is a very good and reliable filesystem. It offers generally decent performance under most conditions. Because it does not extensively employ the use of "trees" in its internal design, it doesn't scale very well, meaning that it is not an ideal choice for very large filesystems, or situations where you will be handling very large files or large quantities of files in a single directory. But when used within its design parameters, ext3 is an excellent filesystem.
ReiserFS is a B*-tree based filesystem that has very good overall performance and greatly outperforms both ext2 and ext3 when dealing with small files (files less than 4k), often by a factor of 10x-15x. ReiserFS also scales extremely well and has metadata journaling. As of kernel 2.4.18+, ReiserFS is now rock-solid and highly recommended for use both as a general-purpose filesystem and for extreme cases such as the creation of large filesystems, the use of many small files, very large files, and directories containing tens of thousands of files. ReiserFS is the filesystem we recommend by default for all non-boot partitions.
XFS is a filesystem with metadata journaling that is fully supported under
Gentoo Linux's
JFS is IBM's own high performance journaling filesystem. It has recently become production-ready, and there hasn't been a sufficient track record to comment either positively nor negatively on its general stability at this point.
If you're looking for the most rugged journaling filesystem, use ext3. If you're looking for a good general-purpose high-performance filesystem with journaling support, use ReiserFS; both ext3 and ReiserFS are mature, refined and recommended for general use.
Based on our example above, we will use the following commands to initialize all our partitions for use:
# mke2fs -j /dev/hda1 # mkswap /dev/hda2 # mkreiserfs /dev/hda3
We choose ext3 for our
For your reference, here are the various
#mkswap /dev/hda2
You can use the
# mke2fs /dev/hda1
If you would like to use ext3, you can create ext3 filesystems using
#mke2fs -j /dev/hda3
To create ReiserFS filesystems, use the
#mkreiserfs /dev/hda3
To create an XFS filesystem, use the
#mkfs.xfs /dev/hda3
To create JFS filesystems, use the
#mkfs.jfs /dev/hda3
Now, we will activate our newly-initialized swap volume, since we may need the additional virtual memory that it provides later:
#swapon /dev/hda2
Next, we will create the
#mkdir /mnt/gentoo #mount /dev/hda3 /mnt/gentoo #mkdir /mnt/gentoo/boot #mount /dev/hda1 /mnt/gentoo/boot
Now, you need to decide which one you would like to use as a basis for the install if you haven't already.
If you are using the "from scratch, build everything" install
method, you will want to use the
If you would like to perform an install using a stage tarball that is not on your CD , this is still possible, but you'll need to download the stage you want using the following instructions. If you already have the stage tarball you want to use (most users), then proceed to the "Extracting the stage tarball" section.
#cd /mnt/gentoo Use lynx to get the URL for your tarball: #lynx http://www.ibiblio.org/pub/Linux/distributions/gentoo/releases/1.4_rc4/x86/ Use #Up andDown arrows keys (or theTAB key) to go to the right directory Highlight the appropriate stage you want to download Pressd which will initiate the download Save the file and quit the browser OR use wget from the command line:wget insert URL to the required stage tarball here.
Now it is time to extract the compressed stage tarball of your choice to
#cd /mnt/gentoo Change "stage3" to "stage2" or "stage1" if you want to start from these stages instead. If you downloaded your stage tarball, change the path below to begin with "/mnt/gentoo/" instead of "/mnt/cdrom/gentoo/". #tar -xvjpf /mnt/cdrom/gentoo/stage3-*.tar.bz2
If you downloaded your stage tarball to
Next, we will
#mount -t proc proc /mnt/gentoo/proc #cp /etc/resolv.conf /mnt/gentoo/etc/resolv.conf #chroot /mnt/gentoo /bin/bash #env-update Regenerating /etc/ld.so.cache... #source /etc/profile (The above points your shell to the new paths and updated binaries.)
After you execute these commands, you will be "inside" your new Gentoo Linux environment in
Now, you will need to run
#emerge sync
Now that you have a working copy of the Portage tree, it is time to
customize the optimization and optional build-time settings to use on your
Gentoo Linux system. Portage will use these settings when compiling any
programs for you. To do this, edit the file
You also should set appropriate
If necessary, you can also set proxy information here if you are behind a
firewall. Use the following command to edit
#nano -w /etc/make.conf (Edit CHOST, CFLAGS, CXXFLAGS and any necessary USE or proxy settings)
The stage1 tarball is for complete customization and optimization. If you have picked this tarball, you are most likely looking to have an uber-optimized and up-to-date system. Have fun, because optimization is what Gentoo Linux is all about! Installing from a stage1 takes a lot of time, but the result is a system that has been optimized from the ground up for your specific machine and needs.
Now, it is time to start the "bootstrap" process. This process takes about two hours on my 1200MHz AMD Athlon system. During this time, the GNU C library, compiler suite and other key system programs will be built. Start the bootstrap as follows:
#cd /usr/portage #scripts/bootstrap.sh
The "bootstrap" process will now begin.
#export PORTAGE_TMPDIR="/otherdir/tmp"
The stage2 tarball already has the bootstrapping done for you. All that you have to do is install the rest of the system.
#emerge -p system (lists the packages to be installed) #emerge system
It is 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.
Building is now complete. Go ahead and skip down to the "Setting your time zone" section.
The stage3 tarball provides a fully-functional basic Gentoo system, so no building is required. However, since the stage3 tarball is pre-built, it may be slightly out-of-date. If this is a concern for you, you can automatically update your existing stage3 to contain the most up-to-date versions of all system packages by performing the following steps. Note that this could take a long time if your stage3 is very old; otherwise, this process will generally be quick and will allow you to benefit from the very latest Gentoo updates and fixes. In any case, feel free to skip these steps and proceed to the next section if you like.
#export CONFIG_PROTECT="-*" #emerge -up system (lists the packages that would be installed) #emerge -u system (actually merges the packages) #unset CONFIG_PROTECT
Now you need to set your time zone.
Look for your time zone (or GMT if you are using Greenwich Mean Time)
in
#ln -sf /usr/share/zoneinfo/path/to/timezonefile /etc/localtime
You now need to merge Linux kernel sources. Here are the ones we currently offer:
ebuild | description |
---|---|
Choose a kernel and then merge as follows:
#emerge sys-kernel/gentoo-sources
Once you have a Linux kernel source tree available, it is time to compile your own custom kernel.
Please note that
#cd /usr/src/linux #make menuconfig #make dep && make clean bzImage modules modules_install #cp /usr/src/linux/arch/i386/boot/bzImage /boot
Code maturity level options ---> [*] Prompt for development and/or incomplete code/drivers"(You need this to enable some of the options below.) ... File systems ---> <*> Reiserfs support(Only needed if you are using reiserfs.) ... <*> Ext3 journalling file system support(Only needed if you are using ext3.) ... [*] Virtual memory file system support (former shm fs)(Required for Gentoo Linux.) ... <*> JFS filesystem support(Only needed if you are using JFS.) ... [*] /proc file system support(Required for Gentoo Linux.) [*] /dev file system support (EXPERIMENTAL) [*] Automatically mount at boot(Required for Gentoo Linux.) [ ] /dev/pts file system for Unix98 PTYs(Uncheck this, it is NOT needed.) ... <*> Second extended fs support(Only needed if you are using ext2.) ... <*> XFS filesystem support(Only needed if you are using XFS.)
If you are using hardware RAID you will need to enable a couple more options in the kernel: For Highpoint RAID controllers select hpt366 chipset support, support for IDE RAID controllers and Highpoint 370 software RAID.For Promise RAID controllers select PROMISE PDC202{46|62|65|67|68|69|70} support, support for IDE RAID controllers and Support Promise software RAID (Fasttrak(tm))
If you use PPPoE to connect to Internet, you will need the following options in the kernel (built-in or as preferably as modules) : "PPP (point-to-point protocol) support", "PPP support for async serial ports", "PPP support for sync tty ports". The two compression options won't harm but are not definitely needed, neither does the "PPP over Ethernet" option, that might only be used by rp-pppoe when configured to do kernel mode PPPoE.
If you have an IDE cd burner, then you need to enable SCSI emulation in the
kernel. Turn on "ATA/IDE/MFM/RLL support" ---> "IDE, ATA and ATAPI Block
devices" ---> "SCSI emulation support" (I usually make it a module), then
under "SCSI support" enable "SCSI support", "SCSI CD-ROM support" and
"SCSI generic support" (again, I usually compile them as modules). If you
also choose to use modules, then
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 msyslog and syslog-ng as well as metalog. Power users seem
to gravitate away from sysklogd (not very good performance) and towards the
newer alternatives.
If in doubt, you may want to try metalog, since it seems to be quite popular.
To merge your logger of choice, type
#emerge app-admin/sysklogd #rc-update add sysklogd default or #emerge app-admin/syslog-ng #rc-update add syslog-ng default or #emerge app-admin/metalog #rc-update add metalog default or #emerge app-admin/msyslog #rc-update add msyslog default
Now, you may optionally choose a cron package that you would like to use. Right now, we offer dcron, fcron and vcron. If you do not know which one to choose, you might as well grab vcron. They can be installed as follows:
#emerge sys-apps/dcron #rc-update add dcron default #crontab /etc/crontab or #emerge sys-apps/fcron #rc-update add fcron default #crontab /etc/crontab or #emerge sys-apps/vcron #rc-update add vcron default You do not need to run crontab /etc/crontab if using vcron.
For more information on starting programs and daemons at startup, see the
If you need rp-pppoe to connect to the net, be aware that at this point it has not been installed. It would be the good time to do it.
#USE="-X" emerge rp-pppoe
You may need to install some additional packages in the Portage tree
if you are using any optional features like XFS, ReiserFS or LVM. If you're
using XFS, you should emerge the
#emerge sys-apps/xfsprogs If you would like to use ReiserFS, you should emerge the ReiserFS tools: #emerge sys-apps/reiserfsprogs If you would like to use JFS, you should emerge the JFS tools: #emerge jfsutils If you're using LVM, you should emerge the #lvm-user package:emerge sys-apps/lvm-user
If you're a laptop user and wish to use your PCMCIA slots on your first real reboot, you will want to make sure you install the pcmcia-cs package.
#emerge sys-apps/pcmcia-cs
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 boot loader.
The first file we need to
configure is
Use something like the
# /etc/fstab: static file system information. # # noatime turns off atimes for increased performance (atimes normally aren't # needed; notail increases performance of ReiserFS (at the expense of storage # efficiency). It is safe to drop the noatime options if you want and to # switch between notail and tail freely. # <fs> <mount point> <type> <opts> <dump/pass> # NOTE: If your BOOT partition is ReiserFS, add the notail option to opts. /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
Before you forget, set the root password by typing:
#passwd
You will also want to add a non-root user for everyday use. Please consult
the
Edit this file so that it contains your fully-qualified domain name on a single line,
i.e.
#echo mymachine.mydomain.com > /etc/hostname
This file contains a list of IP addresses and their associated hostnames. It is used by the system to resolve the IP addresses of any hostnames that may not be in your nameservers. Here is a template for this file:
127.0.0.1 localhost# the next line contains your IP for your local LAN, and your associated machine name 192.168.1.1 mymachine.mydomain.com mymachine
Add the names of any modules that are necessary for the proper functioning of your system to
This is assuming that you are using a 3com card. Check 3c59x/lib/modules/`uname -r`/kernel/drivers/net for your card.
Edit the
#nano -w /etc/conf.d/net #rc-update add net.eth0 default
If you have multiple network cards you need to create additional
#cd /etc/init.d #cp net.eth0 net.eth #x rc-update add net.eth x default
If you have a PCMCIA card installed, have a quick look into
depend() { need pcmcia }
This makes sure that the PCMCIA drivers are autoloaded whenever your network is loaded.
#nano -w /etc/rc.conf
Follow the directions in the file to configure the basic settings.
All users will want to make sure that
In the spirit of Gentoo, users now have more than one bootloader to choose from. Using our virtual package system, users are now able to choose between both GRUB and LILO as their bootloaders.
Please keep in mind that having both bootloaders installed is not necessary. In fact, it can be a hindrance, so please only choose one.
The most critical part of understanding GRUB is getting comfortable with how GRUB
refers to hard drives and partitions. Your Linux partition
The easiest way to install GRUB is to simply type
#emerge grub #grub
You will be presented with the
grub>root (hd0,0) Your boot partition grub>setup (hd0) Where the boot record is installed, here, it is the MBR
Alternatively, if you wanted to install the bootloader somewhere other than the MBR grub>root (hd0,0) Your boot partition grub>setup (hd0,4) Where the boot record is installed, here it is /dev/hda5 grub>quit
Here is how the two commands work. The first
Gentoo Linux is now
installed, but we need to create the
Now, create the grub.conf file (
default 0 timeout 30 splashimage=(hd0,0)/boot/grub/splash.xpm.gz title=My example Gentoo Linux root (hd0,0) kernel (hd0,0)/boot/bzImage root=/dev/hda3# Below is for setup using hardware RAID title=My Gentoo Linux on RAID root (hd0,0) kernel (hd0,0)/boot/bzImage root=/dev/ataraid/dXpY# Below needed only for people who dual-boot title=Windows XP root (hd0,5) chainloader (hd0,5)+1
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 grub.conf file is optional, and shows you how to use GRUB to boot a bootable Windows partition.
If you need to pass any additional options to the kernel, simply
add them to the end of the
While GRUB may be the new alternative for most people, it is not always the best choice. LILO, the LInuxLOader, is the tried and true workhorse of Linux bootloaders. Here is how to install LILO if you would like to use it instead of GRUB:
The first step is to emerge LILO:
#emerge lilo
Now it is time to configure LILO. Here is a sample configuration file
boot=/dev/hda map=/boot/map install=/boot/boot.b prompt timeout=50 lba32 default=linux image=/boot/vmlinuz-2.4.20 label=linux read-only root=/dev/hda3 #For dual booting windows/other OS other=/dev/hda1 label=dos
After you have edited your lilo.conf file, it is time to run LILO to load the information into the MBR:
#/sbin/lilo
LILO is configured, and now your machine is ready to boot into Gentoo Linux!
It is always a good idea to make a boot disk the first
time you install any Linux distribution. This is a security
blanket, and generally not a bad thing to do. If you are using some kinds of hardware RAID, you may
#mke2fs /dev/fd0 #mount /dev/fd0 /mnt/floppy #mkdir -p /mnt/floppy/boot/grub #cp /usr/share/grub/i386-pc/stage1 /mnt/floppy/boot/grub/ #cp /usr/share/grub/i386-pc/stage2 /mnt/floppy/boot/grub/ #umount /mnt/floppy #grub grub>root (fd0) grub>setup (fd0) grub>quit
Now reboot and load the floppy. At the floppy's
If you are using LILO, it is also a good idea to make a bootdisk:
#dd if=/boot/your_kernel of=/dev/fd0 This will only work if your kernel is smaller than 1.4MB
Now, Gentoo Linux is installed. The only remaining step is to update necessary configuration files, exit the chrooted shell, safely unmount your partitions and reboot the system:
#etc-update #exit (This exits the chrooted shell; you can also type #^D )cd / #umount /mnt/gentoo/boot #umount /mnt/gentoo/proc #umount /mnt/gentoo #reboot
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
(more information on our
The Gentoo Linux usage statistics program was started as an attempt to give the developers
a way to find out about their user base. It collects information about Gentoo Linux usage to help
us in set priorities our development. Installing it is completely optional, and it would be greatly
appreciated if you decide to use it. Compiled statistics can be viewed at
The gentoo-stats server will assign a unique ID to your system. This ID is used to make sure that each system is counted only once. The ID will not be used to individually identify your system, nor will it be matched against an IP address or other personal information. Every precaution has been taken to assure your privacy in the development of this system. The following are the things that we are monitoring right now through our "gentoo-stats" program:
We are aware that disclosure of sensitive information is a threat to most Gentoo Linux users (just as it is to the developers).
The installation is easy - just run the following commands:
#emerge gentoo-stats Installs gentoo-stats #gentoo-stats --new Obtains a new system ID
The second command above will request a new system ID and enter it into
After that, the program should be run on a regular schedule
(gentoo-stats does not have to be run as root). Add this line to your
0 0 * * 0,4 /usr/sbin/gentoo-stats --update > /dev/null
The