Monday, June 25, 2007

How to Install Gento

This Manual is for gentoo installation using universal bootable cd. You can download the ISO image for gentoo website or itsmirror.
Assigning Network
You can assign manually using ifconfig and route command or use "net-setup"
livecd gentoo
# net-setup eth0 [the configuration is self explanatory] livecd gentoo
# ifconfig [to check network configuration is running] livecd gentoo
# netstat -rn [to check default gateway]
Disk Partitioning
I prefer to use cfdisk for disk partitioning as it is much clearer to see specially for newbies. Here I will use two hardisk; One 10G and the second one is 3G. Belows is the summarize of my disk partition
Partition Filesystem Size Description
/dev/hda1 ext2 32M Boot Partition
/dev/hda2 swap 512 Swap partition
/dev/hda3 ext3 1G Root Partition
/dev/hda5 ext3 4G Usr Partition
/dev/hda6 ext3 4.6G Var Partition
/dev/hdb1 ext3 3G Home Partition
Viewing Current Partition Layout
cfdisk /dev/hda
Name Flags Part Type FS Type [Label] Size (MB)
------------------------------------------------------------------------------------- hda1 Primary Linux 32.91 hda2
Primary swap Solaris 509.97 hda3
Primary Linux 1003.49 hda5
Logical Linux 3997.49 hda6
Logical Linux 4696.64
cfdisk /dev/hdb
Name Flags Part Type FS Type [Label] Size (MB)
------------------------------------------------------------------------------------- hdb1 Primary Linux 3249.35


Assigning Filesystem to Partitions
livecd root
# mke2fs /dev/hda1 livecd root
# mke2fs -j /dev/hda3 livecd root
# mke2fs -j /dev/hda5 livecd root
# mke2fs -j /dev/hda6 livecd root
# mke2fs -j /dev/hdb1
Activating the Swap Partition
livecd root # mkswap /dev/hda2 livecd root
# swapon /dev/hda2
Mounting
livecd root # mount -t ext3 /dev/hda3 /mnt/gentoo livecd root
# mkdir /mnt/gentoo/boot livecd root
# mkdir /mnt/gentoo/usr livecd root
# mkdir /mnt/gentoo/var livecd root
# mkdir /mnt/gentoo/home livecd root
# mount /dev/hda1 /mnt/gentoo/boot/ livecd root
# mount -t ext3 /dev/hda5 /mnt/gentoo/usr/ livecd root
# mount -t ext3 /dev/hda6 /mnt/gentoo/var/ livecd root
# mount -t ext3 /dev/hdb1 /mnt/gentoo/home/
Installation
Veryfing Date/Time
livecd root # date Tue Jul 12 15:16:50 GMT 2005
Change Date/Time
livecd root # date 071215292005 Tue Jul 12 15:29:00 GMT 2005
Unpack Tarball From CDROM and Portage Setup
livecd root # cd /mnt/gentoo/ livecd gentoo
# tar xjvpf /mnt/cdrom/stages/stage3-i686-2005.0.tar.bz2 livecd gentoo
# tar xjvpf /mnt/cdrom/snapshots/portage-20050303.tar.bz2 -C /mnt/gentoo/usr/ livecd gentoo
# mkdir /mnt/gentoo/proc livecd gentoo
# mount -t proc /proc /mnt/gentoo/proc livecd gentoo
# mirrorselect -a -s4 -o >> etc/make.conf livecd gentoo
# chroot /mnt/gentoo /bin/bash livecd /
# env-update livecd /
# source /etc/profile
Update Kernel
livecd / # ln -sf /usr/share/zoneinfo/Asia/Kuala_Lumpur /etc/localtime livecd /
# echo nameserver 202.190.100.40 > /etc/resolv.conf livecd /
# emerge sync livecd /
# emerge gentoo-sources livecd /
# cd /usr/src/linux livecd linux
# make menuconfig livecd linux
# make && make modules_install livecd linux
# cp arch/i386/boot/bzImage /boot/kernel-2.6.12-gentoo-r4 livecd linux
# cp System.map /boot/System.map-2.6.12-gentoo-r4 livecd linux
# cp .config /boot/config-2.6.12-gentoo-r4
System Configuration
Edit Fstab livecd linux
# nano -w /etc/fstab
/dev/hda1 /boot ext2 noauto,noatime 1 1
/dev/hda3 / ext3 noatime 0 0
/dev/hda2 none swap sw 0 0
/dev/hda5 /usr ext3 noatime 0 0
/dev/hda6 /var ext3 noatime 0 0
/dev/hdb1 /home ext3 noatime 0 0
/dev/cdroms/cdrom0 /mnt/cdrom iso9660 noauto,ro 0 0 none
/proc proc defaults 0 0 none
/dev/shm tmpfs nodev,nosuid,noexec 0 0

livecd linux # echo mysmtp > /etc/hostname [assign your hostname]
livecd linux # echo network-box.com.my > /etc/domainname [assign your domain]
livecd linux # nano -w /etc/conf.d/hostname [assign your hostname]
livecd linux # nano -w /etc/conf.d/domainname [assign your domain]
livecd linux # rc-update add domainname default [set it to up during boot time]
livecd linux # nano -w /etc/conf.d/net [assign ip configiration]
livecd linux # rc-update add net.eth0 default [set it to up during boot time]
livecd linux # rc-update add sshd default [set sshd to up during boot time]
livecd linux # passwd [assign new password to root]
livecd linux # useradd -m newuser [add newuser]
livecd linux # passwd newuser [change newuser password]
Other systems
livecd linux # emerge syslog-ng livecd linux
# rc-update add syslog-ng default livecd linux
# emerge vixie-cron livecd linux
# rc-update add vixie-cron default
Bootloader Configuration
livecd linux # emerge --usepkg lilo
livecd linux # nano -w /etc/lilo.conf.example
livecd linux # cp /etc/lilo.conf.example /etc/lilo.conf
livecd linux # nano -w /etc/lilo.conf livecd linux #
lilo -v livecd root # reboot

No comments: