Search:  
Gentoo Wiki

HOWTO_Install_Gentoo_Quick_Reference


This article is part of the HOWTO series.
Installation Kernel & Hardware Networks Portage Software System X Server Gaming Non-x86 Emulators Misc

Contents

Introduction

After installing Gentoo on many systems, using the Gentoo Linux x86 Handbook can get a little annoying. It's an excellent document, especially for beginners, but it's a little outdated in some places, and gets side-tracked a little in other places. Also, it consists of many pages and is hard to read in a text-only browser which may be all you have while you're installing.

This Wiki page attempts to bypass all the fluff that's in other installation documentation. It's meant for people who've seen and done Gentoo installs before (possibly many times), who probably just want a quick reference on one page that they can keep open in Links on a second virtual terminal while installing. Needless to say, Do not use this page if you've never installed Gentoo before or if you have little experience with Linux. The page pretty much assumes that you know what you're doing; if something goes wrong, you're on your own.

Overview

This guide concentrates on getting your system up and running with as little effort as possible; we will install a minimum amount of tools before we reboot from the harddisk (and we'll stop there!).

This is what we'll do:

Booting the System, Initializing and Mounting the Harddisk

Boot from a Gentoo CD-ROM. Pretty much any version that runs a 2.6 kernel will do (if you try to use a 2.4 kernel, the chroot will fail). ISO files for the latest minimal Gentoo CD-ROM should be available from:

 http://<your-mirror>/releases/x86/current/installcd/

After booting, set your system's time using date MMDDhhmmYYYY; keep in mind that at this time the system thinks your hardware clock is UTC and you will have to correct for that. For example if you're in central Europe, you may have to set your clock back by one hour (two hours in the summer), if you're in the USA on the West coast you will have to set it ahead by 8 hours (7 hours in the summer). If your forget to change the time at this point, you will run into minor problems after rebooting for the next day or so (e.g. at boot time the computer may think your file system's last modified time is in the future and will give you a warning about it).

Use something like fdisk /dev/hda to partition the harddisk. The common Gentoo partitioning scheme is as follows:

Initialize the file systems:

Activate the swap partition:

Mount the other partitions:

Your current directory is /mnt/gentoo.

Download and Unpack Gentoo and Portage, Chroot

Downloading and unpacking (in /mnt/gentoo):

Chroot-ing into your snapshot

Edit Configuration Files

Still in the chroot:

File: /etc/make.conf
# Add: (note, set number in MAKEOPTS to number of processors
# or cores or hyperthreads + 1)
MAKEOPTS="-j2"
GENTOO_MIRRORS="http://<your-mirror>"

# Following USE flags are just an example
USE="-X -ipv6 -nls -fortran acpi"
File: /etc/fstab
# Change /dev/BOOT to /dev/hda1 (or whatever)
# Change /dev/SWAP to /dev/hda2 (or whatever)
# Change /dev/ROOT to /dev/hda3 (or whatever)
File: /etc/conf.d/hostname
# Change host name to desired hostname
File: /etc/conf.d/net
# (Modify if necessary; if you're using DHCP you probably don't have to)
File: /etc/hosts
# Insert your hostname (as entered in /etc/conf.d/hostname)
# between "127.0.0.1" and "localhost"
Note: Changing your hostname this way is needed to make the login message work
File: /etc/conf.d/clock
# Modify the following to taste:
CLOCK="local"
CLOCK_SYSTOHC="yes"

# Add (for recent baselayout versions):
TIMEZONE="<your-timezone>"

Build the Kernel

For quick setups, Genkernel is the perfect solution. It takes longer to build but it takes almost no time to configure and it works on a wide variety of hardware.

While still in the chroot, do:

Install Grub

Install Grub:

 root (hd0,0)
 setup (hd0)
 quit

Just to get started (easier than switching back and forth between two terminals to get the kernel and initramfs filenames right)

After editing, the menu.lst file should similar to this (modify to taste):

File: /boot/grub/menu.lst
default 0
timeout 5
title Gentoo 2.6.20-r7
kernel /boot/kernel-genkernel-2.6.20-gentoo-r7 real_root=/dev/hda3
initrd /boot/initramfs-genkernel-2.6.20-gentoo-r7

Install Other System Tools

System logger

You can leave this out if you want to finish the setup really quickly, but I like to install it in case something goes wrong at first boot.

It's probably also a good idea to use logrotate so your drive won't fill up:

Logrotate is started as a cron job so we need a cron daemon:

The default settings of the above tools are fine as they are, in most cases.

DHCP client

Forgetting to download a DHCP client if you need one is going to cost you a lot of extra time because you will have a chicken-and-egg problem after you reboot your machine: you can't bring up the network because you don't have DHCP and you can't download DHCP because you don't have a network...

Finally

Set the root password: passwd

Reboot

Still in the chroot:

Now What?

After this, you should be able to run your minimal Stage3 install from harddisk without help from a CD-ROM. Some suggestions on what to do next:

Retrieved from "http://www.gentoo-wiki.info/HOWTO_Install_Gentoo_Quick_Reference"

Last modified: Fri, 05 Sep 2008 20:49:00 +0000 Hits: 11,268