歡迎您光臨本站 註冊首頁

linux網路全自動安裝(kickstart)

←手機掃碼閱讀     火星人 @ 2014-03-09 , reply:0
CentOS 網路全自動安裝(kickstart 一、 環境 系統:CentOS 5.4 centos系統盤中所有文件在/install/centos 軟體:dhcp dhcp / dhcp-devel / dhcpv6 / dhcpv6-client

Nfs (nfs-utils / portmap) Tftp (tftp / tftp-server) Xinetd 二、 確保以上軟體全部安裝,所有服務都隨開機啟動 #vi /etc/exports /install/centos *(ro,sync) #chmod –R 777 /install 三、 複製PXE

啟動時需要的文件資料 1、複製必要的文件: # cp /usr/lib/syslinux/pxelinux.0 /tftpboot/
# mkdir /tftpboot/pxelinux.cfg
# cp /install/centos/isolinux/isolinux.cfg /tftpboot/pxelinux.cfg/default
# cp /install/centos/images/pxeboot/initrd.img /tftpboot/
# cp /install/centos/images/pxeboot/vmlinuz /tftpboot/
# cp /install/centos/isolinux/*.msg /tftpboot/ 2修改/tftpboot/pxelinux.cfg/default文件 default ks prompt 1 display boot.msg

F1 boot.msg
F2 options.msg F3 general.msg F4 param.msg F5 rescue.msg label ks kernel vmlinuz append ks=nfs:192.168.1.105:/install/centos/ks.cfg initrd=initrd.img devfs=nomount ramdisk_size=8192 label linux text kernel vmlinuz append text initrd=initrd.img devfs=nomount ramdisk_size=8192 label linux expert kernel vmlinuz append expert initrd=initrd.img devfs=nomount ramdisk_size=8192

label linux rescue
kernel vmlinuz append rescue initrd=initrd.img devfs=nomount ramdisk_size=8192 文件中藍色字體「ks」可以任意填寫,但是最好3處填入相同的描寫 紅色部分是制定ks文件的路徑. 四、 配置DHCPTFTP

服務 1. 配置tftp伺服器 #vi /etc/xined.d/tftp service tftp { disable = no (默認為「yes」,一定要改成「no) socket_type = dgram protocol = yes

user = root server = /usr/sbin/in.tftpd server_args = -s /tftpboot per_source = 11 cps = 100 2 flags = IPv4 } #service xinetd restart 2. 配置DHCP伺服器 #cp /usr/share/doc/dhcp-3.0.5/dhcpd.conf.sample /etc/dhcpd.conf
cp
:是否覆蓋「/etc/dhcpd.conf」? y

#vi /etc/dhcpd.conf ddns-update-style interim;
ignore client-updates;
filename "pxelinux.0"; //PXE
得到IP以後的引導文件
next-server 192.168.1.254; //
伺服器IP地址. subnet 192.168.1.0 netmask 255.255.255.0 { //所屬網段及掩碼.
# --- default gateway
option routers 192.168.1.1; //
路由器IP,可以寫網關

IP

option subnet-mask 255.255.255.0;
# option nis-domain "domain.org"; //
註銷
# option domain-name "domain.org"; //
註銷
option domain-name-servers 192.168.1.254; //DNS
伺服器IP
option time-offset -18000; # Eastern Standard Time
# option netbios-node-type 2;
range dynamic-bootp 192.168.1.100 192.168.1.200; //IP
地址池範圍.
default-lease-time 21600;
......後面省略 //寫配置文件的時候注意每句後面的分號(;)不要丟了. #service dhcpd start

#chkconfig --level 35 dhcpd on 五、實現RHEL5系統的無人值守安裝 以上述步驟中已完成的部分作為基礎. 1. 建立無人值守安裝配置文件 實現自動無人值守安裝,需要事先建立kickstart配置文件,有兩種方式可以建立該配置文件: 1) 從已安裝好的RHEL5系統中拷貝

/root/anaconda-ks.cfg配置文件樣本,在此基礎上修改. 2) 在已安裝好的RHEl5系統圖形界面中,通過「系統工具」-->kickstart」嚮導建立配置文件. 后一種方式可能需要從光碟中安裝兩個rpm包:pykickstart-0.43-1.el5system-config-kickstart-2.6.19.1-1.el5 我的ks.cfg

文件內容如下 #platform=x86, AMD64, 英特爾 EM64T # System authorization information auth --useshadow --enablemd5 # System bootloader configuration bootloader --location=mbr # Clear the Master Boot Record zerombr # Partition clearing information clearpart --all --initlabel # Use text mode install text

# Firewall configuration
firewall --enabled # Run the Setup Agent on first boot firstboot --disable # System keyboard keyboard us # System language lang en_US # Installation logging level logging --level=info # Use NFS installation media nfs --server=192.168.1.105 --dir=/install/centos #url --url=ftp://192.168.1.1/install/rhel5/ //如果安裝源位於FTP

HTTP伺服器中,則使用url配置項 # Network information network --bootproto=dhcp --device=eth0 --onboot=on # Reboot after installation reboot #Root password rootpw --iscrypted $1$axUWZnH1$lpwb5p3.ohevddND6SYr9. # SELinux configuration selinux --enforcing # System timezone timezone --isUtc Asia/Shanghai

# Install OS instead of upgrade
install # X Window System configuration information xconfig --defaultdesktop=GNOME --depth=32 --resolution=800x600 # Disk partitioning information part /boot --bytes-per-inode=4096 --fstype="ext3" --size=100 part / --bytes-per-inode=4096 --fstype="ext3" --size=7000 part swap --bytes-per-inode=4096 --fstype="swap" --size=512 %packages @server-cfg @gnome-desktop @admin-tools @chinese-support @system-tools

@graphical-internet @legacy-software-support @text-internet @news-server @editors 3. 配置客戶機並安裝系統 根據提示回車或者輸入linux text回車選擇安裝方式,後續安裝由系統自動完成. 注意:如果在BIOS中「LAN」設置為第一優先啟動設備,則不要在

ks.cfg
中配置為reboot(安裝后自動重啟),以避免循環安裝系統.


[火星人 ] linux網路全自動安裝(kickstart)已經有641次圍觀

http://coctec.com/docs/linux/show-post-51261.html