售前咨询
技术支持
渠道合作

PXE全自动安装Linux

安装环境

  1. yum -y install tftp tftp-server dhcp syslinux
  2. chkconfig xinetd off
  3. chkconfig –level 3 xinetd on
  4. chkconfig tftp off
  5. chkconfig –level 3 tftp on
  6. chkconfig dhcpd off
  7. chkconfig –level 3 dhcpd on
  8. chkconfig portmap off
  9. chkconfig –level 3 portmap on
  10. chkconfig nfs off
  11. chkconfig –level 3 nfs on

配置

  1. vi /etc/xinetd.d/tftp
  2. vi /etc/dhcpd.conf
  3. ddns-update-style interim;
  4. ignore client-updates;
  5. subnet 192.168.1.0 netmask 255.255.255.0 {
  6. option routers                  192.168.1.1;
  7. option subnet-mask              255.255.255.0;
  8. filename “pxelinux.0″;
  9. next-server 192.18.1.110;
  10. option domain-name-servers      192.168.1.1;
  11. option time-offset              -18000; # Eastern Standard Time
  12. range dynamic-bootp 192.168.1.200 192.168.1.210;
  13. default-lease-time 21600;
  14. max-lease-time 43200;
  15. # we want the nameserver to appear at a fixed address
  16. host ns {
  17. next-server marvin.redhat.com;
  18. hardware ethernet 12:34:56:78:AB:CD;
  19. fixed-address 207.175.42.254;
  20. }
  21. }
  22. service xinetd restart
  23. service tftp restart

#组建PXE环境

  1. mkdir -p /tftpboot/pxelinux.cfg
  2. cp /usr/lib/syslinux/pxelinux.0 /tftpboot
  3. cp /usr/lib/syslinux/menu.c32 /tftpboot
  4. cp /CentOS5.5/isolinux/isolinux.cfg /tftpboot/pxelinux.cfg/default
  5. cp /CentOS5.5/images/pxeboot/initrd.img /tftpboot
  6. cp /CentOS5.5/images/pxeboot/vmlinuz /tftpboot
  7. chmod u+w /tftpboot/pxelinux.cfg/default
  8. vi /tftpboot/pxelinux.cfg/default
  9. default menu.c32
  10. timeout 15
  11. label auto
  12. menu label Auto Install CentOS5.5_32bit
  13. menu default
  14. kernel vmlinuz
  15. append ks=nfs:192.168.1.110:/CentOS5.5/ks.cfg initrdinitrd=initrd.img
  16. label custom
  17. menu label Custom Install CentOS5.5_32bit
  18. kernel vmlinuz
  19. append initrdinitrd=initrd.img
  20. label rescue
  21. menu label Rescue
  22. kernel vmlinuz
  23. append ks initrdinitrd=initrd.img rescue

#配置nfs

  1. vi /etc/exports
  2. /CentOS5.5     *(ro)
  3. service portmap start
  4. service nfs start
  5. exportfs

#kickstart

  1. yum -y install system-config-kickstart(须安装桌面环境)
  2. vi ks.cfg
  3. #platform=x86, AMD64, or Intel EM64T
  4. # System authorization information
  5. auth  –useshadow  –enablemd5
  6. # System bootloader configuration
  7. bootloader –location=mbr
  8. # Clear the Master Boot Record
  9. zerombr
  10. # Partition clearing information
  11. clearpart –all –initlabel
  12. # Use graphical install
  13. #graphical
  14. text
  15. # Firewall configuration
  16. firewall –disabled
  17. key –skip
  18. # Run the Setup Agent on first boot
  19. firstboot –disable
  20. # System keyboard
  21. keyboard us
  22. # System language
  23. lang en_US
  24. # Installation logging level
  25. logging –level=info
  26. # Use network installation
  27. #url –url=http://192.168.1.110/centos/
  28. nfs –server=192.168.1.110 –dir=/CentOS5.5
  29. # Network information
  30. network –bootproto=dhcp –device=eth0 –ononboot=on
  31. # Reboot after installation
  32. reboot
  33. #Root password
  34. rootpw –iscrypted $1$3LO7K8pW$mvZZ/qaBakJNgz.v3RjRs1
  35. # SELinux configuration
  36. selinux –disabled
  37. # Do not configure the X Window System
  38. skipx
  39. # System timezone
  40. timezone  Asia/Shanghai
  41. # Install OS instead of upgrade
  42. install
  43. # Disk partitioning information
  44. part / –bytes-per-inode=4096 –fstype=”ext3″ –size=30720
  45. part swap –bytes-per-inode=4096 –fstype=”swap” –size=1024
  46. %packages
  47. @base
  48. @development-libs
  49. @development-tools
  50. @admin-tools
  51. @system-tools

上一篇:

下一篇:

相关文章