- 论坛徽章:
- 0
|
我使用的环境是虚拟机上安装rhel5.7,应用的服务器有TFTP,DHCP,NFS,下面我将我的配置文件详细贴出,不使用autoinstall的时候可以正常实现PXE启动安装
1. TFTP服务配置与启动
Note: 为了简化配置需求,启动服务器与安装服务器配置在同一台机器上
1) 安装TFTP RPM包
[root@localhost ~]# mount -o loop /dev/cdrom /mnt
[root@localhost ~]# cd /mnt
[root@localhost mnt]# mkdir /root/dist/
[root@localhost mnt]# cp -Rvf * /root/dist/
[root@localhost mnt]# cd /root/dist/Server
[root@localhost Server]# rpm -ivh tftp-server-0.49-2.x86_64.rpm
2) 编辑TFTP配置文件
Note: TFTP是非独立应用服务,依赖于进程xinetd
[root@localhost ~]# vi /etc/xinetd.d/tftp
service tftp
{
…
server_args = -s /tftpboot # 为TFTP服务的根目录位置
disable = no # 默认是off状态,修改为no是服务启动
…
}
3) 配置TFTP引导目录及文件
配置TFTP根目录
[root@localhost ~]# cd /tftpboot
[root@localhost tftpboot]# mkdir -p release/rhel5.7/Server/x86_64/
[root@localhost isolinux]# cp /root/dist/isolinux/vmlinuz /tftpboot/release/rhel5.7/Server/x86_64/
[root@localhost isolinux]# cp /root/dist/isolinux/initrd.img /tftpboot/release/rhel5.7/Server/x86_64/
Note: vmlinuz为内核文件;initrd.img为挂载的临时根文件系统文件
[root@localhost isolinux]# cp *.msg /tftpboot/
[root@localhost isolinux]# cp /usr/lib/syslinux/pxelinux.0 /tftpboot/
建立并编辑引导客户端的配置文件
[root@localhost isolinux]# mkdir /tftpboot/pxelinux.cfg
[root@localhost isolinux]# cp isolinux.cfg /tftpboot/pxelinux.cfg/default
[root@localhost isolinux]# vim /tftpboot/pxelinux.cfg/default
…
label linux
kernel release/rhel5.7/Server/x86_64/vmlinuz
append initrd=release/rhel5.7/Server/x86_64/initrd.img
…
4) 启动TFTP服务
[root@localhost isolinux]# chkconfig tftp on
[root@localhost isolinux]# /etc/init.d/xinetd restart
2. DHCP服务配置与启动
[root@localhost ~]# rpm -qa | grep dhcp
dhcp-3.0.5-29.el5
[root@localhost ~]# vim /etc/dhcpd.conf
ddns-update-style interim;
ignore client-updates;
next-server 10.0.0.1; # 指定TFTP服务器的地址
filename “pxelinux.0”; # 位于TFTP服务器中指定的/tftpboot/
subnet 10.0.0.0 netmask 255.255.255.0 {
range 10.0.0.10 10.0.0.40;
option routers 10.0.0.254;
option subnet-mask 255.255.255.0;
default-lease-time 21600;
max-lease-time 43200;
}
[root@localhost ~]# chkconfig dhcpd on
[root@localhost ~]# /etc/init.d/dhcpd restart
3. NTFS服务配置与启动
1) 配置安装源
[root@localhost ~]# vim /etc/exports
/root/dist 10.0.0.0/24(ro,sync,no_root_squash)
[root@localhost ~]# exportfs -av
exporting 10.0.0.0/24:/root/dist
2) 启动NFS服务
[root@localhost ~]# chkconfig portmap on
[root@localhost ~]# chkconfig nfs on
[root@localhost ~]# /etc/init.d/portmap restart
[root@localhost ~]# /etc/init.d/nfs restart
[root@localhost ~]# /etc/init.d/xinetd restart
上面可以实现PXE手动安装,下面为我修改的autosintall.cfg(此文件为上面第一次PXE手动完成安装的anaconda.cfg)
我将内容复制到PXE服务器上的/root/ks/autoinstall.cfg,文件内容如下(选择的安装包未贴出)
install
nfs --server=10.0.0.1 --dir=/root/dist
key --skip
lang en_US.UTF-8
keyboard us
xconfig --startxonboot
network --device eth0 --bootproto dhcp
rootpw --iscrypted $1$CXdQK9Ej$14DP8kpqBMVuqzVPjnR2Q.
firewall --enabled --port=22:tcp
authconfig --enableshadow --enablemd5
selinux --enforcing
timezone --utc America/New_York
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 --linux
part / --fstype ext3 --size=100 --grow
part swap --size=2000
...
1. 重新配置NFS服务
[root@localhost ~]# vi /etc/exports
/root/dist 10.0.0.0/24(ro,sync,no_root_squash)
/root/ks 10.0.0.0/24(ro,sync,no_root_squash)
[root@localhost ~]# exportfs -av
[root@localhost ~]# service nfs restart
2. 修改/tftpboot/pxelinux.cfg/default
…
label linux
kernel release/rhel5.7/Server/x86_64/vmlinuz
append initrd=release/rhel5.7/Server/x86_64/initrd.img linux ks=nfs:10.0.0.1:/root/ks/autoinstall.cfg…
重新启动测试机后
会出现报错error downloading kickstart file
Unable to download the kickstart file. Please modify the kickstart parameter below or press Cancel to proceed as an interactive installation
nfs:10.0.0.1:/root/ks/autoinstall.cfg
网上查了一下,挺多人问这个问题的,但是没有一个具体的解决办法,我将我的具体配置贴出来,希望有达人帮忙研究下,谢谢!!! |
|