{"id":5911,"date":"2016-05-08T20:50:09","date_gmt":"2016-05-08T12:50:09","guid":{"rendered":"http:\/\/rmohan.com\/?p=5911"},"modified":"2016-05-08T20:50:09","modified_gmt":"2016-05-08T12:50:09","slug":"linux-operation-and-maintenance-of-automated-tools-kickstart","status":"publish","type":"post","link":"https:\/\/mohan.sg\/?p=5911","title":{"rendered":"Linux operation and maintenance of automated tools Kickstart"},"content":{"rendered":"<p>Linux operation and maintenance of automated tools Kickstart <\/p>\n<p>Bulk Kickstart installation of the operating system tools, RedHat earlier launch of the product (not much to say, now playing Cobbler friends<\/p>\n<p>Test environment: CentOS 6.6 x86_64 minimal<\/p>\n<p>First, the installation package<\/p>\n<p> yum -y install dhcp tftp-server syslinux nfs-utils kickstart<\/p>\n<p>  cp \/usr\/share\/doc\/dhcp-4.1.1\/dhcpd.conf.sample \/etc\/dhcp\/dhcpd.conf<\/p>\n<p>  vim \/etc\/dhcp\/dhcpd.conf<\/p>\n<p># dhcpd.conf<br \/>\n# option definitions common to all supported networks&#8230;<br \/>\noption domain-name-servers 192.168.1.2, 192.168.1.3;<br \/>\n# A slightly different configuration for an internal subnet.<br \/>\nsubnet 192.168.1.0 netmask 255.255.255.0 {<br \/>\nrange 192.168.1.100 192.168.214.120;<br \/>\noption routers 192.168.1.2;<br \/>\noption subnet-mask 255.255.255.0;<br \/>\nfilename &#8220;\/pxelinux.0&#8221;;<br \/>\ndefault-lease-time 600;<br \/>\nmax-lease-time 7200;<br \/>\n}<\/p>\n<p>vim \/etc\/xinetd.d\/tftp<\/p>\n<p>service tftp<br \/>\n{<br \/>\nsocket_type = dgram<br \/>\nprotocol = udp<br \/>\nwait = yes<br \/>\nuser = root<br \/>\nserver = \/usr\/sbin\/in.tftpd<br \/>\nserver_args = -s \/var\/lib\/tftpboot<br \/>\ndisable = no<br \/>\nper_source = 11<br \/>\ncps = 100 2<br \/>\nflags = IPv4<br \/>\n}<\/p>\n<p>pxelinux.0<\/p>\n<p>cp \/usr\/share\/syslinux\/pxelinux.0 \/var\/lib\/tftpboot\/<br \/>\nmount \/dev\/cdrom \/mnt\/<br \/>\n cp \/mnt\/isolinux\/* \/var\/lib\/tftpboot\/<br \/>\n cd \/var\/lib\/tftpboot\/<br \/>\n mkdir pxelinux.cfg<br \/>\n mv isolinux.cfg pxelinux.cfg\/default<\/p>\n<p> NFS<\/p>\n<p>shell > vim \/etc\/exports<\/p>\n<p>\/mnt 192.168.1.0\/24(ro,sync)<\/p>\n<p>chkconfig &#8211;add nfs<br \/>\nchkconfig &#8211;add dhcpd<br \/>\nchkconfig &#8211;add xinetd<br \/>\nchkconfig &#8211;add rpcbind<br \/>\nchkconfig &#8211;level 35 nfs on<br \/>\nchkconfig &#8211;level 35 dhcpd on<br \/>\nchkconfig &#8211;level 35 xinetd on<br \/>\nchkconfig &#8211;level 35 rpcbind on<\/p>\n<p>exportfs -ar<br \/>\n service dhcpd restart<br \/>\n service xinetd restart<br \/>\n service rpcbind restart<br \/>\n service nfs restart<br \/>\n setenforce 0<br \/>\nservice iptables stop<\/p>\n<p>Seven test PXE boot installation<\/p>\n<p>1, the client set boot from the network (in fact, do not set the local network can not be found naturally go to find), you can see the installation interface<\/p>\n<p>2, select the language <\/p>\n<p>3, OK<\/p>\n<p>4. Select the keyboard (us) OK<\/p>\n<p>5, select the media location (NFS Directory) OK<\/p>\n<p>6, configure the network (the default can) OK<\/p>\n<p>7, Setting Up NFS Services (NFS server name: 192.168.1.10 ## NFS server address<br \/>\n                          CentOS directroy: \/ mnt ## ISO stowed position) OK<\/p>\n<p>8, where the installation interface appears normal, prove no problem (with CD-ROM to install a pattern)<\/p>\n<p>## This is the realization of the PXE boot installation, you want to have unattended configuration Kickstart!<\/p>\n<p>Eight, install the desktop environment<\/p>\n<p>## The following operation is performed directly in the virtual machine, the non-terminal connection! (Not necessary)<\/p>\n<p>yum grouplist | grep -iP &#8220;(x window system|desktop)&#8221;<\/p>\n<p>Desktop<br \/>\nX Winsow System<\/p>\n<p>yum update <\/p>\n<p>yum -y groupinstall &#8220;X Window System&#8221;<br \/>\nyum -y groupinstall &#8220;Desktop&#8221;<br \/>\ninit 5<\/p>\n<p>yum -y install system-config-kickstart<\/p>\n<p>system-config-kickstart<br \/>\nThe next point on the whole it is a little mouse!<\/p>\n<p>\u00b7 Basic configuration<br \/>\n                Default Language: Simplified Chinese to be the default (English)<br \/>\n                keyboard: to default<br \/>\n                time zone: Asia \/Singapore, according to the actual situation to<br \/>\n                UTC clock: Check the<br \/>\n                root password: test123<br \/>\n                confirm the root password: test123<br \/>\n                root password encryption: The default is on the hook, do not control<\/p>\n<p>                Advanced Configuration<br \/>\n                      reboot after installing the system: Check<br \/>\n\u00b7 Installation<br \/>\n                Performing a new installation: Tick<br \/>\n                Select the NFS:<br \/>\n                      the NFS server: 192.168.1.10<br \/>\n                      the NFS directory: \/ mnt ## NFS shared storage directory of ISO<br \/>\n\u00b7 Boot Loader Options<\/p>\n<p>                Mounting Type<br \/>\n                      install a new boot loader: Check the<br \/>\n                installation options<br \/>\n                      Boot Record (MBR) on the primary boot loader installation<br \/>\n\u00b7 partition information<br \/>\n                master boot record<br \/>\n                      to clear the Master Boot Record: Check the<br \/>\n                partition<br \/>\n                      to remove all existing partitions: Check the<br \/>\n                disk label<br \/>\n                      to initialize the disk label : check the<br \/>\n                layout<br \/>\n                      add partition (with the same real machine installed)<br \/>\n\u2022 network configuration<br \/>\n                to add network devices &#8211; network equipment (eth0) &#8211; the network type (DHCP) &#8211; to confirm<br \/>\n\u00b7 verify<br \/>\n                default<br \/>\n\u2022 firewall configuration<br \/>\n                disable<br \/>\n\u00b7 display configuration<br \/>\n                installation graphical environment: not checked (if you do not want to install it)<br \/>\n                to disable<br \/>\n\u00b7 package selection<br \/>\n                default<br \/>\n\u00b7 pre-installation script<br \/>\n                by default<br \/>\nafter installation script *<br \/>\n                default<\/p>\n<p>Select &#8211; File &#8211; Save &#8211; (Save the file to the \/ root directory, a file named ks.cfg)<\/p>\n<p>mkdir \/nfsdir<\/p>\n<p>cp ks.cfg \/nfsdir<\/p>\n<p>chown 777 \/nfsdir\/ks.cfg<\/p>\n<p>vim \/etc\/exports<\/p>\n<p>\/mnt 192.168.1.0\/24(ro,sync)<br \/>\n\/nfsdir 192.168.1.0\/24(ro,sync)<br \/>\n exportfs -ar<\/p>\n<p> vim \/var\/lib\/tftpboot\/pxelinux.cfg\/default<\/p>\n<p>default vesamenu.c32<br \/>\n#prompt 1<br \/>\ntimeout 50<\/p>\n<p>display boot.msg<\/p>\n<p>menu background splash.jpg<br \/>\nmenu title Welcome to CentOS 6.6!<br \/>\nmenu color border 0 #ffffffff #00000000<br \/>\nmenu color sel 7 #ffffffff #ff000000<br \/>\nmenu color title 0 #ffffffff #00000000<br \/>\nmenu color tabmsg 0 #ffffffff #00000000<br \/>\nmenu color unsel 0 #ffffffff #00000000<br \/>\nmenu color hotsel 0 #ff000000 #ffffffff<br \/>\nmenu color hotkey 7 #ffffffff #ff000000<br \/>\nmenu color scrollbar 0 #ffffffff #00000000<\/p>\n<p>label linux<br \/>\nmenu label ^Install or upgrade an existing system<br \/>\nmenu default<br \/>\nkernel vmlinuz<br \/>\nappend ks=nfs:192.168.1.10:\/nfsdir\/ks.cfg initrd=initrd.img<br \/>\nlabel vesa<br \/>\nmenu label Install system with ^basic video driver<br \/>\nkernel vmlinuz<br \/>\nappend initrd=initrd.img xdriver=vesa nomodeset<br \/>\nlabel rescue<br \/>\nmenu label ^Rescue installed system<br \/>\nkernel vmlinuz<br \/>\nappend initrd=initrd.img rescue<br \/>\nlabel local<br \/>\nmenu label Boot from ^local drive<br \/>\nlocalboot 0xffff<br \/>\nlabel memtest86<br \/>\nmenu label ^Memory test<br \/>\nkernel memtest<br \/>\nappend &#8211;<\/p>\n<p>## Wherein, timeout 50 (formerly 600 this parameter is a time into the system selection mode, we do not want to wait too long so the tone for five seconds)<br \/>\n## In the first label added: ks = nfs: 192.168.1.10: \/nfsdir\/ks.cfg (defined ks.cfg path)<\/p>\n<p>label linux<br \/>\nmenu label ^Install or upgrade an existing system<br \/>\nmenu default<br \/>\nkernel vmlinuz<br \/>\nappend ks=nfs:192.168.1.10:\/nfsdir\/ks.cfg initrd=initrd.img<\/p>\n<p>vim \/nfsdir\/ks.cfg<\/p>\n<p>#platform=x86, AMD64, ? Intel EM64T<br \/>\n#version=DEVEL<br \/>\n# Firewall configuration<br \/>\nfirewall &#8211;disabled<br \/>\n# Install OS instead of upgrade<br \/>\ninstall<br \/>\n# Use NFS installation media<br \/>\nnfs &#8211;server=192.168.214.10 &#8211;dir=\/mnt<br \/>\n# Root password<br \/>\nrootpw &#8211;iscrypted $1$56NxQt\/e$3fz.wnuWl7Ak7q9TIpwl0.<br \/>\n# System authorization information<br \/>\nauth &#8211;useshadow &#8211;passalgo=sha512<br \/>\n# Use graphical install<br \/>\ngraphical<br \/>\n# System keyboard<br \/>\nkeyboard us<br \/>\n# System language<br \/>\nlang US_ENG<br \/>\n# SELinux configuration<br \/>\nselinux &#8211;disabled<br \/>\n# Do not configure the X Window System<br \/>\nskipx<br \/>\n# Installation logging level<br \/>\nlogging &#8211;level=info<br \/>\n# Reboot after installation<br \/>\nreboot<br \/>\n# System timezone<br \/>\ntimezone &#8211;isUtc Asia\/singapore<br \/>\n# Network information<br \/>\nnetwork &#8211;bootproto=dhcp &#8211;device=eth0 &#8211;onboot=on<br \/>\n# System bootloader configuration<br \/>\nbootloader &#8211;location=mbr<br \/>\n# Clear the Master Boot Record<br \/>\nzerombr<br \/>\n# Partition clearing information<br \/>\nclearpart &#8211;all &#8211;initlabel<br \/>\n# Disk partitioning information<br \/>\npart \/boot &#8211;fstype=&#8221;ext4&#8243; &#8211;size=200<br \/>\npart swap &#8211;fstype=&#8221;swap&#8221; &#8211;size=1024<br \/>\npart \/ &#8211;fstype=&#8221;ext4&#8243; &#8211;grow &#8211;size=1<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Linux operation and maintenance of automated tools Kickstart <\/p>\n<p>Bulk Kickstart installation of the operating system tools, RedHat earlier launch of the product (not much to say, now playing Cobbler friends<\/p>\n<p>Test environment: CentOS 6.6 x86_64 minimal<\/p>\n<p>First, the installation package<\/p>\n<p> yum -y install dhcp tftp-server syslinux nfs-utils kickstart<\/p>\n<p> cp \/usr\/share\/doc\/dhcp-4.1.1\/dhcpd.conf.sample \/etc\/dhcp\/dhcpd.conf<\/p>\n<p> [&#8230;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[5],"tags":[],"_links":{"self":[{"href":"https:\/\/mohan.sg\/index.php?rest_route=\/wp\/v2\/posts\/5911"}],"collection":[{"href":"https:\/\/mohan.sg\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/mohan.sg\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/mohan.sg\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/mohan.sg\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=5911"}],"version-history":[{"count":1,"href":"https:\/\/mohan.sg\/index.php?rest_route=\/wp\/v2\/posts\/5911\/revisions"}],"predecessor-version":[{"id":5912,"href":"https:\/\/mohan.sg\/index.php?rest_route=\/wp\/v2\/posts\/5911\/revisions\/5912"}],"wp:attachment":[{"href":"https:\/\/mohan.sg\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=5911"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/mohan.sg\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=5911"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/mohan.sg\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=5911"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}