- 论坛徽章:
- 33
|
昨天做了PXE安装的实验, 把简要的步骤写下来, 供大家参考.
实验准备:
系统平台: Red Hat Enterprise Linux 3 AS (已装好)
软件系统: Red Hat Enterprise Linux 3 AS, ISO文件4个.
测试机器: VMware Virtual Machine, Dell GX270.
实验过程:
1. 服务器的准备:
(1) 在ServerA(假定服务器的名字为ServerA)上建一个目录, 名为 /pub/pxeinst
(2) 把光盘(ISO)中的文件复制到 /pub/pxeinst 下
我的 ISO 放在 /pub/iso/rhel3as 下.
- mount -o loop /pub/iso/rhel3as/rhel-as3-1.iso /mnt/cdrom
- cp -var /mnt/cdrom/RedHat /pub/pxeinst/
- cp -var /mnt/cdrom/RELEASE*.html /pub/pxeinst/
- cp -var /mnt/cdrom/images /pub/pxeinst/
- umount /mnt/cdrom
- mount -o loop /pub/iso/rhel3as/rhel-as3-2.iso /mnt/cdrom
- cp -var /mnt/cdrom/RedHat /pub/pxeinst/
- mount -o loop /pub/iso/rhel3as/rhel-as3-3.iso /mnt/cdrom
- cp -var /mnt/cdrom/RedHat /pub/pxeinst/
- mount -o loop /pub/iso/rhel3as/rhel-as3-4.iso /mnt/cdrom
- cp -var /mnt/cdrom/RedHat /pub/pxeinst/
-
复制代码
中间若因有文件重名, 问是否覆盖, 我选的否.
完成后, 俺的 /pub/pxeinst/ 下有如下文件:
- images
- RedHat
- RELEASE-NOTES-de.html
- RELEASE-NOTES-en.html
- RELEASE-NOTES-es.html
- RELEASE-NOTES-fr.html
- RELEASE-NOTES-it.html
- RELEASE-NOTES-ja.html
- RELEASE-NOTES-ko.html
- RELEASE-NOTES-pt_BR.html
- RELEASE-NOTES-zh_CN.html
- RELEASE-NOTES-zh_TW.html
-
复制代码
(3) 把 /pub/pxeinst/ 设为 NFS 共享. 在 /etc/exports 里加入:
- /pub/pxeinst 192.168.1.0/24(rw,async)
-
复制代码
然后共享出来: service nfs restart. (或是 exportfs -a )
2. PXE的配置:
(1) 配置PXE启动:
- pxeos -a -i "RHEL 3 AS" -p NFS -D 0 -s servera.example.com \
- -L /pub/pxeinst rhel-3-as
-
复制代码
(2) 加入PXE机器:
- pxeboot -a -O rhel-3-as 192.168.1.201
-
复制代码
3. 启动 tftp server:
4. 配置DHCP:
在dhcpd.conf 里加入:
- allow booting;
- allow bootp;
- calss "pxeclients" {
- match if substring(option vendor-class-identifier, 0, 9) = "PXEClient";
- filename "linux-install/pxelinux.0";
-
复制代码
因为我的NFS, TFTP, DHCP 服务器是一台机器, 如果不是, 还要加入:
- next-server servera.example.com
-
复制代码
修改或加入如下段:
- range dynamic-bootp 192.168.1.201 192.168.1.201;
-
复制代码
5. 启动安装:
在client 上设为网卡PXE启动, 接好网线. 启动机器, 然后就会看到一个加载内核的
过程, 然后就是正常的启动安装了. 注意的是安装方式选 NFS 就行了. 关于NFS的安
装, 可以参考我以前写过的"网络安装的一点实践".
本文参考了"Red Hat Enterprise Linux 3 System Administration Guide" 和
"Red Hat Enterprise Linux 3 Installation Guide for the x86, Itanium(TM),
and AMD64 Architectures".
初次做PXE, 还有很多有问题的地方, 欢迎大家批评指正. 实验所用命令其参数, 请
参考命令的 man 手册.
本人在 VMware Virtural Machine 和 Dell GX270 机器上测试通过. |
|