This guide explain how to install and configure kickstart server for network based deployments of CentOS, from an NFS share.
The instructions should work the same on RedHat and Fedora.
Requirement:
* CentOS 5.5 DVD
* Static IP address for the Kickstart/DHCP server
* /data partition or any other
Installation Steps:
1. Login to the CentOS server using Root account.
2. Mount the CentOS DVD. Command would be : mount /dev/cdrom /media
3. Move to the CentOS RPM folder inside the DVD: cd /media/CentOS
4. Run the command bellow to install the TFTP-Server:
rpm -ivh xinetd-2.3.14-10.el5.i386.rpm
rpm -ivh tftp-server-0.49-2.el5.centos.i386.rpm
(If you get dependency error, download all necessary packages using "yum")
5. Run the command bellow to install the DHCP server:
rpm -ivh dhcp-3.0.5-23.el5.i386.rpm
6. Create new folder for the Kickstart server:
mkdir -p /data/kickstart
7. Edit using "vi", the file /etc/xinetd.d/tftp and change the following settings:
From:
disable = yes To: disable = no
From:
server_args = -s /tftpboot To: server_args = -s /data/kickstart
8. Run the command bellow to start the TFTP server:
/sbin/service xinetd start
9. Run the command bellow to start the TFTP server run at startup:
chkconfig xinetd on
10. Edit using "vi", the file /etc/dhcpd.conf and add the following lines:
ddns-update-style none;
allow bootp;
allow booting;
subnet 10.1.1.0 netmask 255.255.255.0 {
option routers 10.1.1.254;
option domain-name-servers 10.1.1.2;
next-server 10.1.1.1;
filename "pxelinux.0";
range dynamic-bootp 10.1.1.200 10.1.1.210;
}Note 1: Replace 10.1.1.0 with the correct network ID.
Note 2: Replace 255.255.255.0 with the correct subnet mask.
Note 3: Replace 10.1.1.254 with the correct default gateway.
Note 4: Replace 10.1.1.1 with the Kickstart server IP address.
Note 5: Replace 10.1.1.200 with the first IP of the DHCP pool.
Note 6: Replace 10.1.1.210 with the last IP of the DHCP pool.
Note 7: Replace 10.1.1.2 with the correct DNS server.
11. Start the DHCP server
service dhcpd start or /etc/init.d/dhcpd start
12. Run the command bellow to start the DHCP server run at startup:
chkconfig dhcpd on
13. Copy Boot Files
cp /usr/lib/syslinux/{pxelinux.0,menu.c32,memdisk,mboot.c32,chain.c32} /data/kickstart
14. Create a folder for the PXE menu files:
mkdir -p /data/kickstart/pxelinux.cfg
15. Move to the CentOS DVD root folder:
cd /media
16. Copy vmlinuz and initrd.img from the DVD to the images directory:
cp /media/images/pxeboot/{vmlinuz,initrd.img} /data/kickstart/images
17. Create the CentOS DVD structure:
cp -r CentOS /data/kickstart/
cp -r isolinux /data/kickstart/
cp -r repodata /data/kickstart/
cp -r images /data/kickstart/
18. Create using "vi", the file /data/kickstart/pxelinux.cfg/default with the following content:
default menu.c32
prompt 0
MENU TITLE PXE Menu
LABEL CentOS
MENU LABEL CentOS
KERNEL images/vmlinuz
append initrd=images/initrd.img vga=normal network ks=nfs:10.1.1.1:/data/kickstart/ks.cfg textNote: Replace 10.1.1.1 with the Kickstart server IP address.
19. Create an unattended installation script /data/kickstart/ks.cfg
Note: Make sure the file starts with the following lines:
install
nfs --server=10.1.1.1 --dir=/data/kickstartNote 1: Replace 10.1.1.1 with the Kickstart server IP address.
Note: Make sure the lines beginning with “cdrom” and “url” does not exist on the file.
Note: To review ks.cfg file options, see the link:
http://www.redhat.com/docs/en-US/Red_Hat_Enterprise_Linux/5.4/html/Installation_Guide/s1-kickstart2-options.html
20. Edit using "vi", the file /etc/exports and add the following line:
/data/kickstart *(ro,no_root_squash)
21. Start the NFS service:
service portmap start
service nfs start
chkconfig nfs on
That' it.
This blog can be helpful who are interested in Linux,having basic knowledge of Linux Operating System & want to follow different Linux Based Services It contains direct justified hand's on exercise without making more concentration on Theory. Suggestions are welcomed.
About Me
Friday, April 29, 2011
Wednesday, April 20, 2011
Alert "Disk Usage" on your email id
Hello,
Below shell script shows "Hard Disk Usage" on your email address on regular basis.
Step:1
Below shell script shows "Hard Disk Usage" on your email address on regular basis.
Step:1
Make a file & named "disk-alert" & copy below contents in it.
######################################################################
# set admin email so that you can get email
ADMIN="abc@xyz.com" (Mention Your Mail Id Here)
# set alert level 90% is default (Set Usage Level as per the need)
ALERT=90
df -H | grep -vE '^Filesystem|tmpfs|cdrom' | awk '{ print $5 " " $1 }' | while read output;
do
#echo $output
usep=$(echo $output | awk '{ print $1}' | cut -d'%' -f1 )
partition=$(echo $output | awk '{ print $2 }' )
if [ $usep -ge $ALERT ]; then
echo "Running out of space \"$partition ($usep%)\" on $(hostname) as on $(date)" |
mail -s "Alert: Almost out of disk space $usep" $ADMIN
fi
done
######################################################################
Step:2
Edit "crontab" & make below setting.
crontab -e
59 23 * * * /root/script/diskalert
Save & Exit (:wq)
Step:3
service crond start
service sendmail start
chkconfig crond on
chkconfig sendmail on
Please Note : You can use any other mail service in your network as per the availability.
Conclusion:
This shell script will give you "Disk Usage" output on the mentioned email id on daily basis @ 23 Hrs:59 Minutes
Note: Thanks to "cyberciti.biz" to make such a nice effort to make my post more powerful.
Subscribe to:
Posts (Atom)