64搭建RHCE6实验环境(3)

7.创建kickstart文件,用system-config-kickstart,保存文件为/var/ftp/pub/vtks.cfg,内容如下:
#platform=x86, AMD64, or Intel EM64T
#version=DEVEL
# Firewall configuration
firewall --disabled
# Install OS instead of upgrade
install
# Use network installation
url --url="ftp://192.168.201.254/pub/CentOS6"
# Root password
rootpw --iscrypted $1$4GsqExZv$ObJLH8rkTqvC5umLLUH4q1
# System authorization information
auth --useshadow --passalgo=sha512
# Use text mode install
text
firstboot --disable
# System keyboard
keyboard us
# System language
lang en_US
# SELinux configuration
selinux --enforcing
# Installation logging level
logging --level=info
# Reboot after installation
reboot
# System timezone
timezone --isUtc Asia/Shanghai
# Network information
network --bootproto=dhcp --device=eth0 --onboot=on
# System bootloader configuration
bootloader --location=mbr
# Partition clearing information
clearpart --all --initlabel
# Disk partitioning information
part /boot --fstype="ext4" --size=100
part swap --fstype="swap" --size=1000
part / --fstype="ext4" --size=5000

%post
#Configure hostname
NUM=$(ifconfig eth0 | grep 'inet addr' | awk '{print $2}' | cut -d. -f4)
if [ -z "$NUM" ]
then
echo -e "\033[31mWrong number, please check network settings\033[0m"
exit 2
else
echo -e "NETWORKING=yes" > /etc/sysconfig/network
echo -e "HOSTNAME=station$NUM.example.com" >> /etc/sysconfig/network
fi
#finished log
echo "Installation finished via ftp boot" >> /root/ftpboot-$(date +%Y-%m-%d).log
%end

10.最后重启下network,dhcpd,xinetd确保pxe环境都起来
service network restart
service network xinetd
service network dhcpd

11.好啦,找个客户机装下系统,记住进BIOS看看,确保网卡ROM的PXE功能打开。

总结:该PXE功能较简单,主要靠dhcp+tftp/vsftp+kickstart,且ftp中系统安装目录单一,做好每个版本

下设有x86,x64版本,还有没加入windows的安装项,也没用DNS服务因而直接使用了ip地址作为ftp服务确保安装过程不出错。

linux

内容版权声明:除非注明,否则皆为本站原创文章。

转载注明出处:https://www.heiqu.com/20368.html