Centos installation _ PXE + Kickstart unattended guide Centos5 Installation

Source: Internet
Author: User
A prerequisite for PXE installation is that the computer to be installed contains a NIC (NICNetworkInformationCenter) supported by PXE, that is, the NIC must have PXEClient.

Principles and concepts:

 

1.1. What is PXE?

Strictly speaking, PXE is not an installation method, but a boot method.

A prerequisite for PXE installation is that the computer to be installed contains a NIC (NIC Network Information Center) supported by PXE, that is, a PXE Client must be included in the NIC.

PXE (Pre-boot Execution Environment) is a protocol designed by Intel that enables computers to start over the network.

The Protocol is divided into two ends: client and server. The PXE client is in the ROM of the NIC. When the computer boots, the BIOS transfers the PXE client to the memory for execution and displaysCommandMenu. After the user selects it, the PXE client downloads the operating system on the remote end and runs it locally through the network.

Since it is transmitted over the network, an IP address is required. That is to say, during the startup process, the client requests the server to assign an IP address, then the PXE Client uses the TFTP Client to download the files required to start the installer through the TFTP Protocol (Trivial File Transfer Protocol simple File Transfer Protocol.

To put it simply, the PXE network is installed. The client sends Broadcast Request IP addresses and other information requesting DHCP information to the network through a network adapter that supports PXE, the DHCP server provides the client with IP addresses and other information (TFTP server, Startup File, etc.), and then requests and downloads the files required for installation. In this process, a server is required to provide the Startup File, installation file, and automatic response file during the installation.

Describes how to automatically install the system in Linux:

 

 

 


Step 1: The PXE Client sends a request to DHCP

First, set the BIOS of the client that supports the PXE network interface card (NIC) to enable the network. The PXE BootROM (self-starting chip) will use UDP (simple User Datagram Protocol) send a broadcast request to request IP addresses and other information from the DHCP server on the network.

Step 2: DHCP server provides information

The DHCP server receives a request from the Client to verify whether the request is sent to a valid PXE Client. If the request is passed, the DHCP server will send a "provide" response to the Client, the "provide" response contains the IP address assigned to the client, the position of the pxelinux Startup Program (TFTP), and the location of the configuration file.

Step 3: The PXE client requests to download the Startup File

After receiving a response from the server, the client responds to a frame and sends a request to start the required file. These startup files include pxelinux.0, pxelinux. cfg/default, vmlinuz, and initrd. img.

Step 4: The Boot Server responds to client requests and transfers files

When the server receives a request from the client, more information will be generated between the server and the client to respond, to determine the startup parameters. BootROM is used by the TFTP communication protocol to download the files required to start the installation program from the Boot Server (pxelinux.0, pxelinux. cfg/default ). After the default file is downloaded, the boot kernel of the Linux installation program is started according to the boot sequence defined in the file.

Step 5: request to download the automatic response File

The client uses pxelinux. after the cfg/default file is successfully guided to Linux to install the kernel, the installer must first determine the installation media used to install linux. If the installation is through the network (NFS, FTP, HTTP ), at this time, the network will be initialized and the installation source location will be located.

Maybe you will say that PXE has already obtained an IP address? Why do I need to do it again? This is because PXE obtains the Kernel used for installation and the installer, And the installer obtains the Binary Package and configuration file required for the installation of the system.

Due to the different content they need, the PXE module and Installer are relatively independent, and the PXE network configuration cannot be passed to the installer. To obtain the IP address twice.

The location of the automatic response file ks. cfg specified in the file is read, and the file is downloaded according to the request.

Step 6: Install the operating system on the client

Download the ks. cfg file back, find the OS Server through the file, and download the required software package according to the configuration of the file.

After the OS Server establishes a connection with the client, it will start to transmit the software package, and the client will start to install the operating system. After the installation is complete, you will be prompted to reboot the computer. During the reboot process, you must change the BIOS back to boot from the hard disk. Otherwise, the operating system will be automatically installed again.

In the above introduction, the PXE client is a computer that requires Linux installation. The TFTP Server, DHCP Server, and NFS Server run on another Linux Server. The Bootstrap file (Boot Loader), configuration file, and Linux kernel are all stored in the root directory of the TFTP Server on the Linux Server. The Linux root file system is stored in the shared directory of the NFS Server.

The PXE client requires three binary files: bootstrap, Linux kernel, and Linux root file system. The Bootstrap file is an executable program that provides you with a simple control interface and downloads the appropriate Linux kernel and Linux root file system based on your selections.

1.2. What is KickStart?

KickStart is an unattended installation method.

The working principle of KickStart is to record various parameters required for manual intervention during a typical installation process and generate a file named ks. cfg file. In the subsequent installation process (not limited to the machine that generates the KickStart Installation File), when parameters are required, the installer first looks for the file generated by KickStart. When a proper parameter is found, the parameter is used. If no proper parameter is found, manual intervention is required by the installer.

 

In this way, if the KickStart file covers all the parameters that need to be filled in during the installation process, the installer can only tell the installer where to get ks. cfg file, and then busy with your own affairs.

 


After the installation is complete, the installer restarts the system based on the restart option set in ks. cfg and ends the installation.

1.3. PXE + KickStart installation conditions

The devices required for executing PXE + KickStart installation are:

? DHCP server;

? TFTP server;

? Ks. cfg configuration file generated by KickStart

? A server that stores system installation files, such as NFS, HTTP, or FTP servers.

? Host that will be installed with a PXE support Nic;

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.