免费注册 查看新帖 |

Chinaunix

  平台 论坛 博客 文库
12下一页
最近访问板块 发新帖
查看: 28936 | 回复: 16

RHEL5.7 PXE配置实现autoinstall的问题:error downloading kickstart file [复制链接]

论坛徽章:
0
发表于 2011-08-07 04:56 |显示全部楼层
我使用的环境是虚拟机上安装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

网上查了一下,挺多人问这个问题的,但是没有一个具体的解决办法,我将我的具体配置贴出来,希望有达人帮忙研究下,谢谢!!!

论坛徽章:
0
发表于 2011-08-07 09:31 |显示全部楼层
回复 1# hushan1985


      initrd=release/rhel5.7/Server/x86_64/initrd.img     ks=nfs:10.0.0.1:/root/ks/autoinstall.cfg

      先自己测试NFS 是否正常  再看是否 防火墙 selinux  是否允许等

论坛徽章:
0
发表于 2011-08-07 09:38 |显示全部楼层
回复 1# hushan1985


    http://baidu.blog.51cto.com/71938/158675  这个是个人认为 写的很不错的 你可以自己看下

论坛徽章:
0
发表于 2011-08-07 10:57 |显示全部楼层
回复 2# taojie2000


    这些基本的测试环境要求我觉得一般是不会犯错的,要不第一次PXE通过NFS安装也不会实现吧

论坛徽章:
0
发表于 2011-08-07 11:09 |显示全部楼层
回复 4# hushan1985


    自己先对照着再走一遍看看哪的问题  那篇文章是没问题的!

论坛徽章:
0
发表于 2011-08-07 11:22 |显示全部楼层

论坛徽章:
0
发表于 2011-08-07 12:20 |显示全部楼层
按照你说的 我完全按照上面进行了配置,问题依旧
DHCP配置文件
#
# DHCP Server Configuration file.
#   see /usr/share/doc/dhcp*/dhcpd.conf.sample
#
ddns-update-style       interim;
ignore                  client-updates;
allow                   booting;
allow                   bootp;

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;
        next-server             10.0.0.1;
        filename                "pxelinux.0";
}

NFS配置文件
/mnt/install    *(ro,sync)

DEFAULT配置文件
default linux
prompt 1
timeout 600
display boot.msg
F1 boot.msg
F2 options.msg
F3 general.msg
F4 param.msg
F5 rescue.msg
label linux
  kernel vmlinuz
  append ks=nfs:10.0.0.1:/mnt/install/ks.cfg initrd=initrd.img

论坛徽章:
0
发表于 2011-08-08 19:07 |显示全部楼层
回复 1# hushan1985


   我的是在rhel6上做的,客户端也是出现了这个错误提示,做了好多遍了,还是一样,现在不知道怎么办了

论坛徽章:
0
发表于 2012-01-16 12:19 |显示全部楼层
我的问题就更奇怪了在我虚拟机上面可以安装成功 真的机器也是报这个错误
求达人解决

论坛徽章:
0
发表于 2012-01-16 14:09 |显示全部楼层
问题应该出现在网络上面,你的虚拟机和物理机是同一台机器,所以安装就没问题。而报错也是了是download ks文件的时候出现error,检查下你的网络环境。
您需要登录后才可以回帖 登录 | 注册

本版积分规则 发表回复

  

北京盛拓优讯信息技术有限公司. 版权所有 京ICP备16024965号-6 北京市公安局海淀分局网监中心备案编号:11010802020122 niuxiaotong@pcpop.com 17352615567
未成年举报专区
中国互联网协会会员  联系我们:huangweiwei@itpub.net
感谢所有关心和支持过ChinaUnix的朋友们 转载本站内容请注明原作者名及出处

清除 Cookies - ChinaUnix - Archiver - WAP - TOP