Kickstart Automated Installation
First you need to install the software:
Yum install–y dhcp* tftp* nfs-utils
Yum install–y syslinux (no pxelinux.0 required to install syslinux)
1 , configure the TFTP server:
vi/etc/xinetd.d/tftp change Disable = yes to No.
2 , TFTP+PXE configuration
To implement a remote installation system, you need to specify the relevant PXE kernel module and related parameters in the Tftpboot directory. The configuration steps are as follows:
mount/dev/cdrom/mnt/# Mounting Discs
ln–s/var/lib/tftpboot//# make a soft connection
Cd/tftpboot # Enter the/tftpboot directory
cp/usr/share/syslinux/pxelinux.0. # Copy the pxelinux.0
/tftpboot Catalogue
cp/mnt/images/pxeboot/{vmlinux,initrd.img}. # Copy the kernel to the TFTP directory
mkdir-p pxelinux.cfg # Create the Pxelinux.cfg directory under the/tftpboot directory
Cp/mnt/isolinux/isolinux.cfg/tftpboot/pxelinux.cfg/default
Vi/tftpboot/pxelinux.cfg/default change the content to read as follows:
Default centos6.5
Timeout 600
Display Boot.msg
Menu Background Splash.jpg
Menu title Welcome to CentOS 6.5!
Menu Color Border 0 #ffffffff #00000000
Menu Color SEL 7 #ffffffff #ff000000
Menu Color Title 0 #ffffffff #00000000
Menu Color tabmsg 0 #ffffffff #00000000
Menu Color Unsel 0 #ffffffff #00000000
Menu Color Hotsel 0 #ff000000 #ffffffff
Menu Color Hotkey 7 #ffffffff #ff000000
Menu Color ScrollBar 0 #ffffffff #00000000
Label centos6.5
Kernel Vmlinuz
Appendks=nfs:192.168.10.142:/data/centos/ks.cfg Ksdevice=eth0 initrd=initrd.img
Label Local
Give default 777 permission chmod 777 default
Configuration Note: 192.168.223.132 is a kickstart server,/data/centos is the Directory of NFS shared Linux images and the path to the Linux installation files. Ks.cfg is the Kickstart Master profile, the answer file, Ksdevice=eth0 indicates that there are multiple NICs when the client installs from eth0
3 , configure the DHCP server
Dhcp The configuration file of the server is/etc/dhcp/dhcpd.conf, and his configuration file is changed to:
Ddns-update-style Interim;
Ignore client-updates;
Next-server 192.168.223.132;
FileName "pxelinux.0";
Allow booting;
Allow BOOTP;
Subnet 192.168.223.0 netmask 255.255.255.0 {
Option routers 192.168.223.1;
Option Subnet-mask 255.255.0.0;
Range DYNAMIC-BOOTP 192.168.223.50 192.168.223.100;
Host NS {
Hardware Ethernet 00:1a:a0:2b:38:81;
Fixed-address 192.168.223.88;}
}
Configuration Description:
Subnet for the network address, netmask is the mask, which indicates which network is assigned the IP address and must be in the same network as the host.
Option Routers after the IP is assigned, the client's gateway address, Optionsubnet-mask, is the mask for the client.
Range DYNAMIC-BOOTP is the assigned IP address range.
Next-server as the address of the TFTP server, filename is the file required for PXE installation
Host NS for a MAC address, configure a fixed IP address, bind
Once configured, restart/ETC/INIT.D/DHCPD restart
4 , Nfs+kickstart configuration
Mkdir-p/data/centos
cp-a/mnt/*/data/centos/# copy all the files in the CD to the/data/centos directory
Vi/etc/exports Add a line/data/centos * (Rw,sync)
means to share the/data/centos to everyone, read and write.
CP Anaconda-ks.cfg/data/centos/ks.cfg
Configure the Kickstart file, vi/data/centos/ks.cfg change to the following:
Install
Text
NFS--server=192.168.10.142--dir=/data/centos
Lang en_US. UTF-8
Keyboard US
Network--onboot no--deviceeth0--bootproto DHCP--noipv6
ROOTPW jf.com
Firewall--disabled
Authconfig--enableshadow--passalgo=sha512
SELinux--disabled
TimeZone Asia/shanghai
Bootloader--LOCATION=MBR--DRIVEORDER=SDA--append= "Crashkernel=auto rhgb quiet"
Clearpart--all--initlabel
ZEROMBR Yes
Part/boot--fstype=ext4--size=200
Part/--FSTYPE=EXT4--size=8000
Part/data--FSTYPE=EXT4--grow--size=1000
Part swap--size=1024
%packages
@development
@core
@server-policy
@workstation-policy
%end
Reboot
Give Ks.cfg 777 permission chmod 777 Ks.cfg
5 , restart all services
/ETC/INIT.D/DHCPD restart
/etc/init.d/xinetd restart
/etc/init.d/rpcbind restart
/etc/init.d/nfs restart
Client Testing
Kickstart automated Installation