When the CentOS installation is complete, the Anaconda-ks.cfg file is automatically generated in the administrator's home directory, and the configuration information generated during installation is saved in the Anaconda-ks.cfg file, which can be installed by editing the configuration file when multiple machines are installed on the same system. The contents of the Kickstart configuration file are as follows: #version =develinstallurl --url=http://172.16.0.1/cobbler/ks_mirror/centos-6.6-x86 _64/# reboot after installationrebootfirewall --disabledauthconfig --useshadow --passalgo=sha512selinux --disabledtimezone asia/shanghai# 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=ext4 --size=200#part pv.008002 --size=61440 #volgroup vg0 --pesize=8192 pv.008002#logvol / --fstype=ext4 --name=root -- vgname=vg0 --size=20480#logvol swap --name=swap --vgname=vg0 --size=2048#logvol /usr - -fstype=ext4 --name=usr --vgname=vg0 --size=10240#logvol /var --fstype=ext4 -- name=var --vgname=vg0 --size=20480% Packages@base@core@base@basic-desktop@chinese-support@legacy-x@network-file-system-client@perl-runtime@remote-desktop-cli ents@x11ibus-table-cangjieibus-table-erbi%end%postsed -i ' 1,[email protected]:[0-9]:initdefault : @id: 3:initdefault:@g ' /etc/inittab[ ! -d /root/.ssh ] && mkdir /root/.ssh && chmod og=--- /root/.sshcat >> /root/.ssh/ authorized_keys << eofssh-rsa aaaab3nzac1yc2eaaaabiwaaaqealmq1z0g/7wbgusuewfxlfnwzqcg/ Myqti/awp8lp+jj49xzikmzpewxhd8rwif5rldzo+6n7upk5o22x/qtmosi0egz4shavejeuko0eh+kygxxgbigumwmasl+yzbgwxt9h3zdzxi /qwcrbebv2nyb5mpysf7o0xqdhcst1mtfcyld8qxvkwc8riqba/1u9n6jedfbho+uzzyycr9zgk9uz4rrhb9bu7c1ghjucgrwbdauo47ihw/ot6ks9lb8lt2r/ujvodary/eohw8cafxo+qcvznsw2qkf/qo21ur/wz2u9srv0lvudnsvc2pytr+ ipldwhy81md430yinf9w== [email protected]eof# enable funcd sed -i ' [Email protected] =.* @certmaster = [email protected] ' /etc/certmaster/minion.conf/sbin /chkconfig funcd off# set the hostnameclientname= ' Ifconfig eth0 | awk '/inet addr:/{print $2} ' | awk -F. ' {print $NF} ' sed -i ' [ Email protected]=.*@[email protected] " /etc/sysconfig/networks# set puppet agentsed -i '/\[main\]/a server=server.magelinux.com ' /etc/puppet/puppet.conf/sbin/ chkconfig puppet off# set hostsecho ' 172.16.0.1 server.magelinux.com The composition of the server ' >> /etc/hosts# yum repo%endkickstart configuration file: Command segment: Keyboard disk partition, etc. package segment: %packages, %end Packages @group Package Group package -package - Do not install this package script segment: %pre pre-installation script: The script to be executed before the installation process begins; Note: The Linux system environment at this time is a miniature environment, so the script should be simpler and the work done is simpler %post Post-Installation script: The script to be executed after the installation process is complete; You can add the required scripts here Note: The script execution Environment is a complete system that has already been installed; kickstart Command Segment: Kickstart supported Commands Required Commands kickstart command to start Optional commands to assist with certain functions &nFor more information, refer to the official Red Hat document configuration Kickstart method: (1) Manually edit the configuration file; (2) System-config-kickstart,gui tool can only be opened in the graphical interface; package name with command name; installation #yum installsystem-config-kickstart command Line Input system-config-kickstart open as configuration interface to configure and save to the appropriate directory when the configuration is complete. You can configure by importing an existing ks.cfg, but you do not support configuring volume groups and logical volumes, and you need to copy the existing profiles to edit the new ks.cfg. How to install the system procedure how to obtain and use the Kickstart file: (1) is placed in the location that the installer can obtain; (a) place the image on the disc, expand the image and mirror it again (b) Network file server; requirements: The Setup program supports network functions, And be able to access the network file server; the installation processInstall Boot options boot: Two installation modes at the prompt linux: Default installation mode Linuxtext: Text installation mode network-related boot options: Manually fill in the IP address, etc. ip=IPADDR netmask=MASK gateway=GW dns=dns_server_ip ifname=NAME:MAC_ADDR indicates the path to the Get kickstart file: ks= DVDdrive ks=cdrom:/path/to/kickstart_file httpserver ks=http://server_ip:port/path/to/kickstart_file HTTPSServer ks=https://server_ip:port/path/to/kickstart_file FTPServer ks=ftp://serverip:port/path/to/kickstart_file NFSServer ks=nfs:server_ip:/path/to/kickstart_file Create a boot disc: only helps to start the installation process, does not provide the installation tree, (1) Prepare the working directory, for example, using/tmp/cdrom; mkdir /tmp/ CDROM (2) mount system release CD, copy Isolinux directory to/tmp/cdrom; mount -r –t iso9660 /dev/cdrom /media/cdrom cp –r isolinux/ /tmp/cdrom chmodu+w isolinux/* (3) Copy the created Kickstart file ks.cfg to/tmp/cdrom location; cp ks.cfg /tmp/cdrom (4) If necessary, you can edit the/tmp/cdrom/isolinux/isolinux.cfg after the append instruction in a label to append ks= cdrom:/ks.cfg information to enable the automatic call of the KS file provided on the CD; (5) Create an ISO image: #mkisofs -r -j -t -v --no-emul-boot --boot-load-size 4 --boot-info-table -v "CentOS 6.6 x86_64 boot disk " -b isolinux/isolinux.bin -c isolinux/boot.cat-o /root/boot.iso cdrom/ Start the disc Mirroring boot command prompt linuxip=172.16.27.1 netmask=255.255.0.0 ks=cdrom:/ks.cfg start automatic installation
Kickstart and boot image authoring