PXE Network Installation using Kickstart method


In my previous post, i have explained how to configure the network boot installation using ftp daemon. So after ftp starts, user have to manually install the linux according to their setup.

Here we are going to see to automatic installation of linux machine. ie., No need of manuall steps

Please make sure the following services are correctly configured and running.

1. DHCP
2. PXE
3. FTP

Step 1: Kickstart Configuration

[root@server.local ~]# mkdir /data/pxe
[root@server.local ~]# cp anaconda-ks.cfg /data/pxe
[root@server.local ~]# vi /data/pxe/anaconda-ks.cfg

install
ftp --server 192.168.1.5 --dir /var/ftp/redhat/5/i386/
lang en_US.UTF-8
keyboard us-acentos
xconfig --startxonboot
rootpw --iscrypted $13d35490GqgJeixe32VWXX
firewall --enabled --port=22:tcp
authconfig --enableshadow --enablemd5
selinux --disabled
timezone --utc America/Los_Angeles
bootloader --location=mbr --driveorder=sda --append="rhgb quiet"
# The following is the partition information you requested
# Note that any partitions you deleted are not expressed
# here so unless you clear all partitions first, this is
# not guaranteed to work
clearpart --all --drives=sda
part /boot --fstype ext3 --size=100 --ondisk=sda
part pv.2 --size=0 --grow --ondisk=sda
volgroup VolGroup00 --pesize=32768 pv.2
logvol swap --fstype swap --name=LogVol01 --vgname=VolGroup00 --size=2048
logvol / --fstype ext3 --name=LogVol00 --vgname=VolGroup00 --size=5120

%packages
@admin-tools
@base
@core
@dialup
@editors
@gnome-desktop
@graphical-internet
@graphics
@java
@legacy-software-support
@office
@printing
@sound-and-video
@text-internet
@base-x
kexec-tools
iscsi-initiator-utils
keyutils
trousers
fipscheck
device-mapper-multipath
sgpio
emacs
bind
bind-chroot
bind-devel
caching-nameserver
compat-libstdc++-33
compat-glibc
gdb
ltrace
ntp
OpenIPMI-tools
screen
sendmail-cf
strace
sysstat
-bluez-utils

%post
/usr/bin/yum -y update >> /root/pxe_install.log 2>&1
/sbin/chkconfig ntpd on
/sbin/chkconfig named on

Step 2: NFS Server

[root@server.local ~]# vi /etc/exports

Add the below line

/data 192.168.1.0/24(ro,no_root_squash)

[root@server.local ~]# /etc/init.d/nfs restart

Step 3: Bootloader configuration

[root@server.local ~]# vi /tftpboot/pxelinux.cfg/default

Add the below lines in EOF

LABEL Redhat Enterprise Linux 5
KERNEL images/redhat/5/i386/vmlinuz
APPEND vga=normal initrd=images/redhat/5/i386/initrd.img network ks=nfs:192.168.1.5:/data/pxe/anaconda-ks.cfg

Step 4: Start or restart the necessary daemons

[root@server.local ~]# service vsftpd restart
[root@server.local ~]# service xinetd restart
[root@server.local ~]# service nfs restart
[root@server.local ~]# service dhcpd restart

Make the daemons start at boot level

[root@server.local ~]# chkconfig vsftpd --level 35 on
[root@server.local ~]# chkconfig xinetd --level 35 on
[root@server.local ~]# chkconfig nfs --level 35 on
[root@server.local ~]# chkconfig dhcpd --level 35 on

Leave a comment

1 Comment

  1. Memory(RAM) test using PXE environment | Linux and Open Source Technologies

Leave a comment