歡迎來到Linux教程網
Linux教程網
Linux教程網
Linux教程網
Linux教程網 >> Linux綜合 >> Linux資訊 >> Linux文化 >> RHEL4下的kickstart+dhcp+tftp+pxelinux+nfs全自動安裝指南

RHEL4下的kickstart+dhcp+tftp+pxelinux+nfs全自動安裝指南

日期:2017/2/27 12:06:13   编辑:Linux文化

原理: 1、客戶機必須自帶支持pxe的網卡,並將bios設為網絡啟動。 2、網卡的啟動模塊中的固化程序先申請ip地址,dhcp服務器做出應答。 3、dhcp服務器指定客戶機的ip、pxelinux啟動程序及配置文件的位置。 4、客戶機通過dhcp服務器指定的文件位置,通過tftp方式從tftp服務器下載對應文件。包括:pxelinux.0、pxelinux.cfg/default、vmlinuz、initrd.img等文件 5、根據pxelinux.cfg/default文件,下載nfs目錄下的ks.cfg文件,按照該文件的配置,使用nfs自動下載所需的rpm包,並安裝。

過程: tftp、nfs服務器為同一台機器10.0.1.61 dhcp為單獨服務器 redhat源文件路徑:/home/os/rhel4 tftp主目錄:/tftpboot

1、配置/etc/dhcpd.conf,添加: group { next-server 10.0.1.61; filename "rhel4/pxelinux.0";

host netman1 { hardware ethernet 00:0d:56:10:ae:20; fixed-address 10.0.1.1; } } 其中, next-server 10.0.1.61 指定tftp服務器的ip filename "rhel4/pxelinux.0" 指定客戶機的啟動文件 host {...} 指定要使用pxe安裝的客戶機ip 重啟dhcp服務器:/etc/init.d/dhcpd restart

2、配置tftp服務器 打開/etc/xinetd.d/tftp文件,設disable=no。 啟動xinetd:/etc/init.d/xinetd restart 默認情況下,tftp服務器的主目錄是/tftpboot,將第一張光盤的isolinux下的所有文件都拷貝到/tftpboot下。 執行:mkdir -p /tftpboot/pxelinux.cfg mv /tftpboot/isolinux.cfg /tftpboot/pxelinux.cfg/default 修改default文件,添加: label auto kernel vmlinuz append initrd=initrd.img ks=nfs:10.0.1.61:/home/os/rhel4/ks.cfg devfs=nomount ramdisk_size=8192 nofb 其中,ks指定了ks.cfg文件所在的位置。注意,不要將initrd=ininrd.img的位置放到後面,有可能起不出來咯:) 目前,ks好像不支持ftp方式,只支持http和nfs。 http方式的格式為: ks=http:///

3、配置ks.cfg文件。 這個步驟相對簡單,找台linux機器,在x下運行redhat-config-kickstart(RHEL3)或system-config-kickstart(RHEL4)。配置完保存在nfs服務器的/home/os/rhel4/ks.cfg就可以了。

4、拷貝rhel4的cd1源包到目錄/home/os/rhel4下,cd2/3/4下的rpm包都放到/home/os/rhel/RedHat/RPMS/下。

5、配置nfs服務器 配置/etc/exports文件,添加 /home/os/rhel4/ *(rw) 啟動portmap、nfs

6、差不多了,打開客戶機,在出現boot:下鍵入auto看看:)

參考文章:http://www.redhat.com/docs/manuals/linux/rhl-7.3-manual/custom-guide/ch-kickstart2.html

補:我的ks.cfg文件,應該能看懂吧

#Generated by Kickstart Configurator #platform=x86, AMD64, or Intel EM64T

#System language lang en_US #Language modules to install langsupport zh_CN zh_TW --default=en_US #System keyboard keyboard us #System mouse mouse #Sytem timezone timezone Asia/Shanghai #Root password rootpw --iscrypted $1$9KhyG5OH$VCPcPML0FG2SiKpkGTdI1. #Reboot after installation reboot #Use text mode install text #Install OS instead of upgrade install #Use Web installation nfs --server=10.0.1.61 --dir=/home/os/rhel4/ #System bootloader configuration bootloader --location=mbr #Clear the Master Boot Record zerombr yes #Partition clearing information clearpart --all --initlabel #Disk partitioning information part /boot --fstype ext3 --size 100 part swap --size 512 part / --fstype ext3 --size 1 --grow #System authorization infomation auth --useshadow --enablemd5 #Network information network --bootproto=dhcp --device=eth0 #Firewall configuration firewall --disabled #Do not configure XWindows skipx #Package install information %packages --resolvedeps @ text-internet @ server-cfg @ web-server @ ftp-server @ admin-tools @ system-tools

Copyright © Linux教程網 All Rights Reserved