CentOS start-up process and kickstart and boot image creation

Source: Internet
Author: User


1.centos Installation During the boot process actually through the installation program Anaconda (only for the CentOS system, using the Anaconda program to install), Anaconda run on the OS, the OS is not installed, That's how Anaconda works? In fact, after Init startup, the Anaconda program is running, the earlier is actually: the CD-ROM on the bootloader and the specified configuration of the Vmlinuz, initrd.img--after the completion of the direct Operation Anaconda.


Installation of 2.anaconda
1.anaconda divides the installation process into two stages:

1. Pre-installation configuration stage (for keyboards, each country uses different keyboard types, such as sticks, three o, etc.), language, time zone, administrator password, disk and how it is partitioned, packages to install

2 Installation phase:

                Install the selected package to the target disk;
& nbsp;              generate bootloader;

To restart the first boot after installation, remember to configure Iptables, SELinux, Core dump (to prevent memory crashes)

2. Partitions at installation

1. There are generally 2 basic partitions installed in the system:

/: Root partition

Swap: Swap partition (once there is no swap partition, hard disk space is not enough to have a problem)


2. If the root partition is placed on a logical volume, because grub cannot drive and access the logical volume, the/boot must be partitioned separately and using a basic disk partition instead of a logical volume, there should be 3 partitions:

         /: Root partition, which is placed on logical volume

         / Boot: Use basic disk partitioning, cannot use logical volume

          Swap: Swap partition

Note: In order to prevent system crashes, the reload system loses important critical data, sometimes/usr,/var,/home/tmp/,usr/local can be partitioned separately, in the future when the system is re-installed, only the root partition, format root, other/usr,/var,/home/ tmp/only need to be mounted. "
"Note: All of the above installation procedures are run by the Anaconda program"


4. Another way to install the system: automatic completion by reading the Kickstart configuration file

The 1.anaconda application supports the configuration of the installation process by reading the contents of the configuration file, the configuration file is called the Kickstart file (in the CentOS or Red Hat series), the file is in the/root directory, this method is needed for batch deployment.

The composition of the 2.kickstart file:
Command segment
Package segment:%packages,%end#表示要安装的程序包
@group#安装包组
Package#要装的包
-package#不安装package包
Script segment:
%pre#安装前脚本: The script to execute before the installation process begins; "Note: The Linux system environment at this time is a miniature environment, so the script should be simpler;"
%post# Post-installation script: The script to execute after the installation process is complete; "Note: The script execution Environment is a complete system that has already been installed;"

3.kickstart command segments, divided into two categories: required commands and optional commands (auxiliary to complete some functions)
1. How to configure Kickstart:

(1) Manually edit the configuration file;

(2) System-config-kickstart,gui tool; The package name of the installation command System-config-kickstart is the same as the command name;


2. How the installation process obtains and uses the Kickstart file:
(1) Put in the position that the installation program can obtain;
(a) placed on a disc image;
(b) Network file servers;
"Requirements: The installation program supports network functions and can access the network file server;"


3. Installation boot options during the installation process
1.boot:
Linux #启动默认安装模式
Linux text #启动文本安装模式

2. Network-related boot options:

Ip=ipaddr

Netmask=mask

Gateway=gw

Dns=dns_server_ip

Ifname=name:mac_addr #网卡名


3. Indicate the path to get the Kickstart file

ks=

DVD Drive Ks=cdrom:/path/to/kickstart_file

HTTP Server Ks=http://server_ip:port/path/to/kickstart_file

HTTPS Server Ks=https://server_ip:port/path/to/kickstart_file

FTP Server Ks=ftp://serverip:port/path/to/kickstart_file

NFS Server Ks=nfs:server_ip:/path/to/kickstart_file


650) this.width=650; "src="/e/u261/themes/default/images/spacer.gif "style=" Background:url ("/e/u261/lang/zh-cn/ Images/localimage.png ") no-repeat center;border:1px solid #ddd;" alt= "Spacer.gif"/>

The following shows how to create a bootable CD that only helps to start the installation process and does not provide an installation tree:
(1) First prepare the working directory, for example use/tmp/cdrom here;

#mkdir/tmp/cdrom

(2) Mount system release CD, copy Isolinux directory to/tmp/cdrom;

#mount/dev/sr0/media/centos-version
#cp/media/centos-version/tmp/cdrom/

(3) Make Kickstart file with command System-config-keckstart, copy the Kickstart file ks.cfg to/tmp/cdrom location;

#system-CONFIG-KICKSTART#CP Ks.cfg/tmp/cdrom

(4) If necessary, you can edit the/tmp/cdrom/isolinux/isolinux.cfg, after a label after the append instruction appended ks= information, so as to achieve the automatic call to the KS file provided on the CD;


(5) Create ISO image, use command Mkios create a boot.iso file, Boot.iso file is our boot image, here our image is finished.

# 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/iso Linux.bin-c Isolinux/boot.cat-o/root/boot.iso cdrom/

(6) If necessary, you can use SFTP to copy the prepared Boot.iso image to Windows, and then create a new virtual machine, in the virtual machine to adjust the boot order for the CD-ROM boot, that is, our boot.iso, boot boot can


CentOS start-up process and kickstart and boot image creation

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.