一、安装过程kickstartDhcpTftpNfs
1.环境
Vmware Workstation 9.0CentOS-6.3-i386-bin-DVD
技术交流Q群:298148856
2.安装
[root@localhost ~]# rpm -qa |grep nfs-utilsnfs-utils-lib-1.1.5-4.el6.i686
nfs-utils-1.2.3-26.el6.i686
[root@localhost ~]#
[root@localhost ~]# rpm -qa |grep dhcp-devel
dhcp-devel-4.1.1-31.0.1.P1.el6.centos.1.i686
[root@localhost ~]#
如没有进行安装
yum install dhcp-devel nfs-utils xinetd tftp-server pykickstart syslinux
chkconfig --level 123456 dhcpd on
chkconfig --level 123456 tftp on
chkconfig --level 123456 nfs on
chkconfig --level 123456 xinetd on
chkconfig --level 123456 rpcbind on
mkdir /kickstart /install
[root@localhost home]# vim /etc/dhcp/dhcpd.conf
#
# DHCP Server Configuration file.
# see /usr/share/doc/dhcp*/dhcpd.conf.sample
# see 'man 5 dhcpd.conf'
ignore client-updates;
allow booting;
allow bootp;
subnet 192.168.100.0 netmask 255.255.255.0 {
option routers 192.168.100.1;
option subnet-mask 255.255.255.0;
default-lease-time 21600;
max-lease-time 43200;
range 192.168.100.128 192.168.100.140;
filename "/kickstart/ks.cfg";
next-server 192.168.100.1;
}
option space PXE;
class "PXE" {
match if substring(option vendor-class-identifier, 0, 9) = "PXEClient";
option vendor-encapsulated-options 01:04:00:00:00:00:ff;
option boot-size 0x1;
filename "pxelinux.0";
option tftp-server-name "192.168.100.128";
}
[root@localhost home]# vim /etc/xinetd.d/tftp
# default: off
# description: The tftp server serves files using the trivial file transfer \
# protocol. The tftp protocol is often used to boot diskless \
# workstations, download configuration files to network-aware printers, \
# and to start the installation process for some operating systems.
service tftp
{
disable = no
socket_type = dgram
protocol = udp
wait = yes
user = root
server = /usr/sbin/in.tftpd
server_args = -s /var/lib/tftpboot
per_source = 11
cps = 100 2
flags = IPv4
}
cp /usr/share/syslinux/pxelinux.0 /var/lib/tftpboot
cp /mnt/images/pxeboot/initrd.img /var/lib/tftpboot
cp /mnt/images/pxeboot/vmlinuz /var/lib/tftpboot
mkdir /var/lib/tftpboot /pxelinux.cfg
cp /mnt/isolinux/isolinux.cfg /var/lib/tftpboot/pxelinux.cfg/default
将default文件下面内容
label linux
menu label ^Install or upgrade an existing system
menu default
kernel vmlinuz
append initrd=initrd.img
修改成
label linux
kernel vmlinuz
append ksdevice=eth0 load_ramdisk=1 initrd=initrd.img network ks=nfs:192.168.100.128:/kickstart/ks.cfg noipv6
3.自定义root密码
[root@localhost ~]# perl -e 'print crypt("jngd!!!!!!",q($1$BYSimLw0)),"\n"' $1$BYSimLw0$9zfbFAPUuuXM8K/iLaSec1 [root@localhost ~]# ……………………………… url --url="http://192.168.100.128/centOS6" rootpw --iscrypted $1$BYSimLw0$9zfbFAPUuuXM8K/iLaSec1 auth --useshadow --passalgo=sha512 …………………………………… |
二、常见问题及解决方法
1.出现TFTP PXE-T01: File not found PXE-E3B: TFTP Error �CFile
在客户端启动时出现下面问题解决方法:
原因为tftp工作目录在/var/lib/tftp ,配置时按照网上文档配置到了/tftpboot,所以出现以上错误
查看tftp 工作目录,下面红色字体
[root@localhost tftpboot]# cat /etc/xinetd.d/tftp
service tftp
{
disable = no
socket_type = dgram
protocol = udp
wait = yes
user = root
server = /usr/sbin/in.tftpd