2 2008-03-05
Configure the system

Edit your /etc/fstab and replace BOOT, ROOT and SWAP with the actual partition names. Don't forget to check that the file systems match your installation.

livecd linux # cd /etc
livecd etc # nano -w fstab
/dev/sda1   /boot     ext2    noauto,noatime     1 2
/dev/sda3   /         ext3    noatime            0 1
/dev/sda2   none      swap    sw                 0 0

Edit your /etc/fstab and replace BOOT, ROOT and SWAP with the actual partition names and add your logical volumes. Don't forget to check that the file systems match your installation.

livecd linux # cd /etc
livecd etc # nano -w fstab
/dev/md1          /boot                   ext2  noauto,noatime  1 2
/dev/md3          /                       ext3  noatime         0 1
/dev/sda2         none                    swap  sw,pri=1        0 0
/dev/sdb2         none                    swap  sw,pri=1        0 0
/dev/vg/usr       /usr                    ext3  noatime         1 2
/dev/vg/portage   /usr/portage            ext2  noatime         1 2
/dev/vg/distfiles /usr/portage/distfiles  ext2  noatime         1 2
/dev/vg/home      /home                   ext3  noatime         1 2
/dev/vg/opt       /opt                    ext3  noatime         1 2
/dev/vg/tmp       /tmp                    ext2  noatime         1 2
/dev/vg/var       /var                    ext3  noatime         1 2
/dev/vg/vartmp    /var/tmp                ext2  noatime         1 2

Configure your network in /etc/conf.d/net. Add the net.eth0 init script to the default run level. If you have multiple NICs, symlink them to the net.eth0 init script and add them to the default run level as well. Either edit /etc/conf.d/net with nano or use the following commands:

livecd etc # cd conf.d
livecd conf.d # echo 'config_eth0=( "192.168.1.10/24" )' >> net
livecd conf.d # echo 'routes_eth0=( "default via 192.168.1.1" )' >> net
livecd conf.d # rc-update add net.eth0 default
(If you compiled your network card driver as a module,
add it to /etc/modules.autoload.d/kernel-2.6)
livecd conf.d # echo r8169 >> /etc/modules.autoload.d/kernel-2.6
(If you want to reconnect via ssh after you have rebooted your new box)
livecd conf.d # rc-update add sshd default
Emerge pcmciautils if you need support for PCMCIA cards.

Set the root password using passwd.

livecd conf.d # passwd
New UNIX password: type_the_password
Retype new UNIX password: type_the_password_again
passwd: password updated successfully

Edit /etc/conf.d/clock to define the time zone you used previously.

livecd conf.d # nano -w /etc/conf.d/clock
TIMEZONE="Europe/Brussels"

Check the system configuration in /etc/rc.conf, /etc/conf.d/rc, /etc/conf.d/keymaps and edit any of those files if required.

livecd conf.d # nano -w /etc/rc.conf
livecd conf.d # nano -w /etc/conf.d/rc
livecd conf.d # nano -w /etc/conf.d/keymaps
Installing System Tools

Install RAID and LVM2 utilities.

livecd conf.d # emerge mdadm lvm2

Install a system logger like syslog-ng and a cron daemon like vixie-cron, and add them to the default run level.

Cron daemons depend on an MTA. mail-mta/ssmtp will be pulled in as a dependency. If you want to use a more advanced MTA, you might want to install it now. If you are in a hurry, let ssmtp be installed and remove it later when you install the MTA of your choice.
livecd conf.d # time emerge syslog-ng vixie-cron

real  1m54.099s
user  1m2.630s
sys   0m34.620s
livecd conf.d # rc-update add syslog-ng default
livecd conf.d # rc-update add vixie-cron default

Install the necessary file system tools (xfsprogs, reiserfsprogs or jfsutils) and networking tools (dhcpcd or ppp) if you need any.

livecd conf.d # emerge xfsprogs       (If you use the XFS file system)
livecd conf.d # emerge jfsutils       (If you use the JFS file system)
livecd conf.d # emerge reiserfsprogs  (If you use the Reiser file system)
livecd conf.d # emerge dhcpcd         (If you need a DHCP client)
livecd conf.d # emerge ppp            (If you need PPPoE ADSL connectivity)
Configuring the Bootloader

Emerge grub and configure it.

livecd conf.d # time emerge grub

real  1m4.634s
user  0m39.460s
sys   0m15.280s
livecd conf.d # nano -w /boot/grub/grub.conf
default 0
timeout 10

title Gentoo
root (hd0,0)
kernel /boot/kernel root=
livecd conf.d # grub
Probing devices to guess BIOS drives. This may take a long time.

grub> root (hd0,0)
 Filesystem type is ext2fs, partition type 0xfd

grub> setup (hd0)
 Checking if "/boot/grub/stage1" exists... yes
 Checking if "/boot/grub/stage2" exists... yes
 Checking if "/boot/grub/e2fs_stage1_5" exists... yes
 Running "embed /boot/grub/e2fs_stage1_5 (hd0)"...  16 sectors are embedded.
succeeded
 Running "install /boot/grub/stage1 (hd0) (hd0)1+16 p (hd0,0)/boot/grub/stage2 /boot/
grub/menu.lst"... succeeded
Done.

grub> quit
livecd conf.d # grub
Probing devices to guess BIOS drives. This may take a long time.

grub> root (hd0,0)
 Filesystem type is ext2fs, partition type 0xfd

grub> setup (hd0)
 Checking if "/boot/grub/stage1" exists... yes
 Checking if "/boot/grub/stage2" exists... yes
 Checking if "/boot/grub/e2fs_stage1_5" exists... yes
 Running "embed /boot/grub/e2fs_stage1_5 (hd0)"...  16 sectors are embedded.
succeeded
 Running "install /boot/grub/stage1 (hd0) (hd0)1+16 p (hd0,0)/boot/grub/stage2 /boot/
grub/menu.lst"... succeeded
Done.

grub> root (hd1,0)
 Filesystem type is ext2fs, partition type 0xfd

grub> setup (hd1)

grub> quit