Kickstart 同时push多个linux操作系统推荐

在生产环境中,经常要安装不同版本的linux操作系统,以及各种安装需求;每次安装操作系统的时候如果用传统的光盘方式安装,费时又费力!下面介绍下如何在同一个时刻,使用kickstart push不同的版本的linux,主要有三个版本centos4.8,rhel5.4,rhel6.0和一个linux rescue环境!

一:配置dhcp服务,ks服务器地址为192.168.50.7/24

[root@rhel5~]#rpm-qa|grepdhcp dhcpv6-client-1.0.10-17.el5 dhcp-3.0.5-23.el5_5.2 [root@rhel5~]#cat/etc/dhcpd.conf optiondomain-name 766.com default-lease-time6000; max-lease-time11400; authourtative; next-server192.168.50.7; ddns-update-stylead-hoc; log-facilitylocal7; subnet192.168.50.0netmask255.255.255.0{ range192.168.50.150192.168.50.195; optiondomain-name-servers192.168.50.254; optiondomain-name 766.com optionnetbios-name-servers192.168.50.254; optionrouters192.168.50.254; optionbroadcast-address192.168.50.255; default-lease-time6000; max-lease-time11400; filename /kickstart/ks.cfg } optionspacePXE; class PXE { matchifsubstring(optionvendor-class-identifier,0,9)= PXEClient optionvendor-encapsulated-options01:04:00:00:00:00:ff; optionboot-size0x1; filename pxelinux.0 optiontftp-server-name 192.168.50.7 optionvendor-class-identifier PXEClient vendor-option-spacePXE; }

二:配置tftp-server,准备vmlinz和initrd.img文件

[root@rhel5~]#rpm-qa|egrep'tftp|xinetd' tftp-0.49-2.el5.centos tftp-server-0.49-2.el5.centos xinetd-2.3.14-10.el5 [root@rhel5~]#cat/etc/xinetd.d/tftp #default:off #description:Thetftpserverservesfilesusingthetrivialfiletransfer\ #protocol.Thetftpprotocolisoftenusedtobootdiskless\ #workstations,downloadconfigurationfilestonetwork-awareprinters,\ #andtostarttheinstallationprocessforsomeoperatingsystems. servicetftp { socket_type=dgramprotocol=udpwait=yesuser=rootserver=/usr/sbin/in.tftpd server_args=-s/tftpboot disable=no per_source=11cps=1002 flags=IPv4} 这些文件可以在对应的系统光盘或者ISO文件下的isolinux目录下找到 [root@rhel5~]#ls/tftpboot/rhel5.4_64/ initrd.imgvmlinuz [root@rhel5~]#ls/tftpboot/rhel6_64/ initrd.imgvmlinuz [root@rhel5~]#ls/tftpboot/centos4.8_64/ initrd.imgvmlinuz

三:配置相关文件复制pxelinux.0文件至/tftpboot目录下,该文件由syslinux软件包提供,用来pxe启动linux使用[root@rhel5 ~]# rpm -qf /usr/lib/syslinux/pxelinux.0 syslinux-3.11-4

复制rhel5光盘下的isolinux目录下的文件至/tftpboot目录下,其中vmlinuz和initrd.img文件可以不用复制,在/tftpboot目录下创建一个名为pxelinux.cfg的目录,并将/tftpboot目录下的isolinux.cfg文件移到到该目录,重命名为default;KS文件可以在安装好的linux上使用system-config-kickstart命令生成

[root@rhel5~]#ls/tftpboot/ boot.catcentos4.8_64isolinux.binmemtestparam.msgpxelinux.cfgrhel5.4_64splash.lss boot.msggeneral.msgisolinux.cfgoptions.msgpxelinux.0rescue.msgrhel6_64TRANS.TBL [root@rhel5~]#cat/tftpboot/pxelinux.cfg/default defaultrhel5_rescue prompt1 timeout600 displayboot.msg F1boot.msg F2options.msg F3general.msg F4param.msg F5rescue.msg labelrhel5_rescue kernelrhel5.4_64/vmlinuz appendksdevice=eth0load_ramdisk=1initrd=rhel5.4_64/initrd.imgnoipv6 labelrhel5.4_64 kernelrhel5.4_64/vmlinuz appendksdevice=eth0load_ramdisk=1initrd=rhel5.4_64/initrd.imgks=ftp://192.168.50.7/ks/ks5_64.cfgnoipv6 labelrhel6_64 kernelrhel6_64/vmlinuz appendksdevice=eth0load_ramdisk=1initrd=rhel6_64/initrd.imgks=ftp://192.168.50.7/ks/ks6_64.cfgnoipv6 labelcentos4.8_64 kernelcentos4.8_64/vmlinuz appendksdevice=eth0load_ramdisk=1initrd=centos4.8_64/initrd.imgks=ftp://192.168.50.7/ks/ks4.8_64.cfgnoipv6 [root@rhel5~]#cat/tftpboot/boot.msg #Todecideinstallostypeandentercommandtocontinue linuxresuce--- rhel5_rescuerescue rhel5.464bit--- rhel5.4_64 rhel6.064bit--- rhel6_64 centos4.864bit--- centos4.8_64

四:配置FTP和autofs,这里将利用ftp和autofs为安装提供光盘源镜像

[root@rhel5~]#rpm-qa|egrep'vsftpd|autofs' vsftpd-2.0.5-16.el5_5.1 autofs-5.0.1-0.rc2.131.el5 [root@rhel5~]#tail-1/etc/auto.master /var/ftp/pub/etc/auto.ftp [root@rhel5~]#cat/etc/auto.ftp iso5-fstype=iso9660,ro,loop:/data/ISO/rhel-server-5.4-x86_64-dvd.iso iso4.8-fstype=iso9660,ro,loop:/data/ISO/CentOS-4.8-x86_64-binDVD.iso iso6-fstype=iso9660,ro,loop:/data/ISO/rhel6.iso

五:启动服务和测试

[root@rhel5~]#servicedhcpdrestart Shuttingdowndhcpd:[OK] Startingdhcpd:[OK] [root@rhel5~]#servicevsftpdrestart Shuttingdownvsftpd:[OK] Startingvsftpdforvsftpd:[OK] [root@rhel5~]#serviceautofsrestart Stoppingautomount:[OK] Startingautomount:[OK] [root@rhel5~]#servicexinetdrestart Stoppingxinetd:[OK] Startingxinetd:[OK] [root@rhel5~]#tail-f/var/log/messages Jun1317:40:42rhel5dhcpd:DHCPDISCOVERfrom00:0c:29:4c:0f:d5viabr0 Jun1317:40:43rhel5dhcpd:DHCPOFFERon192.168.50.184to00:0c:29:4c:0f:d5viabr0 Jun1317:40:44rhel5dhcpd:DHCPREQUESTfor192.168.50.184(192.168.50.7)from00:0c:29:4c:0f:d5viabr0 Jun1317:40:44rhel5dhcpd:DHCPACKon192.168.50.184to00:0c:29:4c:0f:d5viabr0 Jun1317:40:44rhel5xinetd[1794]:START:tftppid=2829from=192.168.50.184 [root@rhel5~]#tail-f/var/log/xferlog MonJun1308:46:2520111192.168.50.1840/pub/iso5/RELEASE-NOTES-en_US.UTF-8.htmlb_oaanonymous@ftp0*i MonJun1308:46:2520111192.168.50.1840/pub/iso5/RELEASE-NOTES.en_US.UTF-8b_oaanonymous@ftp0*i MonJun1308:46:2520111192.168.50.1840/pub/iso5/RELEASE-NOTES-en_US.htmlb_oaanonymous@ftp0*i MonJun1308:46:2520111192.168.50.1840/pub/iso5/RELEASE-NOTES.en_USb_oaanonymous@ftp0*i MonJun1308:46:2620111192.168.50.18480344/pub/iso5/RELEASE-NOTES-en.htmlb_oaanonymous@ftp0*c MonJun1308:49:4820111192.168.50.1840/pub/iso5/images/updates.imgb_oarhinstall@ftp0*i MonJun1308:49:4820111192.168.50.1840/pub/iso5/disc1/images/updates.imgb_oarhinstall@ftp0*i MonJun1308:49:4820111192.168.50.1840/pub/iso5/images/product.imgb_oarhinstall@ftp0*i MonJun1308:49:4820111192.168.50.1840/pub/iso5/disc1/images/product.imgb_oarhinstall@ftp0*i MonJun1308:49:5620118192.168.50.18491160576/pub/iso5/images/stage2.imgb_oarhinstall@ftp0*c

附件:http://down.51cto.com/data/2358361

有勇气并不表示恐惧不存在,而是敢面对恐惧、克服恐惧

Kickstart 同时push多个linux操作系统推荐

相关文章:

你感兴趣的文章:

标签云: