本人近期一直在练习kickstart自动部署centos,整理了一篇经过n次实践的文档分享一下!
centos6.2 with kickstart网络启动自动安装centos6.2 x64(KickStart+PXE+httpd+DHCP+TFTP)
参考文章http://blog.csdn.net/silent1/article/details/7635646进入正题:kickstart服务器,操作系统是centos6.2 x64yum install dhcp tftp* xinetd httpd syslinuxvim /etc/xinetd.d/tftpdisable=no将/var/lib/tftpboot链接到/tftpbootln -s /var/lib/tftpboot /tftpboot建立安装源挂载centos盘mount -o loop -t iso9660 centos.iso /misc/cd复制安装centos所需启动菜单和内核、ramdisk镜像文件到tftpcp /usr/share/syslinux/pxelinux.0 /usr/share/syslinux/vesamenu.c32 /misc/cd/p_w_picpaths/pxeboot/vmlinuz /misc/cd/p_w_picpaths/pxeboot/initrd.img /misc/cd/isolinux/*.msg /misc/cd/isolinux/memtest /misc/cd/isolinux/splash.jpg /tftpboot建立pxelinux.cfg目录mkdir -p /tftpboot/pxelinux.cfg制造启动菜单cp /misc/cd/isolinux/isolinux.cfg /tftpboot/pxelinux.cfg/default修改内容vim /tftpboot/pxelinux.cfg/default# /tftpboot/pxelinux.cfg/default(/misc/cd/isolinux/isolinux.cfg)default vesamenu.c32#prompt 1timeout 30display boot.msgmenu background splash.jpgmenu title Come on,let's get it started!menu color border 0 #ffffffff #00000000menu color sel 7 #ffffffff #ff000000menu color title 0 #ffffffff #00000000menu color tabmsg 0 #ffffffff #00000000menu color unsel 0 #ffffffff #00000000menu color hotsel 0 #ff000000 #ffffffffmenu color hotkey 7 #ffffffff #ff000000menu color scrollbar 0 #ffffffff #00000000label CentOS Linux 6.2 x64 menu label ^Install CentOS 6.2 x64 menu default kernel vmlinuz append ks=http://192.168.44.250/ks/centos6/ks.cfg initrd=initrd.img ksdevice=eth0label CentOS Linux 6.2 x64 vesa mode menu label Install system with ^basic video driver kernel vmlinuz append ks=http://192.168.44.250/ks/centos6/ks.cfg initrd=initrd.img ksdevice=eth0 xdriver=vesa nomodesetlabel rescue menu label ^Rescue installed system kernel vmlinuz append initrd=initrd.img rescuelabel local menu label Boot from ^local drive localboot 0xfffflabel memtest86 menu label ^Memory test kernel memtest append -在apache的发布目录中放上安装源cp -a /misc/cd/* /var/www/html/ks/centos6配置dhcpvim /etc/dhcpd.confddns-update-style interim;ignore client-updates;next-server 192.168.44.250;filename "pxelinux.0";allow booting;allow bootp;subnet 192.168.44.0 netmask 255.255.255.0 { # — default gatewayoption routers 192.168.44.1;option subnet-mask 255.255.255.0;# option nis-domain “domain.org”;option domain-name "admaster.com.cn";option domain-name-servers 202.106.195.68;option time-offset -18000; # Eastern Standard Timerange 192.168.44.100 192.168.44.120;}制造ks.cfgvim /var/www/html/ks/centos6/ks.cfg# centos6/ks.cfgfirewall --disabledinstallurl --url http://192.168.44.250/ks/centos6textfirstboot --disablerootpw admasterauth --useshadow --enablemd5lang en_USkeyboard usselinux --disabledlogging --level=inforeboottimezone --isUtc Asia/Shanghainetwork --bootproto=dhcp --device=eth0 --onboot=onzerombrbootloader --location=mbrclearpart --all --initlabelpart swap --fstype="swap" --size=4096part /boot --fstype="ext4" --size=200part / --fstype="ext4" --size=1 --grow%packagesopenssh-serveropensshvim如果想把图形界面也一起装上
在上面vim下面再加三行@ X Window System@ Desktop@ Desktop Platform 启动各项服务/etc/init.d/dhcpd restart;/etc/init.d/xinetd restart;/etc/init.d/httpd restart