【1】原理和系统引导过程

         BIOS =>引导介质=>用于安装环境的linux内核(vmlinuz)和驱动模块(initrd.img)=>安装程序(anaonda)=>寻找安装介质=>安装配置=> 重启 => 进入系统

【redhat5.5】 网络引导和无人值守安装配置_程序

【2】 需要用到的服务

        DHCP:  连接服务器
        TFTP:   获得内核和启动文件
        FTP:     获得安装镜

【3】 安装kickstart
         yum install  system-config-kickstart

         system-config-kickstart  启动kickstart  配置 生成 ks.cfg 文件


  1. #platform=x86, AMD64, 或 Intel EM64T  

  2. # System authorization information  

  3. auth  --useshadow  --enablemd5  

  4. # System bootloader configuration  

  5. bootloader --location=mbr  

  6. # Clear the Master Boot Record  

  7. zerombr  

  8. # Partition clearing information  

  9. clearpart --all --initlabel  

  10. # Use text mode install  

  11. text  

  12. # Firewall configuration  

  13. firewall --disabled  

  14. # Run the Setup Agent on first boot  

  15. firstboot --disable  

  16. key --skip  

  17. # System keyboard  

  18. keyboard us  

  19. # System language  

  20. lang zh_CN  

  21. # Installation logging level  

  22. logging --level=info  

  23. # Use network installation  

  24. url --url=ftp://10.10.68.1/iso  

  25. # Network information  

  26. network --bootproto=dhcp --device=eth0 --onboot=on  

  27. # Reboot after installation  

  28. reboot  

  29. #Root password  

  30. rootpw  uplooking  

  31. # SELinux configuration  

  32. selinux --disabled  

  33. # System timezone  

  34. timezone  Asia/Shanghai  

  35. # Install OS instead of upgrade  

  36. install  

  37. # X Window System configuration information  

  38. xconfig  --defaultdesktop=GNOME --depth=32 --resolution=1024x768  

  39. # Disk partitioning information  

  40. part / --bytes-per-inode=4096 --fstype="ext3" --grow --maxsize=100 --size=1  

  41. part swap --bytes-per-inode=4096 --fstype="swap" --grow --maxsize=1024 --size=1  

  42. part / --bytes-per-inode=4096 --fstype="ext3" --grow --size=1  

  43. %post  

  44. %packages  

  45. @base  

  46. @gnome-desktop  

  47. @development-libs  

  48. @base-x  

  49. @admin-tools  

  50. @development-tools  

  51. @chinese-support  

  52. @server-cfg  

  53. @dns-server  

  54. @system-tools  

  55. @editors  

  56. @text-internet  

  57. @network-server  

  58. @graphical-internet  

  59. @ftp-server  


【4】 配置TFTP服务 (简单文件传输协议)

  1. rpm -q tftp-server  

  2. chkconfig tftp on  

  3. service xinetd restart  



【5】 安装配置DHCP服务

  1.   DHCP服务的配置文件  

  2. #  

  3. # DHCP Server Configuration file.  

  4. #   see /usr/share/doc/dhcp*/dhcpd.conf.sample    

  5. #  

  6. ddns-update-style interim;  

  7. ignore client-updates;  

  8. subnet 10.10.68.0 netmask 255.255.255.0 {  

  9.        option routers                    10.10.68.1;  

  10.        option subnet-mask                255.255.255.0;  

  11.        option domain-name-servers        10.10.68.1;  

  12.        next-server 10.10.68.1;  

  13.        filename="/pxelinux.0";  

  14.        range dynamic-bootp 10.10.68.100 10.10.68.200;  

  15.        default-lease-time 21600;  

  16.        max-lease-time 43200;  

  17.        }  


【6】 打开ftp服务
将ks.cfg 文件 copy到 /var/ftp 目录

  1. 将光盘镜像挂载至 /var/ftp/iso 目录  


【6】 配置pxe服务模块

  1. cp linux-install/pxelinux.0 /tftpboot/  

  2. mkdir /tftpboot/pxelinux.cfg  

  3. cp /mnt/isolinux/isolinux.cfg  /tftpboot/pxelinux.cfg/default  

  4. cp /mnt/isolinux/vmlinuz    /tftpboot/  

  5. cp /mnt/isolinux/initrd.img /tftpboot/  

  6. cp /mnt/isolinux/boot.msg   /tftpboot/  


【7】 编辑 default 文件

  1. default linux  

  2. prompt 1  

  3. timeout 30  

  4. display boot.msg  

  5. label linux  

  6. kernel vmlinuz  

  7. append ksdevice=eth0 nodmraid initrd=initrd.img  ks=ftp://10.10.68.1/ks.cfg  


【8】 配置完成 当网络中有新机器加入时,采用网卡引导 即可完成自动安装系统