Installing a Stage4 Image is easy 1) prepare a system; 2) customise image; 3) reboot. The steps are here very closely related to the Gentoo Quick Install guide.
Preparing the System
Boot from a Live CD, such as SystemRescueCd, and prepare the target disk. Raid and other advanced setup features are not covered here.
Set the system date accurate to an accurate time. This is important for the file ctime and mtime values on the new system.
root@host # ntpdate -b pool.ntp.org
Partition the disk using cfdisk.
A reasonable, but not absolutely required configuration, is 256MiB for boot (/dev/sda1), 2GiB swap (/dev/sda2) and 16GiB root (/dev/sda3).
The rest of the disk can be broken into logical partitions as necessary for the environment.
root@host # export DEV=/dev/sda root@host # cfdisk /dev/sda
Or use the following steps to automatically partition with sfdisk.
256MiB Boot, 2GiB Swap and 16GiB Root.
root@host # export DEV=/dev/sda
root@host # dd if=/dev/zero of=${DEV} bs=512 count=4
root@host # dd if=/usr/share/syslinux/mbr.bin of=${DEV} bs=512 count=1
root@host # echo -n ",256,0x83,*\n,2048,0x82\n,16384,0x83\n" | sfdisk -uM ${DEV}
root@host # sfdisk --re-read ${DEV}
root@host # sfdisk --verify ${DEV}
Make some file systems.
root@host # mke2fs -L'boot' ${DEV}1
root@host # mkswap -L'swap' ${DEV}2 && swapon ${DEV}2
root@host # mke2fs -L'root' -j ${DEV}3
Many system engineers create logical paritions for various purposes.
Some uses include /home for user directories, /var/lib/{mysql,pgsql} for a database or /var/www for some web-root.
Mount these newly created file-systems in the target location.
root@host # mkdir -p /mnt/target
root@host # mount ${DEV}3 /mnt/target
root@host # mkdir -p /mnt/target/boot
root@host # mount ${DEV}1 /mnt/target/boot
Download & Extract Image
root@host # cd /mnt/target root@host # wget -O/mnt/target/stage4.tgz http://stage4.org/stage4/image/get/nucleus root@host # tar -pxz -f stage4.tgz