2 将启动镜像文件pxelinux.0复制到TFTP服务器根目录,这是客户端机器刚开始启动的时候,pxe协议的引导文件。
启动镜像pxelinux.0可以在syslinux安装包里获得。安装好syslinux安装包后,将pxelinux.0复制到TFTP服务器根目录。
[root@bsvr]#cp /usr/lib/syslinux/pxelinux.0 /tftpboot/
3 将Linux安装程序的内核/根文件系统文件复制到 TFTP 服务器的根目录。对于每一个要被安装的Red Hat Linux版本,都需要执行一次该操作。
Red Hat Linux第一张安装光盘/isolinux目录下会包含Linux安装程序的内核/根文件系统文件。下面一段命令将这些文件复制到TFTP服务器的根目录下,并按照版本重新命名。initrd.img和vmlinuz,这两个文件是用来引导机器的内核和ramdisk文件,这两个文件可以改成别的文件名,需要在第五步中提高的/tftpboot/pxelinux.cfg/default文件中指定文件名即可;
[root@bsvr]#mkdir /mnt/iso
[root@bsvr]#mount -o loop,ro RHEL4-U2-i386-AS-disc1.iso /mnt/iso
[root@bsvr]#cp /mnt/iso/isolinux/initrd.img /tftpboot
[root@bsvr]#cp /mnt/iso/isolinux/vmlinuz /tftpboot
4 nfs install
cp linux iso file to nfs-path
#cp disk1.iso /tftpboot/iso/rhel4u3/
#cp disk2.iso /tftpboot/iso/rhel4u3/
#cp disk3.iso /tftpboot/iso/rhel4u3/
#cp disk4.iso /tftpboot/iso/rhel4u3/
vi /etc/exports
/tftp/iso/thel4u3/ *(r0,no_root-squash)
#service nfs restart
#service nfs reload
#检查共享时候已经正确输出
#showmount –e
5 编辑启动菜单,或安装多个版本的linux
客户端通过pxe协议引导起来之后,会在服务器的/tftpboot/pxelinux.cfg/目录(该目录需要手工建立)下寻找启动配置文件,启动配置文件中定义了应该引导哪个版本的Linux,文件名默认为default,可以将第一张安装光盘中的 /isolinux/isolinux.cfg文件复制到/tftpboot/pxelinux.cfg/,并改名为default,格式写法请参考里面已有的格式。
default rhel4u3 默认启动项
display pxelinux.cfg/list 显示的启动菜单,供用户选择
prompt 1
timeout 30
display boot.msg
F1 boot.msg
F2 options.msg
F3 general.msg
F4 param.msg
F5 rescue.msg
F7 snake.msg
label rhel4r3 具体的启动项目名称,一个label对应一个linux版本
kernel vmlinuzrhel4r3 #这个文件对应的是/tftpboot目录下的相应版本的linux “vmlinuz”
append ks=nfs:172.16.201.25:/tftpboot/iso/rhel4r3/ks-rhel4r3.cfg initrd=initrdrhel4r3.img ramdisk_size=8192 #initrd的文件对应的是/tftpboot/目录下相应的Linux版本的“initrd.img”文件,
label rhel5r1 具体的启动项目名称,一个label对应一个linux版本
kernel vmlinuzrhel5r1 #这个文件对应的是/tftpboot目录下的相应版本的linux “vmlinuz”
append ks=nfs:172.16.201.25:/tftpboot/iso/rhel5r1/ks-rhel5r1.cfg initrd=initrdrhel5r1.img ramdisk_size=8192 #initrd的文件对应的是/tftpboot/目录下相应的Linux版本的“initrd.img”文件,
#在/tftpboot目录下应该存在以下5个文件(这五个文件名中不能有大写的,否则客户端在启动的时候会报找不到相应的文件):pxelinux.0 、vmlinuzrhel4r3和initrdrhel4r3.img、
vmlinuzrhel5r1和initrdrhel5r1.img
在/tftpboot/pxelinux.cfg目录下手工建立list文件,如下:
choose one name of the following linux distribution for your installation
Name Distribution Install location
rhel4r3 rhel4 172.16.201.25:/tftpboot/iso/rhel4r3/
rhel5r1 rhel5 172.16.201.25:/tftpboot/iso/rhel5r1/
这里的name 的名字要和default文件中的label相对应,大小写应一致。
