Gentoo/x86 Installation Tips & Tricks Sven Vermeulen The Gentoo installation allows for very flexible approaches to the various installation methods. As it is almost impossible to insert every single tip or trick in the installation instructions this document tries to deal with all submitted tips and tricks for reference purposes. 1.0 April 11, 2004 Introduction
Preliminary

This document contains various tips and tricks for the Gentoo/x86 installation. Most of them are discussed in a dense way - they are meant as an addendum to the installation instructions and not as a replacement.

Contents

Advanced Installations

  • Software RAID

Simplifying the Installation

  • Leaving the Terminal
Advanced Installations
Software RAID If you are not known to software raid, please read the Software-RAID-HOWTO.

Once you are booted from the LiveCD, load the appropriate RAID modules. For instance, if you plan on using RAID-1:

# modprobe raid1

When you partition your disks, make sure that your partitions use fd (Linux raid autodetect) as Partition Type instead of 83 (Linux native). You can alter the partition type using the t command in fdisk.

After partitioning, create the /etc/raidtab file (yes, indeed, on the LiveCD environment) and insert the necessary commands for your RAID setup. For instance, to have your boot, swap and root partition mirrored (RAID-1) covering /dev/sda and /dev/sdb, you can use:

raiddev /dev/md0
  raid-level 1
  nr-raid-disks 2
  chunk-size 32
  persistent-superblock 1
  device /dev/sda1
    raid-disk 0
  device /dev/sdb1
    raid-disk 1

raiddev /dev/md1
  raid-level 1
  nr-raid-disks 2
  chunk-size 32
  persistent-superblock 1
  device /dev/sda2
    raid-disk 0
  device /dev/sdb2
    raid-disk 1

raiddev /dev/md2
  raid-level 1
  nr-raid-disks 2
  chunk-size 32
  persistent-superblock 1
  device /dev/sda3
    raid-disk 0
  device /dev/sdb3
    raid-disk 1

Now create the necessary RAID devices for each RAID device you listed in /etc/raidtab:

# mkraid /dev/md0
# mkraid /dev/md1
# mkraid /dev/md2

The Linux Software RAID driver will start creating the metadevices. You can see its progress in /proc/mdstat. Wait until the metadevices are completely finished before proceeding.

From now onwards, use /dev/md0 for the boot partition, /dev/md1 for the swap partition and /dev/md2 for the root partition.

After mounting /dev/md2 on /mnt/gentoo, don't forget to copy over /etc/raidtab to /mnt/gentoo/etc.

When you're configuring your kernel, make sure you have the appropriate RAID support in your kernel and not as module.

When installing extra tools, emerge raidtools as well. Note that this isn't available on all LiveCDs so you might not be able to install Gentoo on a Software RAID when using a networkless installation!

When configuring your bootloader, make sure it gets installed in the MBR of both disks if you use mirroring.

Simplifying the Installation
Leaving your Terminal

Many people want to leave their system when it's compiling. In certain cases this is rather difficult as the installation is done in a public environment where you cannot trust everyone. If this is the case, you want to be able to perform the compilation in the background and log out from all terminals.

There are several possible solutions for this. The first one is to use screen. After booting the LiveCD, set your root password and start a screen session:

Not all LiveCDs provide screen. If this is the case, you will have to use one of the other methods described in this section.
# screen -S gentoo

Once inside the screen session you can perform the entire installation. When you want to leave your terminal, press Ctrl-a, d (that is, control and a at the same time, then followed by a d) to detach your screen session. You can now safely log out of your system.

To regain access to your terminal, log in as root again and attach to the running screen session:

# screen -x gentoo

If you can't use screen, there is still a way to leave your terminal. Follow the installation instructions, but when you come to the point where a long-term compilation would be started (for instance the ./scripts/bootstrap.sh step), use nohup which allows for a process to continue even when you log out. Don't forget the trailing "&", otherwise the process won't be placed in the background! Remember where you are (the pwd command will show you that) as you will need to know this later on.

# pwd
/usr/portage
# nohup ./scripts/bootstrap.sh &

Now exit the chrooted environment (exit) and the LiveCD session. Your compilation will continue in the background.

When you want to check the compilation, log in as root (on the LiveCD) and chroot back into your environment and go to the directory where you left off:

# chroot /mnt/gentoo /bin/bash
# env-update && source /etc/profile
# cd /usr/portage

Now use the less command on the nohup.out file that is situated inside that directory. The compilation will append its output to that file, so if you want to follow the compilation progress, run less nohup.out and press F to follow the changes. When the compilation is finished, you can continue with the next step of the installation instructions.

If you ever get tired of following the changes, press Ctrl-C followed by a q. This won't stop the compilation process, only the less process.