Gentoo Logo
Gentoo Logo Side

Gentoo Linux Install Reference

Contents:

1. Quick Install Reference

Install ISOs are on the mirrors. Detailed descriptions of different disks are in the store. CD1 is a full bootable Gentoo Linux environment. CD 1 contains everything you need to install Gentoo Linux quickly and without a connection to the Internet. CD2 is optional and has pre-compiled packages such as KDE, GNOME, OpenOffice, Mozilla, Evolution and more.

Code listing 1.1: Beginning settings

(Start by booting your Live CD1. At the fancy boot w/ Gentoo Linux logo on it, push <ENTER>.)
(Hit F2-F3 if you have a RAID or PCMCIA laptop setup. You would now include dopcmcia or doataraid if you need it.)
(You will now see an even fancier boot screen, and then finally the root ("#") prompt on the console. Here we go.)
# date  (Make sure your time and date is correct. If wrong, set it with  date MMDDhhmmCCYY )
# modprobe module_name  (Optional- Load any modules, ie, network or scsi)
# ping -c 3 www.yahoo.com  (Check for network connectivity)
(If test fails try the below commands, or read the Networking chapter of the full Install Manual.)
# net-setup eth0  or  # dhcpcd eth0

Note: Now partition your drives. For more information read the Disk Partitioning chapter of the full Install Manual. Use fdisk, cfdisk, parted or partimage. Recommended setup is a 64 meg boot volume with ext3, a swap partition twice the size of your available RAM (2 Gig limit per swap file), and the rest for your root partition using ReiserFS. Don't wreck your data.

Code listing 1.2: File system, and basic system files

(Initialize your created partitions using the following applicable examples)
# mkswap /dev/hdax (swap)         # mke2fs /dev/hdax (ext2)  # mke2fs -j /dev/hdax (ext3)
# mkreiserfs /dev/hdax (reiserfs) # mkfs.xfs /dev/hdax (xfs) # mkfs.jfs /dev/hdax (jfs)
(Mount the partitions and unpack files)
# swapon /dev/hdax  (swap)
# mount /dev/hdax /mnt/gentoo  (root)
# mkdir /mnt/gentoo/boot
# mount /dev/hdax /mnt/gentoo/boot  (boot)
# cd /mnt/gentoo
# ls /mnt/cdrom/stages/   (to see what is available on your CD)
# tar -xvjpf /mnt/cdrom/stages/stage3-*.tar.bz2   (replace with whatever stage # you want to using)
(or you can download latest tarball online with lynx http://gentoo.oregonstate.edu/releases/x86/1.4/ )
# tar -xvjf /mnt/cdrom/snapshots/portage-*.tar.bz2 -C /mnt/gentoo/usr  (unpacking the portage tree)
# cp -R /mnt/cdrom/distfiles /mnt/gentoo/usr/portage/distfiles  (copying files for later use)
# cp -a /mnt/cdrom/packages /mnt/gentoo/usr/portage/packages
(Optional- Run mirrorselect now to choose mirrors. Automatic mode only works with no firewall.)
# cp /etc/resolv.conf /mnt/gentoo/etc/resolv.conf
# mount -t proc proc /mnt/gentoo/proc
# chroot /mnt/gentoo /bin/bash
# env-update; source /etc/profile
# emerge sync  (Optional- Updates portage tree.)
(Stage 1 install only)(Stage 1 and 2 installs should use the Stage chapter of the full Install Manual.)
# nano -w /etc/make.conf
# cd /usr/portage
# scripts/bootstrap.sh   (Bootstrapping, takes long time.)
(Now stage 2 only, stage 1 continued)
# emerge system    (This takes a long time, which is why some prefer starting at stage3)
(Now stage 3 starts here)
(Optional- use the next 3 lines to backup and update your config files before we start changing things)
  # cp /etc/make.conf /etc/make.conf.backup
  # CONFIG_PROTECT="-*" emerge -u system
  # cp /etc/make.conf.backup /etc/make.conf
# ln -sf /usr/share/zoneinfo/path/to/timezonefile /etc/localtime  (set timezone file)
# nano -w /etc/fstab  (now we setup your file system information)

Code listing 1.3: /etc/fstab

# <fs>                  <mountpoint>    <type>          <opts>                  <dump/pass>
/dev/hdax               /boot           ext3            noauto,noatime          1 2
/dev/hdax               /               reiserfs        noatime                 0 1
/dev/hdax               none            swap            sw                      0 0
/dev/cdroms/cdrom0      /mnt/cdrom      iso9660         noauto,ro,user          0 0
none                    /proc           proc            defaults                0 0
none                    /dev/shm        tmpfs           defaults                0 0
/dev/hdax               /mnt/dosc       ntfs            ro,noatime,umask=0222   0 0

Code listing 1.4: Kernel and customizing system

# emerge -k sys-kernel/gentoo-sources  (Here is the list of kernels.)
# emerge -k genkernel  (for genkernel)
# genkernel  (--config for kernel options. Take note of kernel and initrd names when it finishes. You will need it later.)
(OR manual kernel build, also see the Kernel chapter of the full Install Manual.)
  # cd /usr/src/linux
  # make menuconfig  (include VM fs, /proc fs, /dev fs,  /dev fs auto mount at boot)
  # make dep && make clean bzImage modules modules_install
  # cp /usr/src/linux/arch/i386/boot/bzImage /boot
# emerge -k app-admin/syslog-ng    (This is your system logger. You can also use sysklogd, metalog, or msyslog.  See Full instructions.)
# rc-update add syslog-ng default  (rc-update configures what daemons load at boot)
# emerge -k sys-apps/vcron        (This is your CRON Daemon.  You can also use dcron or fcron if you like. See Full instructions.)
# rc-update add vcron default   
# emerge -k hotplug               (This detects any hardware that initrd does not detect)
# rc-update add hotplug default
(Optional- Get packages for file system tools and hardware)
  # emerge -k reiserfsprogs  (or xfsprogs, jfsutils, lvm-user)
  # emerge -k nvidia-kernel  (or pcmcia-cs, emu10k1, nforce-net, nforce-audio, e100, e1000, ati-drivers, rp-pppoe
  # VIDEO_CARDS="yourcard" emerge xfree-drm   (for ATI Radeon up to 9200, Rage128, Matrox, Voodoo and other cards)
# passwd   (sets root password)
# useradd your_user -m -G users,wheel,audio -s /bin/bash
# passwd your_user
# echo mymachine > /etc/hostname
# echo mydomain.com > /etc/dnsdomainname   (or skip this)
# nano -w /etc/hosts                          (Add your actual hostname to /etc/hosts so GNOME doesn't complain)
# nano -w /etc/conf.d/net                     (Don't skip this DHCP users. iface_eth0="dhcp")
# nano -w /etc/modules.autoload.d/kernel-2.4  (Add modules if you had to load any at boot, ie network and scsi)
# nano -w /etc/rc.conf                        (Follow the directions in this file to configure important basic settings.)
# rc-update add net.eth0 default              (This starts your network at boot)(not pcmcia though)
(Optional, use this code if you have more then one network adapter)
  # ln -s /etc/init.d/net.eth0 /etc/init.d/net.ethx
  # rc-update add net.ethx default  
(Optional- Laptop users make sure /etc/init.d/pcmcia looks correct)
  # rc-update add pcmcia boot   (Loads any PCMCIA cards and starts networking.)
(Install your GRUB bootloader) (Use the Boot Loader section of the full Install Manual for LILO.)

Note: GRUB counts hard drives from zero rather than "a" and partitions start at zero rather than one. Only hard drives are counted, not atapi-ide devices. So the syntax is first integer indicates the drive number, while the second integer indicates the partition number. Once again, please note that the partition numbers are counted from zero, not from one. Your Linux partition /dev/hda1 is called (hd0,0) under GRUB. Grub also has TAB completion)

# emerge -k grub # grub (next we will install GRUB on to your hard drive's MBR (master boot record)) grub> root (hd0,0) (Tells GRUB the location of your boot boot partition. /dev/hda1 is used here) grub> setup (hd0) (Install grub onto your MBR) grub> quit grub> setup --stage2=/boot/grub/stage2 (hd0) (Optional- ATA RAID setups need the following) # nano -w /boot/grub/grub.conf (Create the grub.conf file)

Code listing 1.5: grub.conf

# Use the info from genkernel, subsitute at KV.(hd0,0)=bootpartition /dev/hda3=rootpartition. Actual file should be on seperate lines.
default 0
timeout 15
fallback 1
splashimage=(hd0,0)/grub/splash.xpm.gz
title=My example Gentoo Linux (genkernel)   # Below is an example for RAID setups    # Below needed only for people who dual-boot
root (hd0,0)                                title=Windows XP                         title=Gentoo Linux on RAID
kernel (hd0,0)/kernel-KV root=/dev/hda3     root (hd0,5)                             root (hd0,0)
initrd (hd0,0)/initrd-KV                    chainloader (hd0,5)+1                    kernel (hd0,0)/boot/bzImage root=/dev/ataraid/dXpY

Code listing 1.6: Finishing off and installing GUI

# etc-update
# exit; cd /
# umount /mnt/gentoo/boot; umount /mnt/gentoo/proc
# umount /mnt/gentoo
# reboot   (Don't forget to remove the bootable CD, and wait for the system to come back up.)
  # adsl-setup  (Optional, setup for adsl users.)
(Optional- The rest is loading binary packages from CD2 and configuring X)
# mount /dev/cdrom /mnt/cdrom  
# cp -a /mnt/cdrom/packages/* /usr/portage/packages/
# emerge -k xfree gnome kde
# /usr/X11R6/bin/xf86config  (It is now recommend that you go onto the Desktop Configuration guide for additional info.)

You can get more information with Gentoo Documentation.


  The contents of this document are licensed under the Creative Commons - Attribution / Share Alike license.

line
Updated 27 Sep 2003
line
Steven Wagner
Chief Architect

line
Summary: Quick install reference covers all details of the install process in a non-verbose manner. Users should already have prior experience with installing gentoo linux.
line

Donate to support our development efforts.

line
The Gentoo Linux Store
line

Win4Lin from NeTraverse lets you run Windows applications under Gentoo Linux at native speeds.

Win4Lin at NeTraverse

Purchase Win4Lin "Gentoo Edition" and you'll also get a special Gentoo discount. Every sale also helps support Gentoo Linux development :)

line
DDR Memory at Crucial.com

Purchase RAM from Crucial.com and a percentage of your sale will go towards further Gentoo Linux development.

line
Tek Alchemy

Tek Alchemy offers dedicated servers and other hosting solutions running Gentoo Linux.

line
Copyright 2001-2003 Gentoo Technologies, Inc. Questions, Comments, Corrections? Email www@gentoo.org.