Install RHEL6 through PXE

Source: Internet
Author: User
Because my classmate's optical drive is damaged, I need to install RHEL through the network. Since I have not learned about the server, this is the first time I have used so many services to install the operating system, it also made me feel the joy of success for the first time. I read a lot of documents about PXE these days, but I couldn't install it successfully. Later I found my article about AndrewYu. Although he installed RHEL5, there are some differences with RHEL6, but after some minor modifications, we finally successfully installed RHEL through PXE. below is the fuqin liquor (

Because my classmate's optical drive is damaged, I need to install RHEL through the network. Since I have not learned about the server, this is the first time I have used so many services to install the operating system, it also made me feel the joy of success for the first time. I read a lot of documents about PXE these days, but I couldn't install it successfully. Later I found an article about Andrew Yu, who installed RHEL5, there are some differences with RHEL6, but after some minor modifications, we finally successfully installed RHEL through PXE. below is the original article of Andrew Yu, but some changes have been made according to RHEL6.

This document describes how to use Kickstart for unattended installation and how to set up a RHCE lab environment. The environment used in this article is RHEL 5, which is also applicable to CentOS. Author Andrew Yu is an experienced Linux/Unix system engineer who once worked as a RHCE lecturer for a while.

Principles and concepts
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 network card (NIC) supported by PXE, that is, the network card must have a PXE Client. PXE (Pre-boot Execution Environment) Protocol enables the computer to start through the network. The Protocol is divided into 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, the PXE client downloads the files stored on the remote end to the local computer for running through the network. To run the PXE protocol, you must set the DHCP server and TFTP server. The DHCP server is used to assign an IP address to the PXE client (the host on which the system is to be installed). Because the IP address is assigned to the PXE client, you need to add relevant PXE settings when configuring the DHCP server. In addition, TFTP client already exists in the PXE Client ROM. The PXE Client uses the TFTP protocol to download the required files to the TFTP Server.
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.

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 to be installed with a PXE Nic


Installation Steps

1. Install httpd
Yum-y install httpd *
2. Mount the RHEL5 DVD and copy all the content (files and folders) under the first disc to/var/html/www.
Mount/dev/cdrom/mnt
Cp-rf/mnt/*/var/html/www
3. Install tftp-server, enable the tftp service, and restart the xinetd Process
Rpm-ivh tftp-server-0.39-1.i386.rpm
Vi/etc/xinetd. d/tftp
# Default: off
# Description: The tftp server serves files using the trivial file transfer \
# Protocol. The tftp protocol is often used to boot diskless \
# Workstations, download configuration files to network-aware printers ,\
# And to start the installation process for some operating systems.
Service tftp
{
Socket_type = dgram
Protocol = udp
Wait = yes
User = root
Server =/usr/sbin/in. tftpd
Server_args =-s/var/lib/tftpboot # Here RHEL6 and RHEL5 are different.
Disable = no # disable changes from yes to no
Per_source = 11
CPIs = 100 2
Flags = IPv4
}
Service xinetd restart
Iv. Configuration support for PXE startup
Note that I have copied the content of the first CD to the/var/www/html directory, so I only need to copy the required files from the/var/ftp directory, however, during the description, I still indicated the actual location of the file, such as in which of the DVD discs, www.linuxidc.com is a file. I copied it from the/var/www/html directory. You can also learn it.
1. Go to the tftpboot folder and create one if there is no such folder.
Cd/tftpboot/
2. Copy pxelinux.0 to/tftpboot /.
Cp/usr/lib/syslinux/pxelinux.0/tftpboot
3. Copy/image/pxeboot/initrd. img and vmlinux to/tftpboot /.
Cp/var/ftp/image/pxeboot/initrd. img/tftpboot
Cp/var/ftp/image/pxeboot/vmlinux/tftpboot
4. Copy the isolinux/*. msg on the first installation disc to/tftpboot /.
Cp/var/ftp/isolinux/*. msg/tftpboot
5. Create a New pxelinux. cfg directory in tftpboot.
Mkdir pxelinux. cfg
6. Copy the isolinux. cfg file in the isolinux directory on the first installation CD of Linux to the pxelinux. cfg directory, and change the file name to default.
Cd pxelinux. cfg
Cp/var/ftp/isolinux. cfg/tftpboot/pxelinux. cfg/default
7. In the previous step, do not modify the default file. In fact, when this step is reached, I will be able to boot through the network. After network boot, I will be able to install it manually. But here we will discuss unattended installation, the so-called unattended installation does not need to be manually specified from boot to installation. Next we will continue to explain.

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.