最近公司有個大專案要做30臺左右的機器。要是一部一部的裝估計要死人。考慮的半天還是pex自動安裝來的好 hoho。。。。
第一步:安裝xinetd服務
xinetd-2.3.13-4.4E.1.i386.rpm (建議裝完系統後安裝,可以保證其他要裝的機子乾淨)
第二步:安裝tftp服務
tftp服務包含在xinetd裡面
但是要注意啟動服務
disable = no(將yes改為no)
重啟xinetd這個服務
第三步:準備檔案
將/p_w_picpaths/pxeboot裡的initrd.img  vmlinuz兩個檔案拷貝到/tftpboot裡去
將/usr/lib/syslinux/menu.c32  拷貝到/tftpboot裡去
將/usr/lib/syslinux/pxelinux.0 拷貝到/tftpboot裡去
 cp /root/anaconda-ks.cfg /var/www/html/ks.cfg
貼下我的ks.cfg檔案注意先要安裝http服務
rpm -ivh apr-*和rpm -ivh http*
[root@autoinstall pxeboot]# more /var/www/html/ks.cfg
# Kickstart file automatically generated by anaconda.
install
nfs –server=192.168.11.99 –dir=/var/ftp/pub  ##指定資源
lang en_US.UTF-8
langsupport –default=en_US.UTF-8 zh_CN.UTF-8 en_US.UTF-8
keyboard us
xconfig –card “VMWare” –videoram 16384 –hsync 31.5-37.9 –vsync 50-70 –resolution 800×600 –depth 16 –startxonboot  –defaultde
sktop gnome
rootpw –iscrypted $1$OhWXJrcL$M3ZkdHMkqeZdUhw3KbI480
firewall –disabled
selinux –disabled
authconfig –enableshadow –enablemd5
timezone Asia/Shanghai
bootloader –location=mbr –append=”rhgb quiet”
# The following is the partition information you requested
# Note that any partitions you deleted are not expressed
# here so unless you clear all partitions first, this is
# not guaranteed to work
clearpart –all
part /boot –fstype ext3 –size=100
part swap –size=1000
part / –fstype ext3 –size=100 –grow –asprimary ##分割槽
%packages
@ admin-tools
@ editors
@ emacs
@ system-tools
@ gnome-software-development
@ text-internet
@ x-software-development
@ gnome-desktop
@ dialup
@ network-server
@ compat-arch-support
@ legacy-software-development
@ base-x
@ chinese-support
@ printing
@ server-cfg
@ development-tools
kernel-devel
kernel-smp-devel
e2fsprogs
kernel-smp
grub
%post
第四步:共享資源
把系統盤上的資源考到/var/ftp/pub下然後共享出來
[root@autoinstall RPMS]# more /etc/exports
/var/ftp/pub    192.168.11.0/24(ro,sync) 
以showmount -e ip來驗證
第五步:在伺服器準備好dhcp服務並配置相關服務
rpm -ivh dhcp-3.0.1-59.EL4.i386.rpm (系統盤中獲取)
配置檔案可以從模版檔案中考取做修改
/usr/share/doc  —模版檔案庫
貼一下我的dhcpd.conf檔案
[root@autoinstall doc]# more /etc/dhcpd.conf
ddns-update-style interim;
ignore client-updates;
allow booting;                        
allow bootp;           
                     
subnet 192.168.11.0 netmask 255.255.255.0 {
# — default gateway
        option routers                  192.168.11.99;
        option subnet-mask              255.255.255.0;
#       option nis-domain               “domain.org”;
#       option domain-name              “domain.org”;
#       option domain-name-servers      192.168.1.1;
        option time-offset              -18000; # Eastern Standard Time
#       option ntp-servers              192.168.1.1;
#       option netbios-name-servers     192.168.1.1;
# — Selects point-to-point node (default is hybrid). Don`t change this unless
# — you understand Netbios very well
#       option netbios-node-type 2;
        range dynamic-bootp 192.168.11.128 192.168.11.254;
        default-lease-time 21600;
        max-lease-time 43200;
        next-server 192.168.11.99;
        filename “pxelinux.0”; 
}
紅色的都為要新增的
第六步:建立引導檔案
/tftpboot/pxelinux.cfg/default(注意檔名稱)
貼個最簡單的
default linux
prompt 0
label linux
        kernel vmlinuz
        append initrd=initrd.img ks=http://192.168.11.99/ks.cfg
哪的可以去網上找找,可以訪問下http://192.168.11.99/ks.cfg
看是否可以訪問ks.cfg檔案。
至此一個簡單的安裝到此完成。