Chinaunix

标题: pxe ks安装rhel5出现问题,请各位高手指点。 [打印本页]

作者: jasonyy77    时间: 2009-05-24 05:15
标题: pxe ks安装rhel5出现问题,请各位高手指点。
我有两台虚拟机做实验。

192.168.1.201    dhcp+tftp+安装源+http(ks来源)
我把rhel5的ISO光盘挂到/var/ftp/pub/Server/下,这就是我的安装源

dhcp配置文件如下:(应该不会有问题)
################################################
ddns-update-style interim;
ignore client-updates;
allow booting;
allow bootp;
subnet 192.168.1.0 netmask 255.255.255.0 {

option routers 192.168.1.1;
option domain-name-servers 192.168.1.1;
option time-offset -18000;
option root-path "/tftpboot";

range dynamic-bootp 192.168.1.12 192.168.1.24;
default-lease-time 21600;
max-lease-time 43200;

next-server 192.168.1.201;
filename "/pxelinux.0";
}
#####################################################


tftp的配置文件如下:(也应该不会有问题)
###################################################

service tftp
{
        socket_type             = dgram
        protocol                = udp
        wait                    = yes
        user                    = root
        server                  = /usr/sbin/in.tftpd
        server_args             = -u nobody -s /tftpboot
        disable                 = no
        per_source              = 11
        cps                     = 100 2
        flags                   = IPv4
}
###################################################


/tftpboot 下面的结构:

initrd.img  
linux(本来应该是vmlinuz)
menu.c32  
pxelinux.0  
pxelinux.conf  
      |
      -- default

[root@station201 pxelinux.conf]# more default
######################################################
default menu.c32
prompt 1
timeout 9999999

MENU TITLE Enjoying the RHCE class.
LABEL rescue
MENU LABEL Boot in a RHEL5.3 rescue mode
kernel vmlinuz
append initrd=initrd.img rescue


MENU SEPARATOR

LABEL Einstall
MENU LABEL ^Automatical install RHEL5.3 in ^English
kernel menu.c32
append ksdevice=eth0 load_ramdisk=1 initrd=initrd.img network ks=nfs:192.168.1.2
01:/var/ftp/pub/ks/ks.cfg noipv6

MENU SEPARATOR

LABEL Cinstall
MENU LABEL ^Automatical install RHEL5.3 in ^Chinese
kernel vmlinuz
append ksdevice=eth0 load_ramdisk=1 initrd=initrd.img network ks=nfs:192.168.1.2
01:/var/ftp/pub/ks/ks.cfg noipv6


MENU SEPARATOR

LABEL linux
MENU LABEL Install RHEL5.3 ^Manually
kernel vmlinuz
append ksdevice=eth0 load_ramdisk=1 initrd=initrd.img network ks=nfs:192.168.1.2
01:/var/ftp/pub/ks/ks.cfg noipv6


#############################################################




到这里我先谢谢各位看完上面的一大串描述,辛苦了。
下面是我的一些疑问,请各位再辛苦下。谢谢:

一:按照这个配置,我可以用光盘启动后,用我的ks.cfg和安装源安装一个系统出来。
但是我用pxe引导就不行。
可以读到kernel(这里不太知道为什么,有个问题,等会再说),但是initrd确不行。引导启动的时候报如下信息:
EXT2-fs: unable to read superblock
isofs_fill_super: bread failed,dev=md1, iso_blknum=16, block=32
No filesystem could mount root,tried: ext2 iso9660
Kernel panic - not syncing : VFS:Unable to mount root fs on unknown-block(9,1)


IP知道回去时没有问题的,tftp我测试也可以。安装源和ks.cfg我也测试过。

就是这个pxe我没有办法找出错误。我一天在网上连续找了快24小时了。。。。。苦啊。。请大家帮忙。


二:刚才说到读kernel那里有个问题。问题如下:
我在/tftpboot/pxelinux.conf/default文件中写的是  kernel vmlinuz


但是为什么我的核心叫vmlinuz的时候,不能引导,报找不到kernel: linux
然后我把vmlinuz改名,叫linux就可以引导。。。
郁闷。。。



三:最后一个问题:
我放在/tftpboot下的menu.c32的作用好像是在引导的时候出现一个菜单,可以选择你要安装的方式之类的。。
但是一直没有出现。如果有人知道请指点下。谢谢。
作者: marsaber    时间: 2009-05-24 07:46
附上我的:
1、tftp的设置,只开启,其他默认就可以了;


2、/etc/dhcpd.conf
ddns-update-style interim;
ignore client-updates;
subnet 10.10.10.0 netmask 255.255.255.0 {
# --- default gateway
        option routers   10.10.10.254;       #网关;
        option subnet-mask  255.255.255.0;   #子网掩码;
        option nis-domain  "domain.org";
        option domain-name  "domain.org";
        option domain-name-servers 218.30.19.40;    #DNS;
        filename "pxelinux.0";      #重点!/tftpboot/pxelinux.0
       next-server 10.10.10.3;     #重点!DHCP服务器;
        option time-offset  -18000; # Eastern Standard Time
# option ntp-servers  192.168.1.1;
# option netbios-name-servers 192.168.1.1;
# --- Selects point-to-point node (default is hybrid). Don't change this unless
# -- you understand Netbios very well
# option netbios-node-type 2;
        range dynamic-bootp 10.10.10.101 10.10.10.150;
        default-lease-time 21600;
        max-lease-time 43200;
# we want the nameserver to appear at a fixed address
        host ns {
        next-server marvin.redhat.com;
        hardware ethernet 12:34:56:78:AB:CD;
        fixed-address 207.175.42.254;
}
}

3、准备工作
[root@server1 ~]# cp /usr/lib/syslinux/pxelinux.0 /tftpboot/
[root@server1 ~]# mount -o loop /home/marsaber/rhel-server-5.3-i386-dvd.iso /media/cdrom
[root@server1 ~]# cp /media/cdrom/isolinux/* /tftpboot/
[root@server1 ~]# mkdir /tftpboot/pxelinux.cfg
[root@server1 ~]# mv /tftpboot/isolinux.cfg /tftpboot/pxelinux.cfg/default

4、/tftpboot/pxelinux.cfg/default(默认的/media/cdrom/isolinux/isolinux.cfg)
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 initrd=initrd.img
label text
  kernel vmlinuz
  append initrd=initrd.img text
label ks
  kernel vmlinuz
  append ks initrd=initrd.img
label local
  localboot 1
label memtest86
  kernel memtest
  append -

5、至于NFS安装,还是ftp安装就根据自己爱好吧!

6、客户机网络引导。OK


如果使用Kickstart自动安装,/tftpboot/pxelinux.cfg/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 initrd=initrd.img
label text
    kernel vmlinuz
    append initrd=initrd.img text
label ks
    kernel vmlinuz
    append ks=nfs:10.10.10.5:/tftpboot/ks.cfg initrd=initrd.img
label local
    localboot 1
label memtest86
    kernel memtest
    append -

然后设置好ks.cfg就可以了!
作者: yqy0227    时间: 2013-11-16 13:39
这个问题是怎么解决的?
作者: yqy0227    时间: 2013-11-16 13:50
我也遇到了这个问题   愁愁愁  ·····················································!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!




欢迎光临 Chinaunix (http://bbs.chinaunix.net/) Powered by Discuz! X3.2