# fdisk /dev/hda
Command: n
Command action: p
Partition number: 1
First cylinder: 1
Last cylinder: +128M
Command: a
Partition number: 1
Command: t
Hex code: fd
Command: n
Command action: p
Partition number: 2
First cylinder: [enter]
Last cylinder: +2048M
Command: t
Partition number: 2
Hex code: fd
(note that partition #3 can be different sizes based on needs)
Command: n
Command action: p
Partition number: 3
First cylinder: [enter]
Last cylinder: +16384M or +2048M
Command: t
Partition number: 3
Hex code: fd
Command: n
Command action: p
First cylinder: [enter]
Last cylinder: (use 99% of what's available)
Command: t
Partition number: 4
Hex code: fd
Command: p
Command: w# modprobe md
# ls /dev/md*
ls: /dev/md*: No such file or directory
# for i in 0 1 2 3; do mknod /dev/md$i b 9 $i; done
# ls /dev/md*
/dev/md0 /dev/md1 /dev/md2 /dev/md3# modprobe raid1
# mdadm --create /dev/md0 --level=1 --raid-devices=2 /dev/hda1 /dev/hde1
# mdadm --create /dev/md1 --level=1 --raid-devices=2 /dev/hda2 /dev/hde2
# mdadm --create /dev/md2 --level=1 --raid-devices=2 /dev/hda3 /dev/hde3
# mdadm --create /dev/md3 --level=1 --raid-devices=2 /dev/hda4 /dev/hde4
# cat /proc/mdstat# modprobe raid1
# mdadm --create /dev/md0 --level=1 --raid-devices=2 /dev/hda1 /dev/hdc1
# mdadm --create /dev/md1 --level=1 --raid-devices=2 /dev/hda2 /dev/hdc2
# mdadm --create /dev/md2 --level=1 --raid-devices=2 /dev/hda3 /dev/hdc3
# mdadm --create /dev/md3 --level=1 --raid-devices=2 /dev/hda4 /dev/hdc4
# cat /proc/mdstat# mdadm --detail --scan >> /etc/mdadm.conf
# nano -w /etc/mdadm.conf# mke2fs /dev/md0
# mkswap /dev/md1 ; swapon /dev/md1
# mke2fs -j /dev/md2
# mount /dev/md2 /mnt/gentoo
# mkdir /mnt/gentoo/boot ; mount /dev/md0 /mnt/gentoo/boot# modprobe dm-mod
# pvcreate /dev/md3
# echo 'devices { filter=["r/cdrom/"] }' > /etc/lvm/lvm.conf
# vgcreate vgmirror /dev/md3
# vgscan
# lvcreate -L2G -ntmp vgmirror
# lvcreate -L2G -nvartmp vgmirror
# lvcreate -L2G -nopt vgmirror
# lvcreate -L4G -nusr vgmirror
# lvcreate -L2G -nvar vgmirror
# lvcreate -L2G -nhome vgmirror
# ls -l /dev/vgmirror
# lvscan
# mke2fs /dev/vgmirror/tmp
# mke2fs /dev/vgmirror/vartmp
# mke2fs -j /dev/vgmirror/opt
# mke2fs -j /dev/vgmirror/usr
# mke2fs -j /dev/vgmirror/var
# mke2fs -j /dev/vgmirror/home
# mkdir /mnt/gentoo/opt ; mount /dev/vgmirror/opt /mnt/gentoo/opt
# mkdir /mnt/gentoo/usr ; mount /dev/vgmirror/usr /mnt/gentoo/usr
# mkdir /mnt/gentoo/var ; mount /dev/vgmirror/var /mnt/gentoo/var
# mkdir /mnt/gentoo/home ; mount /dev/vgmirror/home /mnt/gentoo/home
# mkdir /mnt/gentoo/tmp ; mount /dev/vgmirror/tmp /mnt/gentoo/tmp
# chmod 1777 /mnt/gentoo/tmp
# mkdir /mnt/gentoo/var/tmp ; mount /dev/vgmirror/vartmp /mnt/gentoo/var/tmp
# chmod 1777 /mnt/gentoo/var/tmp# date
# ls -l /mnt/cdrom/stages
total 450586
-rw-r--r-- 1 root root 92520704 Aug 7 04:45 stage3-athlon-xp-2005.1.tar.bz2
-rw-r--r-- 1 root root 92413359 Aug 7 04:47 stage3-i686-2005.1.tar.bz2
-rw-r--r-- 1 root root 92122771 Aug 7 04:46 stage3-pentium3-2005.1.tar.bz2
-rw-r--r-- 1 root root 92475718 Aug 7 04:46 stage3-pentium4-2005.1.tar.bz2
-rw-r--r-- 1 root root 91866585 Aug 7 04:46 stage3-x86-2005.1.tar.bz2
# cd /mnt/gentoo
# tar -xvjpf /mnt/cdrom/stages/stage3-x86-2005.1.tar.bz2# cd /mnt/gentoo
# ls -l /mnt/cdrom/snapshot
# tar -xvjf /mnt/cdrom/snapshot/portage-2005.1.tar.bz2 -C /mnt/gentoo/usr# cat /proc/version
Linux version 2.6.12-gentoo-r6 (root@poseidon) (gcc version 3.3.5-20050130 (Gentoo 3.3.5.20050130-r1, ssp-3.3.5.20050130-1, pie-8.7.7.1)) #1 SMP Wed Aug 3 20:26:57 UTC 2005
# cat /proc/cpuinfo
processor : 0
vendor_id : GenuineIntel
cpu family : 6
model : 8
model name : Celeron (Coppermine)
stepping : 6
cpu MHz : 568.141
cache size : 128 KB
fdiv_bug : no
hlt_bug : no
f00f_bug : no
coma_bug : no
fpu : yes
fpu_exception : yes
cpuid level : 2
wp : yes
flags : fpu vme de pse tsc msr pae mce cx8 sep mtrr pge mca cmov pat pse36 mmx fxsr sse
bogomips : 1114.11
# cat /proc/meminfo
MemTotal: 320792 kB
MemFree: 7600 kB
Buffers: 57472 kB
Cached: 180320 kB
SwapCached: 4 kB
Active: 29596 kB
Inactive: 210948 kB
HighTotal: 0 kB
HighFree: 0 kB
LowTotal: 320792 kB
LowFree: 7600 kB
SwapTotal: 2007992 kB
SwapFree: 2000156 kB
Dirty: 0 kB
Writeback: 0 kB
Mapped: 5144 kB
Slab: 63636 kB
CommitLimit: 2168388 kB
Committed_AS: 15752 kB
PageTables: 172 kB
VmallocTotal: 704504 kB
VmallocUsed: 6856 kB
VmallocChunk: 696436 kB# nano -w /mnt/gentoo/etc/make.conf# These settings were set by the catalyst build script that automatically built this stage
# Please consult /etc/make.conf.example for a more detailed example
CFLAGS="-Os -mcpu=i686"
CHOST="i386-pc-linux-gnu"
CXXFLAGS="${CFLAGS}"
MAKEOPTS="-j2"# mirrorselect -i -o >> /mnt/gentoo/etc/make.conf
# mirrorselect -i -r -o >> /mnt/gentoo/etc/make.conf
# cat /mnt/gentoo/etc/make.conf
CFLAGS="-Os -mcpu=i686"
CHOST="i386-pc-linux-gnu"
CXXFLAGS="${CFLAGS}"
MAKEOPTS="-j2"
GENTOO_MIRRORS="http://gentoo.osuosl.org/"
SYNC="rsync://rsync.namerica.gentoo.org/gentoo-portage"# cp -L /etc/resolv.conf /mnt/gentoo/etc/resolv.conf
# cp -L /etc/mdadm.conf /mnt/gentoo/etc/mdadm.conf
(do the next 2 commands if you are using LVM2)
# mkdir /mnt/gentoo/etc/lvm
# cp -L /etc/lvm/lvm.conf /mnt/gentoo/etc/lvm/lvm.conf
(end of optional LVM2 commands)
# mount -t proc none /mnt/gentoo/proc
# chroot /mnt/gentoo /bin/bash
# env-update
# source /etc/profile
# emerge --sync# ls -FGg /etc/make.profile
lrwxrwxrwx 1 48 Sep 21 10:22 /etc/make.profile -> ../usr/portage/profiles/default-linux/x86/2005.1/
# ls -d /usr/portage/profiles/default-linux/x86/2005.1/2.4
/usr/portage/profiles/default-linux/x86/2005.1/2.4livecd / # ls -l /etc/make.profile
lrwxrwxrwx 1 root root 48 Oct 22 21:04 /etc/make.profile -> ../usr/portage/profiles/default-linux/x86/2005.1
livecd / # cat /etc/make.profile/make.defaults
# Copyright 1999-2005 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
# $Header: /var/cvsroot/gentoo-x86/profiles/default-linux/x86/2005.1/make.defaults,v 1.4 2005/08/29 22:20:25 wolf31o2 Exp $
USE="alsa apm arts avi berkdb bitmap-fonts crypt cups eds emboss encode fortran foomaticdb gdbm gif gnome gpm gstreamer gtk gtk2 imlib ipv6 jpeg kde libg++ libwww mad mikmod motif mp3 mpeg ncurses nls ogg oggvorbis opengl oss pam pdflib perl png python qt quicktime readline sdl spell ssl tcpd truetype truetype-fonts type1-fonts vorbis X xml2 xmms xv zlib"
livecd / # # less /usr/portage/profiles/use.desc
# echo 'USE="apache2 kerberos ldap postgres samba -alsa -apm -arts -bitmap-fonts -gnome -gtk -gtk2 -kde -mad -mikmod -motif -opengl -oss -qt -quicktime -sdl -truetype -truetype-fonts -type1-fonts -X -xmms -xv"' >> /etc/make.conf
# nano -w /etc/make.conf# ls /usr/share/zoneinfo
# ln -sf /usr/share/zoneinfo/EST5EDT /etc/localtime
# date
# zdump GMT
# zdump EST5EDT# emerge gentoo-sources
# ls -l /usr/srcLabels: Gentoo, SoftwareRAID
Visual Basic Rnd() function tricks and traps
More rsync links for using rsync as a backup tool
Gentoo 2005.0 Software RAID (part 1)
Gentoo: Can't create lock file