Suggested Server Install

From TekAlchemy

Jump to: navigation, search

Contents

About this Page

This is the default instruction set the Tek Alchemy Staff use to install Gentoo on your systems. We have it here so you self installers can just cut and paste you a server, or as a reference to see what you might want us to do differently if we are installing it for you.

Initial Setup

Insert the appropriate USB dongle into the machine you are working on. We usually use the 64-bit Gentoo for our 64-bit machines but our customers can request a 32-bit operating system.

Booting

At the syslinux prompt type:

gentoo-nofb docache nodhcp

Disk Setup

Template:Box Warning


Run fdisk on the primary disk

fdisk /dev/sda

Run fdisk on the primary disk

 fdisk /dev/sda
Our current policy is:
  
 partition 1 = /boot 1024M
 partition 2 = swap 1024M
 partition 3 = / the rest of the drive
 You'll create the three partitions, marking 1 & 3 as type fd ( linux raid)
 and 2 as 82 (linux swap)

Copy the partition information to the slave drive

sfdisk -d /dev/sda | sfdisk /dev/sdb
  • Create Raid
 Setup the two mirrors for /boot and / Format the drives and mouunt for intall
 
 mknod /dev/md0 b 9 0
 mknod /dev/md1 b 9 1
 mdadm --create /dev/md0 --level=1 --raid-disks=2 /dev/sda1 /dev/sdb1
 mdadm --create /dev/md1 --level=1 --raid-disks=2 /dev/sda3 /dev/sdb3
 mke2fs /dev/md0
 mke2fs -j /dev/md1
 mkswap /dev/sda2
 mkswap /dev/sdb2
 swapon /dev/sdb2
 swapon /dev/sda2
 mount /dev/md1 /mnt/gentoo
 mkdir /mnt/gentoo/boot
 mount /dev/md0 /mnt/gentoo/boot

Getting the Install Files

  • Download a Stage Tarball
cd /mnt/gentoo
links http://www.gentoo.org/main/en/mirrors.xml

navigate to releases/2006.1/amd64/ and download the stage3 tarball go back to snapshots and download portage-latest.tar.bz untar using:

tar xvjpf stage3-*.tar.bz2
tar xvjf /mnt/gentoo/portage-latest.tar.bz2 -C /mnt/gentoo/usr
  • Setup /etc/make.conf
nano -w /mnt/gentoo/etc/make.conf
  • example config here:
CFLAGS="-O2 -march=opteron -pipe"
CHOST="x86_64-pc-linux-gnu"
CXXFLAGS="${CFLAGS}"
MAKEOPTS="-j5"
USE="nptlonly -alsa java5"

Install Base System

  • Copy DNS Info / Mount file Systems / Chrooting / Portage Update
cp -L /etc/resolv.conf /mnt/gentoo/etc/resolv.conf
mount -t proc none /mnt/gentoo/proc
mount -o bind /dev /mnt/gentoo/dev
chroot /mnt/gentoo /bin/bash
env-update
source /etc/profile
export PS1="(chroot) $PS1"

  • Edit make.conf for torpage
nano -w /etc/make.conf
paste in
SYNC="rsync://rsync.tek.net/gentoo-portage"
PORTDIR_OVERLAY="/usr/local/portage/"
FETCHCOMMAND_TORPAGE="/usr/sbin/torpage_fetch \${URI} \${DISTDIR}"
RESUMECOMMAND_TORPAGE="${FETCHCOMMAND_TORPAGE}"
  • Install Torpage
mkdir -p /usr/local/portage
cd /usr/local/portage
scp -r rsync.tek.net:/usr/local/portage/sys-apps .
cd /usr/portage/distfiles
scp rsync.tek.net:/usr/portage/distfiles/torpage* .
echo "sys-apps/torpage" >> /etc/portage/package.keywords
emerge torpage
echo "local torpage://rsync.tek.net" >> /etc/portage/mirrors
emerge --sync
  • Emerge and Build Kernel
cp /usr/share/zoneinfo/CST6CDT /etc/localtime
emerge hardened-sources
cd /usr/src/linux
make menuconfig

I need a place to attach or direct people to files, maybe a samba share

make && make modules modules_install
cp arch/x86_64/boot/bzImage /boot
cp System.map /boot

Configuring the System

  • Edit fstab
nano -w /etc/fstab
 change BOOT to md0
 change ROOT to md1
 change SWAP to /dev/sda2
 copy the swap line and change /dev/sda2 to /dev/sdb2
  • Networking Information
nano -w /etc/conf.d/hostname
 change localhost to the hostname of your new machine
nano -w /etc/conf.d/net

Use this as a template, it's commented out so we will use dhcp on next reboot
#dns_servers_lo=( "192.168.0.130" )
#dns_domain_lo="triand.com"
#config_eth0=( "192.168.0.104 netmask 255.255.255.0 brd 192.168.0.255" )
#config_eth1=( "10.0.0.104 netmask 255.255.255.0 brd 10.0.0.255" )
#routes_eth1=( "default gw 10.0.0.39" )
  • Start Networking at Boot
rc-update add net.eth0 default
cd /etc/init.d
ln -s net.lo net.eth1
rc-update add net.eth1 default
rc-update add sshd default
  • Set the root password
passwd
  • Edit the clock settings
nano -w /etc/conf.d/clock
 change CLOCK_SYSTOHC to yes
 set TIMEZONE="CST6CDT"

Installing System Tools

Cut and Paste for all the fine tools
emerge syslog-ng
rc-update add syslog-ng default
emerge vixie-cron
rc-update add vixie-cron default
emerge dhcpcd
emerge mdadm
rc-update add mdadm default
mdadm --detail --scan >> /etc/mdadm.conf
echo "MAILADDR jason@triand.com" >> /etc/mdadm.conf
emerge grub

Configuring the Bootloader

  • Create grub.conf
nano -w /boot/grub/grub.conf
Cut and Paste
# Which listing to boot as default. 0 is the first, 1 the second etc.
default 0
# How many seconds to wait before the default listing is booted.
timeout 10
# Nice, fat splash-image to spice things up :)
# Comment out if you don't have a graphics card installed
splashimage=(hd0,0)/boot/grub/splash.xpm.gz
#
title=Gentoo Linux
# Partition where the kernel image (or operating system) is located
root (hd0,0)
kernel /bzImage root=/dev/md1
  • Install on both hard drives
grub

device (hd0) /dev/sda
root (hd0,0)
setup (hd0)
device (hd0) /dev/sdb
root (hd0,0) 
setup (hd0)
quit

Reboot the System

exit
cd 
umount /mnt/gentoo/boot /mnt/gentoo/proc /mnt/gentoo/dev /mnt/gentoo
reboot
Personal tools