The simplest of all methods we will simply extract our Stage4 system to the target location.

Boot the target system using virtually any Live Linux environment, we use the bare-bones Gentoo minimal or SysRescCd. Get that system on to the Internet and configure the time.

dhcpcd eth0
ntpdate [server]

Create the necessary partitions on the system with fdisk, other tools such as cfdisk or sfdisk but fdisk is preferred. A reasonable layout is shown below and should be adjusted according to the requirements.

# sfdisk -l /dev/sda

Disk /dev/sda: 121601 cylinders, 255 heads, 63 sectors/track
Units = cylinders of 8225280 bytes, blocks of 1024 bytes, counting from 0

   Device Boot Start     End   #cyls    #blocks   Id  System
/dev/sda1   *      0+  18235   18236- 146480638+  83  Linux
/dev/sda2      18236   18721     486    3903795   82  Linux swap / Solaris
/dev/sda3      18722  121600  102879  826375567+  83  Linux
/dev/sda4          0       -       0          0    0  Empty

Remember to mark one partition bootable

Create FileSystems on the Target

# mkfs -L'boot' /dev/sda1
# mkswap -L'swap' /dev/sda2
# mkfs -J -L'root' /dev/sda3

Mount the target partition, fetch and extract the Stage4 image.

# mkdir /mnt/praxis
# mount /dev/sda3 /mnt/praxis
# cd /mnt/praxis
# wget http://carbon.edoceo.com/praxis/stage4-silicon.tbz
# tar -xjpf stage4-silicon.tbz
# rm stage4-silicon.tbz

Chroot into this system, configure the locale, timezone and time.

# mount -t proc proc /mnt/praxis/proc
# mount -o bind /dev /mnt/praxis/dev
# chroot /mnt/praxis /bin/bash
# hash -r
# env-update
# . /etc/profile
# nano -w /etc/locale.gen
# rm /etc/localtime
# ln -s /usr/share/zoneinfo/America/Los_Angeles /etc/localtime

Also look in /etc/conf.d/hwclock and /etc/rc.conf.

Configure and Sync Portage, see the safe cflags information.

# cat /etc/make.conf
CHOST="x86_64-pc-linux-gnu"
CFLAGS="-O2 -pipe"
CXXFLAGS="${CFLAGS}" 
INPUT_DEVICES="evdev"
LINGUAS="en en_GB"
MAKEOPTS="-j3"
PORTAGE_BINHOST="http://carbon.edoceo.com/praxis/silicon"
SYNC="rsync://cdn.edoceo.com/praxis"
VIDEO_CARDS="nvidia"

# emerge --sync
# eselect profile set edoceo/silicon
# emerge -gavuDN @world

Update configs in /etc/conf.d/ and then also add services to the proper run-level.

eselect rc add net.eth0 default
eselect rc add fcron default
eselect rc add ntpd default
eselect rc add sshd default
eselect rc add syslog-ng default

Install bootloader (extlinux), yes we cat an MBR to the device, then install extlinux.

.
 cat /usr/share/syslinux/mbr.bin > /dev/sda
 extlinux --install /mnt/target/boot

Fetch the Stage4, which can even be saved to the target, and then extract it into place on this system.

 cd /mnt/target
 wget http://cdn.edoceo.com/praxis/silicon.tgz
 tar -zxpf silicon.tgz

Now, if necessary, chroot into this fresh system and configure the kernel (genkernel) and configure the startup scripts.

 chroot /mnt/target /bin/bash
 nano -w /etc/make.conf
 emerge --sync
 rc-config add sshd default
 rc-config add openntpd default
 rc-config add apache2 default
 rc-config add postgresql-9.0 default

Remember to edit /etc/fstab, the timezone, locales and configure swap!

Installing & Booting Software RAID 1

To install to a bootable softare based RAID1 use the following steps.

First create the partitions on the the first disk, eg: /dev/sda. Then copy those partitions to the next disk /dev/sdb Use mdadm to create the raid, using the old 0.90 super-block, install boot-loader.

See How Mdadm RAID1

comments powered by Disqus