The installation program for the CentOS series operating system anaconda with its configuration file kickstart

Source: Internet
Author: User

When installing the CentOS Linux operating system using a CD-ROM, a software called Anaconda is used, but there is no operating system on the disk before the system is installed, and there is no running environment for the program. So there's a compiled kernel and ramdisk and init process in a directory on the disc, starting with Init Anaconda.

Anaconda supports both text and graphics installation interfaces and divides the installation process into three stages:

    1. Pre-installation configuration
      1. Keyboard type
      2. Language
      3. Time
      4. Administrator password
      5. disks and how they are partitioned
      6. Packages to install
    2. Installation phase
      1. Create partitions on the target disk, perform formatting
      2. To install the selected package to the destination disk
      3. Generate bootloader
    3. First time start
      1. Configure Iptables
      2. Set SELinux
      3. Configure core dump core dumps to dump in-memory content to disk

These operations need to be selected manually, but Anaconda is supported by the read configuration file for automated installation, and its configuration file is called Kickstart. With Anaconda installed system, there is a anaconda-ks.cfg file in the root user's home directory, which records all configuration of Anaconda, and it can be understood as a kickstart file.

The kickstart file consists of a few parts:

Command segment: Configure the keyboard, disk partitions, etc., these commands have the necessary commands and optional commands, see Redhat official documentation.

650) this.width=650; "src=" http://s3.51cto.com/wyfs02/M01/6F/AD/wKioL1Wk_rTS73vUAAJlNlpWrK4795.jpg "/>

Package segment:%packages begins with a%end end, between which packages are installed, and if the package group is @gropename, the packages that are not installed are not written or-packagename.

650) this.width=650; "src=" http://s3.51cto.com/wyfs02/M01/6F/B0/wKiom1Wk_Nzh9QmfAAEmBRyw-MI144.jpg "/>

Script segment: The script that is executed before the installation starts with%pre, but because the Linux environment is miniature, the script should be as simple as possible, and the script to execute after installation is executed in%post, which runs in the complete Linux environment after installation. End with%end (optional).

650) this.width=650; "src=" http://s3.51cto.com/wyfs02/M01/6F/AD/wKioL1Wk_rXz0B_mAAH-NN-cM68791.jpg "/>

There are two ways to configure a kickstart file, one is to manually edit the configuration, and the other is to use the System-config-kickstart tool. However, to use System-config-kickstart, you need to install it using Yum, which is available in the base source of CentOS. After the installation is completed under Xshell Direct use of the System-config-kickstart command, it will start a GUI interface, this interface and Anaconda interface very similar, through the prompts step by stage configuration.

650) this.width=650; "src=" http://s3.51cto.com/wyfs02/M01/6F/B0/wKiom1Wk_N3Tlod-AALof2y5hJw706.jpg "/>

This command can also load an existing kickstart file to make changes and select it in the File menu.

After configuration we have two ways to use the Kickstart file: one is to place the kickstart on the disc, and the other is to put it on a network server. How to put it on a Web server I'll write it in a later blog about PXE and cobbler servers, and we'll use the production boot CD to complete the installation.

To create a bootable disc: According to the official CentOS CD, the contents of the boot installation process will be deducted and the installation tree removed.

  1. Prepare working directory
    1. Mkdir/tmp/cdrom
    2. [Email protected] ~]# Mkdir/media/cdrom
    3. [Email protected] ~]# Mount/dev/cdrom/media/cdrom

    In the CD-ROM directory, can display the installation interface provides the installation function is a directory called Isolinux

  2. Copy the Isolinux directory and the kickstart file to the/tmp/cdrom we prepared.
    1. [Email protected] cdrom]# cp-r isolinux//tmp/cdrom/
    2. [Email protected] cdrom]# chmod u+w/tmp/cdrom/isolinux/*
    3. [Email protected] cdrom]# cp/root/anaconda-ks.cfg/tmp/cdrom/ks.cfg
  3. Edit the relevant files in the Isolinux directory and make the ISO file:

    [[email protected] isolinux]# ls

    Boot.cat grub.conf isolinux.bin memtest TRANS. TBL Vmlinuz

    Boot.msg initrd.img isolinux.cfg splash.jpg VESAMENU.C32

    These are the files under the Isolinux directory, where Boot.msg and boot.cat are some hints of help information and a boot menu, splash.jpg is the background image of the installation interface, Vmlinuz is a microkernel, VESAMENU.C32, Isolinux.bin, Memtest is to provide the boot function of the program and data, and they need to use the configuration file is isolinux.cfg, we need to edit this file to allow the boot CD to automatically load the kickstart file. There are many lable in this file, not lable to complete different functions, some similar to the title in grub, we add a ks=cdrom:/after the append instruction in the Linux lable Ks.cfg, specifying the location of the kickstart file and then using the MKISOFS command to create the ISO image, if not specified, you need to enter the installation interface rear axle ESC key to enter the boot interface, manually specify:boot> Linux ip= 192.168.1.100 netmask=255.255.255.0 gateway=192.168.1.1 ks=cdrom:/ks.cfg.

    650) this.width=650; "src=" http://s3.51cto.com/wyfs02/M02/6F/AD/wKioL1Wk_raRL3AhAABzgah9Pvk991.jpg "/>

650) this.width=650; "src=" http://s3.51cto.com/wyfs02/M02/6F/AD/wKioL1Wk_raynH_uAACVbmTLs-8107.jpg "/>

4, the production of the ISO image is loaded into the host that needs to install the system and configured to boot from the CD-ROM is OK, because our CD is not provided installation tree, so the URL and repo instructions in the Kickstart file specify the file server on the network to provide the installation tree and package.

The installation program for the CentOS series operating system anaconda with its configuration file kickstart

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.