Generic c5.ks

From Alteeve Wiki
Jump to navigation Jump to search

 AN!Wiki :: Generic c5.ks

This is a generic CentOS 5.x kickstart file. It has a minimal package list and can be used on most bare-iron servers with at least 45 GiB of disk space and Xen VM installs with at least 10 GiB of space.

# Kickstart file created by Madison Kelly (mkelly@iplink.net
#
# For:
# Centos 5.6, AN!Cluster Generic, minimal bare-iron and VM installer.
# - May work with other versions but not tested.
#
 
text 
install
url --url=http://192.168.1.254/c5/x86_64/img/
lang en_US.UTF-8
keyboard us
timezone --utc America/Toronto
network --device eth0 --bootproto dhcp --onboot yes --hostname generic-new.alteeve.com
authconfig --enableshadow --passalgo=sha512 --enablefingerprint
# Password is 'initial'.
rootpw --iscrypted $6$0riSEDMyCvHPdhCv$lvuhEOqU2yo9szCJHtAsVUK3maHyWlpZmVi6PCRkrOfifL/38J7SaGUopehv/rzwQvhqxNla/jPvD10uwuPY4/
firewall --disabled
selinux --disabled
firstboot --disable
reboot
services --disabled NetworkManager,iptables,iptables,ip6tables
services --enabled network
 
# This will run whatever was created by the script below.
%include /tmp/part-include
 
%packages
@base
@core
@editors
@gnome-desktop
@graphical-internet
@text-internet
@base-x
keyutils
trousers
fipscheck
device-mapper-multipath
lynx
xorg-x11-server-Xnest
slocate
-ksh
-lftp
-unzip
-mgetty
-dosfstools
-sendmail
-pcmciautils
-mlocate
-nfs-utils
-mkbootdisk
-irda-utils
-bluez-utils
-talk
-gnome-user-docs
-gnome-themes
-gnome-power-manager
-evince
-alacarte
-gnome-backgrounds
-gok
-gnome-audio
-gnome-user-share
-NetworkManager-gnome
-gimp-print-utils
-im-chooser
-file-roller
-gnome-mag
-nautilus-sendto
-eog
-gnome-screensaver
-gnome-pilot
-orca
-evolution
-nspluginwrapper
-gnome-themes
-evolution-webcal
-ekiga
-evolution-connector
-slrn
-fetchmail
-mutt
-cadaver
-rhgb
-linuxwacom
 
### Script to setup partitions.
%pre --log=/tmp/ks-preinstall.log
 
#!/bin/sh
 
# Prepare the disks in the script below. It checks '/proc/partitions' to see
# what configuration to use.
 
### Some detection.
if grep -q "cciss/c0d0" /proc/partitions; then
	### No RAID is needed at the software level, it's managed by the controller.
cat >> /tmp/part-include <<END
zerombr
clearpart --linux --drives=cciss/c0d0
ignoredisk --only-use=cciss/c0d0
bootloader --location=mbr --driveorder=cciss/c0d0 --append="crashkernel=auto"
 
part     /boot --fstype ext3 --size=256   --asprimary
part     swap  --fstype swap --size=4096  --asprimary
part     /     --fstype ext3 --size=40960 --asprimary
END
elif grep -q "cciss/c1d0" /proc/partitions; then
	### No RAID is needed at the software level, it's managed by the controller.
cat >> /tmp/part-include <<END
zerombr
clearpart --linux --drives=cciss/c1d0
ignoredisk --only-use=cciss/c1d0
bootloader --location=mbr --driveorder=cciss/c1d0 --append="crashkernel=auto"
 
part     /boot --fstype ext3 --size=256   --asprimary
part     swap  --fstype swap --size=4096  --asprimary
part     /     --fstype ext3 --size=40960 --asprimary
END
elif grep -q hdb /proc/partitions; then
	### /dev/hdX RAID 1
cat >> /tmp/part-include <<END
zerombr
clearpart --all --initlabel --drives=hda,hdb
ignoredisk --only-use=hda,hdb
bootloader  --location=mbr --driveorder=hda,hdb --append="crashkernel=auto"
 
# /boot
part raid.01 --ondisk=sda --asprimary --size=256
part raid.02 --ondisk=sdb --asprimary --size=256
# /
part raid.11 --ondisk=sda --asprimary --size=40960
part raid.12 --ondisk=sdb --asprimary --size=40960
# <swap>
part raid.21 --ondisk=sda --asprimary --size=4096
part raid.22 --ondisk=sdb --asprimary --size=4096
 
# Format /boot and /.
raid /boot --fstype=ext3 --level=1 --device=md0 raid.01 raid.02
raid /     --fstype=ext3 --level=1 --device=md1 raid.11 raid.12
raid swap  --fstype=swap --level=1 --device=md2 raid.21 raid.22
END
elif grep -q hda /proc/partitions; then
	### /dev/hda single
cat >> /tmp/part-include <<END
zerombr
clearpart --linux --drives=hda
ignoredisk --only-use=hda
bootloader --location=mbr --driveorder=hda --append="crashkernel=auto"
 
part     /boot --fstype ext3 --size=256   --asprimary
part     swap  --fstype swap --size=4096  --asprimary
part     /     --fstype ext3 --size=40960 --asprimary
END
elif grep -q sdf /proc/partitions; then
	### /dev/sdX RAID - This should be the majority.
	# 6-Drive RAID 5 w/ 1 hot spare
cat >> /tmp/part-include <<END
zerombr
clearpart --all --initlabel --drives=sda,sdb,sdc,sdd,sde,sdf
ignoredisk --only-use=sda,sdb,sdc,sdd,sde,sdf
bootloader --location=mbr --driveorder=sda,sdb,sdc,sdd,sde,sdf --append="crashkernel=auto"
 
## This will create a 6-drive RAID 5 array.
# The '/boot' partition. A little nuts at 6x RAID 1 but meh, what else would I
# use the 256MB parts for?
part raid.01 --size=256 --ondisk=sda
part raid.02 --size=256 --ondisk=sdb
part raid.03 --size=256 --ondisk=sdc
part raid.04 --size=256 --ondisk=sdd
part raid.05 --size=256 --ondisk=sde
part raid.06 --size=256 --ondisk=sdf
 
# The swap partition. Set to RAID 5, so it's actually ~5GB. It's RAID'ed and
# not individual parts because a loss of swap can still brind down a system.
part raid.11 --size=1024 --ondisk=sda
part raid.12 --size=1024 --ondisk=sdb
part raid.13 --size=1024 --ondisk=sdc
part raid.14 --size=1024 --ondisk=sdd
part raid.15 --size=1024 --ondisk=sde
part raid.16 --size=1024 --ondisk=sdf
 
# This is the main '/' partition for 'dom0'. The remainder of the disk space
# will be hand-crafted into a RAID 5 partition post install for either DRBD or
# iSCSI.
part raid.21 --size=10240 --ondisk=sda
part raid.22 --size=10240 --ondisk=sdb
part raid.23 --size=10240 --ondisk=sdc
part raid.24 --size=10240 --ondisk=sdd
part raid.25 --size=10240 --ondisk=sde
part raid.26 --size=10240 --ondisk=sdf
 
# RAID configure.
raid /boot --fstype=ext3 --level=1 --spares=1 --device=md0 raid.01 raid.02 raid.03 raid.04 raid.05 raid.06
raid swap                --level=5 --spares=1 --device=md1 raid.11 raid.12 raid.13 raid.14 raid.15 raid.16
raid /     --fstype=ext4 --level=5 --spares=1 --device=md2 raid.21 raid.22 raid.23 raid.24 raid.25 raid.26
END
elif grep -q sde /proc/partitions; then
	### /dev/sdX RAID - This should be the majority.
	# 5-Drive RAID 5
cat >> /tmp/part-include <<END
zerombr
clearpart --all --initlabel --drives=sda,sdb,sdc,sdd,sde
ignoredisk --only-use=sda,sdb,sdc,sdd,sde
bootloader --location=mbr --driveorder=sda,sdb,sdc,sdd,sde --append="crashkernel=auto"
 
 
## This will create a 5-drive RAID 5 array.
# The '/boot' partition. A little nuts at 6x RAID 1 but meh, what else would I
# use the 256MB parts for?
part raid.01 --size=256 --ondisk=sda
part raid.02 --size=256 --ondisk=sdb
part raid.03 --size=256 --ondisk=sdc
part raid.04 --size=256 --ondisk=sdd
part raid.05 --size=256 --ondisk=sde
 
# The swap partition. Set to RAID 5, so it's actually ~5GB. It's RAID'ed and
# not individual parts because a loss of swap can still brind down a system.
part raid.11 --size=1024 --ondisk=sda
part raid.12 --size=1024 --ondisk=sdb
part raid.13 --size=1024 --ondisk=sdc
part raid.14 --size=1024 --ondisk=sdd
part raid.15 --size=1024 --ondisk=sde
 
# This is the main '/' partition for 'dom0'. The remainder of the disk space
# will be hand-crafted into a RAID 5 partition post install for either DRBD or
# iSCSI.
part raid.21 --size=10240 --ondisk=sda
part raid.22 --size=10240 --ondisk=sdb
part raid.23 --size=10240 --ondisk=sdc
part raid.24 --size=10240 --ondisk=sdd
part raid.25 --size=10240 --ondisk=sde
 
# RAID configure.
raid /boot --fstype=ext3 --level=1 --device=md0 raid.01 raid.02 raid.03 raid.04 raid.05
raid swap                --level=5 --device=md1 raid.11 raid.12 raid.13 raid.14 raid.15
raid /     --fstype=ext4 --level=5 --device=md2 raid.21 raid.22 raid.23 raid.24 raid.25
END
elif grep -q sdd /proc/partitions; then
	### /dev/sdX RAID - This should be the majority.
	# 4-Drive RAID 5
cat >> /tmp/part-include <<END
zerombr
clearpart --all --initlabel --drives=sda,sdb,sdc,sdd
ignoredisk --only-use=sda,sdb,sdc,sdd
bootloader --location=mbr --driveorder=sda,sdb,sdc,sdd --append="crashkernel=auto"
 
## This will create a 4-drive RAID 5 array.
# The '/boot' partition. A little nuts at 6x RAID 1 but meh, what else would I
# use the 256MB parts for?
part raid.01 --size=256 --ondisk=sda
part raid.02 --size=256 --ondisk=sdb
part raid.03 --size=256 --ondisk=sdc
part raid.04 --size=256 --ondisk=sdd
 
# The swap partition. Set to RAID 5, so it's actually ~8GB. It's RAID'ed and
# not individual parts because a loss of swap can still brind down a system.
part raid.11 --size=2048 --ondisk=sda
part raid.12 --size=2048 --ondisk=sdb
part raid.13 --size=2048 --ondisk=sdc
part raid.14 --size=2048 --ondisk=sdd
 
# This is the main '/' partition for 'dom0'. The remainder of the disk space
# will be hand-crafted into a RAID 5 partition post install for either DRBD or
# iSCSI.
part raid.21 --size=20480 --ondisk=sda
part raid.22 --size=20480 --ondisk=sdb
part raid.23 --size=20480 --ondisk=sdc
part raid.24 --size=20480 --ondisk=sdd
 
# RAID configure.
raid /boot --fstype=ext3 --level=1 --device=md0 raid.01 raid.02 raid.03 raid.04
raid swap                --level=5 --device=md1 raid.11 raid.12 raid.13 raid.14
raid /     --fstype=ext4 --level=5 --device=md2 raid.21 raid.22 raid.23 raid.24
END
elif grep -q sdc /proc/partitions; then
	### /dev/sdX RAID - This should be the majority.
	# 3-Drive RAID 5
cat >> /tmp/part-include <<END
zerombr
clearpart --all --initlabel --drives=sda,sdb,sdc
ignoredisk --only-use=sda,sdb,sdc
bootloader --location=mbr --driveorder=sda,sdb,sdc --append="crashkernel=auto"
 
## This will create a 3-drive RAID 5 array.
# The '/boot' partition. A little nuts at 6x RAID 1 but meh, what else would I
# use the 256MB parts for?
part raid.01 --size=256 --ondisk=sda
part raid.02 --size=256 --ondisk=sdb
part raid.03 --size=256 --ondisk=sdc
 
# The swap partition. Set to RAID 5, so it's actually ~4GB. It's RAID'ed and
# not individual parts because a loss of swap can still brind down a system.
part raid.11 --size=2048 --ondisk=sda
part raid.12 --size=2048 --ondisk=sdb
part raid.13 --size=2048 --ondisk=sdc
 
# This is the main '/' partition for 'dom0'. The remainder of the disk space
# will be hand-crafted into a RAID 5 partition post install for either DRBD or
# iSCSI.
part raid.21 --size=20480 --ondisk=sda
part raid.22 --size=20480 --ondisk=sdb
part raid.23 --size=20480 --ondisk=sdc
 
# RAID configure.
raid /boot --fstype=ext3 --level=1 --device=md0 raid.01 raid.02 raid.03
raid swap                --level=5 --device=md1 raid.11 raid.12 raid.13
raid /     --fstype=ext4 --level=5 --device=md2 raid.21 raid.22 raid.23
END
elif grep -q sdb /proc/partitions; then
	### /dev/sdX RAID - This should be the majority.
	# 2-Drive RAID 1
cat >> /tmp/part-include <<END
zerombr
clearpart --all --initlabel --drives=sda,sdb
ignoredisk --only-use=sda,sdb
bootloader  --location=mbr --driveorder=sda,sdb --append="crashkernel=auto"
 
# /boot
part raid.01 --ondisk=sda --asprimary --size=256
part raid.02 --ondisk=sdb --asprimary --size=256
# /
part raid.11 --ondisk=sda --asprimary --size=40960
part raid.12 --ondisk=sdb --asprimary --size=40960
# <swap>
part raid.21 --ondisk=sda --asprimary --size=4096
part raid.22 --ondisk=sdb --asprimary --size=4096
 
# Format /boot and /.
raid /boot --fstype=ext3 --level=1 --device=md0 raid.01 raid.02
raid /     --fstype=ext3 --level=1 --device=md1 raid.11 raid.12
raid swap  --fstype=swap --level=1 --device=md2 raid.21 raid.22
END
elif grep -q sda /proc/partitions; then
	### /dev/sda Single drive, or hardware RAID
cat >> /tmp/part-include <<END
zerombr
clearpart --linux --drives=sda
ignoredisk --only-use=sda
bootloader --location=mbr --driveorder=sda --append="crashkernel=auto"
 
part     /boot --fstype ext3 --size=256   --asprimary
part     swap  --fstype swap --size=4096  --asprimary
part     /     --fstype ext3 --size=40960 --asprimary
END
elif grep -q xvda /proc/partitions; then
        ### /dev/xvda Xen virtual disk
	# This kickstart is designed may be used as a generic Xen VM, which is
	# likely to have minimal diskspace, so we'll knock down the allocated
	# swap and set a modest and growable '/' partition.
cat >> /tmp/part-include <<END
zerombr
clearpart --linux --drives=xvda
ignoredisk --only-use=xvda
bootloader --location=mbr --driveorder=xvda --append="crashkernel=auto"
 
part     /boot --fstype ext3 --size=256   --asprimary
part     swap  --fstype swap --size=1024  --asprimary
part     /     --fstype ext3 --size=100   --asprimary --grow
END
fi
 
%end

 

Any questions, feedback, advice, complaints or meanderings are welcome.
Alteeve's Niche! Enterprise Support:
Alteeve Support
Community Support
© Alteeve's Niche! Inc. 1997-2024   Anvil! "Intelligent Availability®" Platform
legal stuff: All info is provided "As-Is". Do not use anything here unless you are willing and able to take responsibility for your own actions.