Kickstart unattended installation of Linux principles

Source: Internet
Author: User

Steps to get a Linux distribution installation system:

    1. First, the power-on self-test post is naturally

    2. Self-test completed according to the BIOS set boot sequence in turn to find a bootable (bootable) device, this is set to CDROM

    3. Load the MBR of the disc and then load the menu according to ISOLINNUX.CFG load Isolinux.bin to provide an option to install the operating system, select the appropriate option after loading the Linux kernel Vmlinuz, and initrd file

    4. The Linux kernel inside the CD is loaded into memory and can load Anacoda (System installers used by Red Hat systems), Anacoda will generate a kickstart file based on the user's customization, The subsequent installation process is based on the Kiskstart file to determine how the partition is formatted, what to do before the installation, which packages to install, what to do after the installation is completed, and so on.


Here we should understand that the whole process to complete the unattended installation of the key process is this kickstart file, as long as the kickstart file, then everything seems to be so flowing.

    • You can specify the disc as the installation source directly in the Kickstart

    • You can also specify other accessible sources in kickstart, such as Http,ftp,nfs, in which case the disc file only needs to be booted.

    • Of course, it can be booted by PXE, and even the CD-ROM is saved


Each system is installed in the root directory generated /root/anaconda.cfg This file is the installation of this system in the installation options generated by the Kickstart file, Later make kickstart file can use this file directly or on this basis to make some changes.

It is still cumbersome to manually edit a kickstart file yourself, and you can install this software with the Yum installation System-config-kickstart for graphical tool editing.


After the installation is complete, you can execute the following command on the Xshell to output the graphics through Xmanager to Windows Operation & Show background run

[Email protected] isolinux]# System-config-kickstart &

You can open an existing Kickstart file editor by file--

650) this.width=650; "src=" Http://s3.51cto.com/wyfs02/M01/47/A4/wKiom1P9T3TjinJKAAOgAS3F2R4797.jpg "title=" Kickstart-configurator "width=" "height=" 466 "border=" 0 "hspace=" 0 "vspace=" 0 "style=" WIDTH:750PX;HEIGHT:466PX; " alt= "Wkiom1p9t3tjinjkaaogas3f2r4797.jpg"/>


Kickstart file structure: For more information, refer to Redhat official documentation Https://access.redhat.com/documentation/en-US/Red_Hat_Enterprise_ Linux/6/html/installation_guide/s1-kickstart2-options.html

  • Command Segment : for configuring the system

      • Install | Upgrade setting whether to install the system or upgrade the system

      • Keybord US setting up the keyboard

      • Lang en_US language

      • TimeZone Asia/shanghai Time Zone

      • ROOTPW--iscrypted (PASSWORD) password

      • CDROM installing the system from the CDROM

      • harddrive--partition=hda2--dir=/data/centos6 from HDD installation

      • NFS--server=ks.mydomain.com--DIR=/DATA/CENTOS6 installation from Server for NFS

      • URL--url=http://ks.mydomain.com/centos6 http installation, if there is anyone who wants to specify a username password URL--url=username:[email protected]/centos6 These four kinds of installation sources specify one, the specified path is a valid installation tree

      • Text | Graphical text interface or graphical interface installation

      • Firewall--diable | --enable

      • Network--bootproto=dhcp or network--bootproto=static--ip=172.16.100.1--netmask=255.255.0.0--gateway=172.16.0.1-- nameserver=172.16.0.1


    • software package Segment : Select the package groups and packages to install

      • @Base Base Package Group

      • LFTP installation Lftp

      • -zsh does not install the ZSH package, but if zsh is dependent on software that has been selected for installation, it will still be installed


    • Script Segment :

      • %pre system before the installation of the script to run the installation before the CD-ROM small Linux system, the shell is more streamlined, can only execute a simpler script

      • %post system installed after the completion of the script, then the system has been installed, full support shell various scripting functions


several ways to install using the Kickstart file :

    1. Using the system installation CD directly, press ESC to enter the boot: command line when you enter the menu option, manually specify the Kickstart file address, which requires the kickstart file to be shared beforehand

[[email protected] ~]# yum install vsftpd[[email protected] ~]# chkconfig vsftpd on[[email protected] ~]# service VSFTPD s Tart[[email protected] ~]# CP ks.cfg/var/ftp/pub/[[email protected] ~]# service vsftpd start[[email protected] ~]# lftp L OCALHOSTLFTP localhost:~> ls pub-rw-r--r--1 0 0 1400 15:22 ks.cfg

Press ESC at this interface to enter the boot: command line

650) this.width=650; "src=" http://s3.51cto.com/wyfs02/M02/47/B7/wKiom1P-12OBbTg5AAFOsMBXZqE443.jpg "style=" float: none; "title=" boot1.jpg "alt=" Wkiom1p-12obbtg5aafosmbxzqe443.jpg "/>

under the boot: command line ip= netmask= Configure the IP address ks= ftp:// Specify the KS file location

650) this.width=650; "src=" Http://s3.51cto.com/wyfs02/M00/47/B9/wKioL1P-2Q-CFOp-AABOipVc4XU983.jpg "title=" Boot2.jpg "alt=" Wkiol1p-2q-cfop-aaboipvc4xu983.jpg "/>

See the Linuxcircled above, why write a Linux here?

into the CD-ROM directory under the isolinux/directory to open the Isolinux.cfg file can see the following label Linux, boot input linux is the label name here, the following will actually demonstrate this effect, The delegate chooses this option, and then the ip= ks= is the kernel pass parameter to this option.

650) this.width=650; "src=" http://s3.51cto.com/wyfs02/M01/47/B7/wKiom1P-2NPygaqEAAB4XZcELsw715.jpg "title=" boot_ Label.jpg "alt=" Wkiom1p-2npygaqeaab4xzcelsw715.jpg "/>

The following is the normal installation process to start, completely without manual intervention

650) this.width=650; "src=" http://s3.51cto.com/wyfs02/M00/47/B9/wKioL1P-20GBw6_NAADgVG54iqg140.jpg "title=" Os_ Installing "alt=" Wkiol1p-20gbw6_naadgvg54iqg140.jpg "/>


2, I re-create a disc image file, the kickstart file into the boot.cfg to the KS file as the kernel parameters, the source of the installation tree can be made into a CD-ROM can also be shared through the network output

[[Email protected] ~]# mkdir boot[[email protected] ~]# cd boot[[email  protected] ~]# rsync -rl /var/ftp/pub/centos/isolinux ./     #  note the front isolinux do not add/  this will synchronize the entire ISOLINUXH directory [[email protected] boot]# lsisolinux[ [Email protected] ~]# cd isolinux[[email protected] isolinux]# lsboot.cat   grub.conf   isolinux.bin  memtest     trans. tbl     vmlinuzboot.msg  initrd.img  isolinux.cfg   SPLASH.JPG  VESAMENU.C32[[EMAIL PROTECTED] ISOLINUX]# CP&NBSP, .... /ks.cfg ./[[email protected] isolinux]# lsboot.cat  grub.conf    isolinux.bin  ks.cfg   splash.jpg  vesamenu.c32boot.msg   Initrd.img  isolinux.cfg  memtest&nBsp; trans. tbl   vmlinuz[[email protected] boot]# chmod u+w isolinux.cfg     #  Write access [[Email protected] isolinux]# vim isolinux.cfg menu  title welcome to centos 6.4 customed by bob    #   This way I changed the title to check the effect label windows    #  to check the effect I changed this label to windows  . menu label ^install or upgrade an existing system  menu  default  kernel vmlinuz  append initrd=initrd.img ip=172.16.100.100  netmask=255.255.0.0 ks=ftp://172.16.100.11/pub/ks.cfg    # append  followed by the KS path as a parameter to the kernel    [[email protected] isolinux]# cd                            [[email protected] ~]# pwd/root#  the following command to isolinux This directory of files into a Boot.iso disc image file [[email  protected] ~]# mkisofs -r -j -t -v -no-emul-boot -boot-load-size  4 -boot-info-table -v  "Mageedu testing image"  -b isolinux/isolinux.bin  -c isolinux/boot.cat -o /tmp/boot.iso boot/            [[email protected] ~]# ls /tmp/boot.iso /tmp/boot.iso


# files can be transferred to the host using the Xshell's own SFTP tool

650) this.width=650; "src=" http://s3.51cto.com/wyfs02/M02/47/B7/wKiom1P-4HWwKGbpAAC9NxsQl40949.jpg "title=" Xshell _sftp "alt=" Wkiom1p-4hwwkgbpaac9nxsql40949.jpg "/>


650) this.width=650; "src=" Http://s3.51cto.com/wyfs02/M02/47/BA/wKioL1P-41DjhPCEAAGey5ABegE369.jpg "title=" Bootiso.jpg "alt=" Wkiol1p-41djhpceaagey5abege369.jpg "/>

The virtual machine's CD-ROM changed to the newly created

650) this.width=650; "src=" http://s3.51cto.com/wyfs02/M02/47/B7/wKiom1P-3-Si3uCbAABXHzj_z0U444.jpg "style=" float: none; "title=" bootiso1.jpg "alt=" Wkiom1p-3-si3ucbaabxhzj_z0u444.jpg "/>

Start the virtual machine: Title changed, background picture I have a random picture also to change, according to their needs as long as the splash.jpg to replace your own image can be, the size of 640*480 pixels

650) this.width=650; "src=" Http://s3.51cto.com/wyfs02/M02/47/BA/wKioL1P-5ESyPn5LAAJ1W5jIo68057.jpg "title=" Customed_bootiso.jpg "alt=" Wkiol1p-5esypn5laaj1w5jio68057.jpg "/>

OU, enter windows, the same also started the Linux kernel loading process

650) this.width=650; "src=" http://s3.51cto.com/wyfs02/M02/47/BA/wKioL1P-5c3ici8zAAGVzYn8_HE661.jpg "title=" boot_ Label_custom.jpg "alt=" Wkiol1p-5c3ici8zaagvzyn8_he661.jpg "/>


The above is only for the rough deepening of the CD-ROM installation system process and kickstart unattended installation of the principle process, the actual production environment in the face of many servers will not be used to engrave the CD-ROM way to install, the next article will introduce PXE implementation network Automation installation deployment System.


This article from "Do not understand TCM it is not good TCM" blog, please be sure to keep this source http://zhishen.blog.51cto.com/1612050/1546209

Kickstart unattended installation of Linux principles

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.