使用PXE刷XD

联系:手机/微信(+86 17813235971) QQ(107644445)

标题:使用PXE刷XD

作者:惜分飞©版权所有[未经本人同意,不得以任何形式转载,否则有进一步追究法律责任的权利.]

需要安装服务

bind
dhcp
system-config-netboot
tftp-server

dhcp配置

[root@xifenfei ~]# more /etc/redhat-release
Red Hat Enterprise Linux AS release 4 (Nahant Update 8)
[root@xifenfei ~]# more /etc/dhcpd.conf
subnet 192.168.30.0 netmask 255.255.255.0 {
  range dynamic-bootp 192.168.30.101 192.168.30.126;
  option broadcast-address 192.168.30.255;
  option routers 192.168.30.1;
  next-server 192.168.30.90;
  filename = "pxelinux.0";
}
--以下直接复制无需修改
ddns-update-style none;
subnet 10.182.77.0 netmask 255.255.255.0 {}
subnet 10.182.45.0 netmask 255.255.255.0 {
  range dynamic-bootp 10.182.45.92 10.182.45.100;
  option broadcast-address 10.182.45.255;
  option routers 10.182.45.1;
  next-server 10.182.77.133;
  filename = "pxelinux.0";
}

tftp配置

[root@xifenfei ~]# more /etc/xinetd.d/tftp
service tftp
{
        socket_type             = dgram
        protocol                = udp
        wait                    = yes
        user                    = root
        server                  = /usr/sbin/in.tftpd
        server_args             = -v -s /xd
        disable                 = no
        per_source              = 11
        cps                     = 100 2
        flags                   = IPv4
}

nfs配置

[root@xifenfei ~]# more /etc/exports
/xd *(no_root_squash,no_subtree_check,insecure)

pxe配置

[root@xifenfei ~]# cp /usr/share/syslinux/pxelinux.0 /xd
[root@xifenfei pxelinux.cfg]# more /xd/pxelinux.cfg/default
default linux
timeout 70
label cell
prompt 1
display boot.msg
  kernel dl180/vmlinux-11.2.3.2.1-dl180-DL180
  append initrd=dl180/initrd-11.2.3.2.1-dl180-DL180.img pxe stit updfrm dhcp sk=192.168.30.90:/xd/dl180 preconf=192.168.30.90:/xd/prec
onf.csv
label db
prompt 1
display boot.msg
  kernel dl360/vmlinux-11.2.3.2.1-dl360-DL360
  append initrd=dl360/initrd-11.2.3.2.1-dl360-DL360.img pxe stit updfrm dhcp sk=192.168.30.90:/xd/dl360 preconf=192.168.30.90:/xd/prec
onf.csv
tar -pxvf the ImageMaker.tar
cd /xd/dl180
[root@xifenfei dl180]# ./makeImageMedia.sh -pxe -pxeout dl180
Please wait. Calculating md5 checksums for cellbits ...
Calculating md5 checksum for exaos.tbz ...
Calculating md5 checksum for cellboot.tbz ...
Calculating md5 checksum for cellfw.tbz ...
Calculating md5 checksum for kernel.tbz ...
Calculating md5 checksum for ofed.tbz ...
Calculating md5 checksum for sunutils.tbz ...
Calculating md5 checksum for hputils.tbz ...
Calculating md5 checksum for c7rpms.tbz ...
Calculating md5 checksum for commonos.tbz ...
Calculating md5 checksum for debugos.tbz ...
Calculating md5 checksum for cellrpms.tbz ...
Calculating md5 checksum for doclib.zip ...
Calculating md5 checksum for cell.bin ...
Store filename of nfsimg tarball nfsimg-11.2.3.2.1-dl180-DL180.tar inside initrd
Please wait. Making initrd ...
214836 blocks
Please wait. Calculating md5 checksums for boot ...
PXE NFS image:   /xd/dl180/./PXE/nfsimg-11.2.3.2.1-dl180-DL180.tar
PXE NFS md5 sum: /xd/dl180/./PXE/nfsimg-11.2.3.2.1-dl180-DL180.tar.md5
PXE initrd:      /xd/dl180/./PXE/initrd-11.2.3.2.1-dl180-DL180.img
PXE kernel:      /xd/dl180/./PXE/vmlinux-11.2.3.2.1-dl180-DL180
[root@xifenfei dl180]# mv /xd/dl180/./PXE/nfsimg-11.2.3.2.1-dl180-DL180.tar /xd/dl180/
[root@xifenfei dl180]# mv /xd/dl180/./PXE/nfsimg-11.2.3.2.1-dl180-DL180.tar.md5 /xd/dl180/
[root@xifenfei dl180]# mv /xd/dl180/./PXE/initrd-11.2.3.2.1-dl180-DL180.img /xd/dl180/
[root@xifenfei dl180]# mv /xd/dl180/./PXE/vmlinux-11.2.3.2.1-dl180-DL180 /xd/dl180/
[root@xifenfei dl180]# ll
total 1531612
drwxr-xr-x   3 root root       4096 Mar 26 23:41 boot
drwxrwxr-x   2 root root       4096 Jan  9 22:34 doc
drwxr-xr-x   2 root root       4096 Jan  9 22:33 grub
drwxr-xr-x  17 root root       4096 Mar 26 23:41 initrd
-rw-r--r--   1 root root   38839215 Mar 26 23:41 initrd-11.2.3.2.1-dl180-DL180.img
-rwxrwxr-x   1 root root      27485 Jan  9 22:34 makeImageMedia.sh
-rw-r--r--   1 root root 1524193280 Mar 26 23:40 nfsimg-11.2.3.2.1-dl180-DL180.tar
-rw-r--r--   1 root root         68 Mar 26 23:41 nfsimg-11.2.3.2.1-dl180-DL180.tar.md5
drwxrwxr-x   3 root root       4096 Jan  9 22:34 patches
drwxr-xr-x   2 root root       4096 Mar 26 23:48 PXE
-r-xr-xr-x   1 root root      39041 Mar 31  2011 README_FOR_FACTORY.txt
-r-xr-xr-x   1 root root    3688864 Mar 26 23:41 vmlinux-11.2.3.2.1-dl180-DL180

上传preconf.csv到/xd目录

[root@xifenfei xd]# ll preconf.csv
-rw-r--r--  1 root root 2133 Mar 14 18:14 preconf.csv

然后重启dhcp,xinetd,nfs服务,重启需要恢复的xd的db and cell节点,验证结果如下

One thought on “使用PXE刷XD

  1. 参数说明

          pxe
           - signals this is pxe imaging
             mandatory parameter
          factory
           - print special [FACTORY_...] messages for use by factory.
             optional parameter.
          stit
           - signals to force reimage even if installation exists on the machine
             optional parameter
          updfrm
           - check hardware and firmware versions. Update firmware where applicable.
             optional parameter.
          kerver=<kernel_version>
             overwrite default kernel. By defaut installing kernel version depends
             on hardware type (system product name). List of kernels and hardware
             dependencies defined in the "kernel_ver" line at the very top of
             makeImageMedia.sh script.
          dualboot=<yes|no>
             overwtire default dual boot behaviour. It's only applicable for the
             db node. By default dual boot feature (installing Linux image and
             prereserving space for Solaris) depends on hardware type (system
             product name). By default X4170 M2 and X4800 (G5) servers have dual
             boot.
          dhcp
           - dhcp is optional parameter and should NOT be given with eth0 option
             If given, dhcp is used to obtain the initial dhcp address instead of
             requiring to pass the eth0 information.
          ethX=<ip>:<netmask>:<gateway>
           - ethX is optional parameter. Do NOT give with dhcp above.
           - where X is one of 0,1,2,3 on Sun and 0 on HP machines
             If both dchp and ethX are absent imaging will enter
             interactive mode and ask for Ethernet ip, netmask and
             gateway information
          sk=<nfsip>:<nfs_share>
           - sk is mandatory parameter for the PXE boot. MUST
             use IP address not the hostname for NFS server.
             nfs_share is the full path to directory where the 3 files from
             PXE directory are available
          logpath=[nfsip:]<full path to writeable nfs share>
           - logpath is optional parameter
             If given it will copy the imaging, zero and first boots logs to the
             writable nfs share location in single tar bzip2 file <serial_num>.tbz.
             The serial_num is the serial number of the system obtained as
               dmidecode -s system-serial-number
          -----------------------------------------------
          Development ONLY options NOT for use in Factory
          -----------------------------------------------
          reboot-on-success
           - Do not wait for operator to power off machine on successful image, just
             reboot. Useful for mass unattended imaging using preconf option.
             DO NOT use in factory process.
             optional parameter
          multiprof
           - Image the node as multi profile enabled
             This parameter is optional
             NOTE: Do NOT build the images with -multiprof to makeImageMedia.sh
                   If you do that image can only be used to do multi profile nodes.
          nodisktests
           - do not run disktests at zero boot. They take 6-14 hours!
             This parameter is optional
          notests=<group for validations to be skipped, e.g. diskgroup>
           - Skips all validations with given vldgroup name. For example, if
             diskgroup is given as the group name, then each validation with
             vldgroup set to diskgroup will be skipped. diskgroup today includes
             disktests, calibration and diskhealth. This is one more way to skip
             disktests in addition to the nodisktests option.
             This parameter is optional
          preconf=[<preconf_nfsip>:]<full path name of preconf_file on nfs server>
           - preconf is optional parameter
             The nfsip MUST be IP address of the NFS server not its hostname
             The preconf_nfsip can be same or different than the nfsip in sk
             option, allowing the preloaded configuration file to reside on different
             subtree or entirely different nfs server from that of the imaging bits
             on the nfsip nfs server.
    

    如果不需要双引导启动,设置dualboot=no

发表评论

邮箱地址不会被公开。 必填项已用*标注

1 × 3 =