The following steps must be performed to prepare for a PXE installation:
- Configure the network (NFS, FTP, HTTP) server to export the installation tree.
- Configure the files on the tftp server necessary for PXE booting.
- Configure which hosts are allowed to boot from the PXE configuration.
- Start the tftp service.
- Configure DHCP.
- Boot the client, and start the installation.
以上为官方文档介绍,下面是我做的步骤:
确定NIC有PXE启动功能
1、配置NFS server,建立一个共享目录(/linuxos/rhel4.0_update2这个共享目录是我建立的),用于放置redhat AS 4 的安装文件。
把第一张光盘中 Redhat目录下所有的内容 全部CP到/linuxos/rhel4.0_update2,第二、三、四张光盘中的RPMS也CP到/linuxos/rhel4.0_update2/RedHat/RPMS目录中。
vi /etc/exports
/linuxos/rhel4.0_update2 *(ro,sync) #设置共享目录
service nfs start #启动nfs服务器
2、配置PXE引导所必需的tftp服务器上的文件。
要启动机器,就必须有PXElinux。这个由syslinux、isolinux派生出来的,支持PXE的bootloader,它可以实现远程通过PEX启动机器。如下:
a、把/usr/lib/syslinux/pxelinux.0拷到/tftpboot/linux-install目录下
b、把RedHat第一张安装光盘上images/pxeboot目录下的initr.img和vmlinux也复制到/tftpboot/linux-install目录下
c、在RedHat第一张安装光盘isolinux/下有一个isolinux.cfg文件,把它cp成/tftpboot/linux-install/pxelinux.cfg/default文件(/tftpboot/linux-install/pxelinux.cfg目录用于放syslinux的配置文件,而现成可用的配置文件就是RedHat第一张安装光盘isolinux/下有一个isolinux.cfg文件)
d、把redhat第一张isolinux/*.msg考到/tftpboot/linux-install下
e、对default(也就是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
F7 snake.msg
label linux
kernel vmlinuz
append initrd=initrd.img
label text
kernel vmlinuz
append initrd=initrd.img text
label expert
kernel vmlinuz
append expert initrd=initrd.img
label lowres
kernel vmlinuz
append initrd=initrd.img lowres
3、启动tftp服务
chkconfig tftp on # 打开xinetd代理的tftp服务
service xinetd restart # 重启动服务
4、配置DHCP服务器:
ddns-update-style interim;
ignore client-updates;
allow booting; #注意这里
allow bootp; #注意这里
subnet 172.16.16.0 netmask 255.255.255.0 {
# — default gateway
option routers 172.16.16.1;
option subnet-mask 255.255.255.0;
option nis-domain ”hulin.li”;
option domain-name ”hulin.li”;
option domain-name-servers 172.16.16.1,61.144.56.100;
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 172.16.16.16 172.16.16.20;
default-lease-time 21600;
max-lease-time 43200;
filename”/linux-install/pxelinux.0″; #注意这里
}
5、以上的全部完成后,就可以全部启动以上服务,注意要把IP地址改为和DHCP服务器地址同一网段。启动服务:
service nfs start #启动nfs server
service xinetd start #启动tftp server
service dhcpd start #启动dhcp server
6、启动Client,设置BIOS为NIC启动。然后就可以安装了!
注意:
等待处理的问题如下:
1、官方网站上面的Configure which hosts are allowed to boot from the PXE configuration.这一步我不怎么明白,为什么要配置这个呢??呵,等以后去处理这个。
2、当我把ISO文件直接搞到共享目录中时,无法安装
3、实验http、FTP等方式的安装
下面贴出些相关实用的关键性文件:
-bash-3.00# cat default
default 1
prompt 1
timeout 600
display boot.msg
F1 boot.msg
F2 options.msg
F3 general.msg
F4 param.msg
F5 rescue.msg
F7 snake.msg
label 1
kernel /rhel4.0_update2/vmlinuz
append initrd=/rhel4.0_update2/initrd.img ramdisk_size=8192
label 2
kernel /rfas5.0/vmlinuz
append initrd=/rfas5.0/initrd.img ramdisk_size=8192
label 3
kernel /ubuntu6.06/linux
append vga=normal initrd=/ubuntu6.06/initrd.gz ramdisk_size=14332 root=/dev/rd/0 rw–
label expert
kernel vmlinuz
append expert initrd=initrd.img ramdisk_size=8192
label ks
kernel vmlinuz
append ks initrd=initrd.img ramdisk_size=8192
label lowres
kernel vmlinuz
append initrd=initrd.img lowres ramdisk_size=8192
label local
localboot 1
label memtest86
kernel memtest
append -
-bash-3.00#
-bash-3.00# cat boot.msg
***** rescue mode : type ‘number rescue’ just as ‘1 rescue’
***** 1 - rhel4.0_update2
- NFS - 10.0.2.2 - /linuxos/rhel4.0_update2/
- FTP - 192.168.1.253 - /linuxos/rhel4.0_update2/
***** 2 - rfas5.0
- NFS - 10.0.2.2 - /linuxos/rfas5.0/
- FTP - 192.168.1.253 - /linuxos/rfas5.0/
***** 3 - ubuntu6.06
- NFS - 10.0.2.2 - /linuxos/ubuntu6.06/
- FTP - 192.168.1.253 - /linuxos/ubuntu6.06/
-bash-3.00#