PXE Remote Boot --Linux
2024-07-21 02:36:39
供稿:网友
 
             
  文件目的﹕
  	在 linux 上建置 PXE server ﹐并利用网络激活 Windows 系统。
  
  操作系统版本﹕
  	Server:	
  		OS:	RedHat Linux 7.3
  		ip:	192.168.100.73
  		hostname: rh73.siyongc.domain
                                                                                              	Client:	
  		OS:	Microsoft Windows SE
  		IP:	192.168.100.26
  		hostname: diamond.siyongc.domain
  
  程序版本﹕
  	Linux:	BpBatch (tar.gz) (02/11/2000)
  		http://www.bpbatch.org/downloads/bpb-exe.tar.gz
  	Windows: BpBatch (zip) (02/11/2000)
  		http://www.bpbatch.org/downloads/bpb-exe.zip
  	PXE:	2.0 (built-in NIC)
  
  ----------------------------------------------
  
  -----------
  Server 实作﹕
  
  1) 确定在 server 上装有这些套件﹕
  	dhcp
  	nfs-utils
  	portmap
  	ttFTP-server
     假如没有﹐请用 rpm 安装好。例如 cd3 的 tftp-server 之安装如下﹕
  	rpm -ivh /mnt/cdrom/RedHat/RPMS/tftp-server-0.28-2.i386.rpm
  
  2) 确定 tftp 服务有激活﹐修改 /etc/xinetd.d/tftp 檔﹕
  	disable = no
  
  3) 修改 /etc/dhcpd
  
  default-lease-time 864000;
  max-lease-time 1296000;
  
  use-host-decl-names on;
  
  shared-network siyongc {
          option domain-name "siyongc.domain";
  
          subnet  192.168.100.0 netmask 255.255.255.0 {
                  range 192.168.100.100 192.168.100.200;
                  option broadcast-address 192.168.100.255;
                  option routers 192.168.100.73;
                  option domain-name-servers 192.168.100.73, 168.95.1.1;
                  option netbios-name-servers 192.168.100.73;
  
                  group {
                          default-lease-time -1;
                          next-server 192.168.100.73;
                  #       option dhcp-class-identifier "PXEClient";
                          option vendor-encapsulated-options 01:04:00:00:00:ff;
  
                          host diamond {
                                  hardware ethernet 00:50:04:C1:EA:9C; 
                                  fixed-address 192.168.100.26;
                                  option broadcast-address 192.168.100.255;
                                 option option-135 "win98";
                                  filename "bpbatch";
                          }
                  }
          }
  }
  
  4) 重新激活以上 service ﹐并确定在开机的时候能够激活﹕
  	for SRV in network dhcpd portmap nfs nfslock xinetd; do
  		service $SRV restart
  		chkconfig $SRV on
  	done
  
  5) 下载 bpbatch 软件﹕
  	cd /tftpboot
  	wget http://www.bpbatch.org/downloads/bpb-exe.tar.gz
  	tar zxvf bpb-exe.tar.gz
  	mv bpbatch.P bpbatch
   
  6) 撰写 win98 之 batch 檔﹐建立 /tftpboot/win98.bpb ﹐内容如下﹕
  	hidelog
  	setpartitions "fat32:2000"
  	setbootpart 1
  	clean 1
  	fullunzip "win98.imz" 1
  	hidebootPRom
  	hdboot :1
  
  
  -----------
  Client 实作
  
  1) 安装样板主机﹐确定系统全部装在 C﹕磁盘。
                         
  
  2) 完成所有设定。
  
  3) 从网络下载 bpb-exe 压缩文件﹕
  	http://www.bpbatch.org/downloads/bpb-exe.zip
  
  4) 建立 c:/temp/bpb-exe 目录(请不要使用其它路径)﹐并将档案解压之该目录中。
  
  5) 撰写压缩批次档﹐建立 c:/temp/bpb-exe/zipwin.mrz 档﹐内容如下﹕
  	showlog
  	filter -"windows/schedlog.txt"
  	filter -"windows/msimgsiz.dat"
  	filter -"*/index.dat"
  	filter -"*.swp"
  	filter -"*.tmp"
  	filter -"temp/*"
  	fullzip "c:/" "win98.imz"
  
  6) 然后进入 dos 模式﹐并执行如下命令﹕
  	c:
  	cd c:/temp/bpb-exe
  	mrzip -b zipwin		# 注重﹕参数档去掉 .mrz 扩展名。
  
  6) 假如没错误信息的话﹐上面会产生两个(或多个)压缩档﹐名称分别为﹕
  	win98.imz
  	win98.im1
  
  7) 不管使用何种方法﹐将以上两个档案复制到 server 端的 /tftpboot 目录内。
  
  8) 重新激活系统并进行测试。
  	*注重﹕ 建议使用另外的硬盘﹐否则原内容全部会被删除﹗
  	
  
  * ~ * ~ * ~ * ~ * ~ * ~ * ~ * ~ * ~ * ~ * ~ * ~ * ~ * ~ * ~ * ~ * ~ * ~ * ~ * ~ * ~ 
  
  然而,以上只是一个 draft 而已,仍有许多计术细节须要调整的。比方说: 
  * 必须依靠 bpbatch 程序,并非使用标准 pxe server 
  * client 端必须具备 hd 
  * 尚未解决 ram disk 方案 
  * 网络磁盘仍未设定 
  * 未能选择(协调)开机环境 
  
  欢迎有爱好的朋友参考,并分享进一步的心得。