Use PXE to call kickstart to install CentOS5

Source: Internet
Author: User
PXE boot advantages: the client does not require any peripheral support, no optical drive or USB flash drive, as long as the Nic supports PXE boot. Suitable for installation of multiple automatic responses. for example, you only need to specify A, B, or C configuration after PXE boot. Fully automatic unattended installation without peripherals. The number of machines to be installed is unlimited. yes.

Advantages of PXE boot:
The client does not require any peripheral support, and does not require optical drives or USB flash drives. you only need to enable PXE for the NIC.
Suitable for installation of multiple automatic responses. for example, you only need to specify A, B, or C configuration after PXE boot. Fully automatic unattended installation without peripherals.
The number of machines to be installed is unlimited. you can install multiple machines based on different configurations at the same time.
 
Workflow:
After the client is set to boot from PXE, the IP address and the next hop TFTP server address are obtained from the DHCP server, and then initr is loaded from the TFTP. img and vmlinuz boot file boot system, and finally specify to obtain the installation file from HTTP or FTP for installation. PXE à DHCP à TFTP à kickstart à HTTP/FTP
 
Server configuration:
DHCP, TFTP, and HTTP/FTP services must be configured on the server.
DHCP distributes IP addresses to PXE clients, TFTP provides boot files for clients, and HTTP/FTP provides installation source files for clients.
Package to be installed:
Dhcp. i386 tftp-server.i386 syslinux. i386 httpd. i386
 
Configure the DHCP server:
 
Create the dhcpd. conf file in the/etc directory or copy it from/usr/share/doc/dhcp-3.0.5/dhcpd. conf. sample CP to the/etc directory.
Main parameters:
Range dynamic-bootp is the IP address obtained after PXE is started.
Next-server is the next hop address after PXE obtains the IP address, that is, the TFTP server address.
Filename is the startup file.
The content is as follows:
------------------------------------- Content --------------------------------------------
Ddns-update-style interim;
Ignore client-updates;
Allow booting;
Allow bootp;
Subnet 192.168.40.0 netmask 255.255.255.0 {
# --- Default gateway
Option routers 192.168.40.254;
Option subnet-mask limit 255.0;
# Option nis-domain "domain.org ";
# Option domain-name "domain.org ";
Option domain-name-servers 192.168.40.254;
Option time-offset-18000; # Eastern Standard Time
# Option ntp-servers 192.168.1.1;
# Option netbios-name-servers 192.168.1.1;
# --- Selects point-to-point node (default is hybrid). Dont change this unless
# -- You understand Netbios very well
# Option netbios-node-type 2;
Range dynamic-bootp 192.168.40.13 192.168.40.15;
Default-lease-time 21600;
Max-lease-time 43200;
Next-server 192.168.40.163;
Filename "pxelinux.0 ";
# We want the nameserver to appear at a fixed address
# Host ns {
# Next-server marvin.redhat.com;
# Hardware ethernet 12: 34: 56: 78: AB: CD;
# Fixed-address 207.175.42.254;
#}
}
 
 
Configure the tftp server:
 
Vi/etc/xinetd. d/tftp
Disable = no. change the disable item to NO.
Copy the kernel startup file to the tftp Directory:
Cp/usr/lib/syslinux/pxelinux.0/tftpboot/
Copy the initr. img and vmlinuz files in the CentOS5.2 CD/media/image/pxeboot/directory to the/tftpboot/directory.
Copy the *. msg file under the CentOS5.2 CD/media/isolinux/to the/tftpboot/directory.
Create the pxelinux. cfg directory in the/tftpboot/directory. Copy the CD/media/isolinux. cfg file to the/tftpboot/pxelinux. cfg directory and change it to default. cfg.
The command is as follows:
# Cp/usr/lib/syslinux/pxelinux.0/tftpboot/
# Cp/media/image/pxeboot/initr. img/tftpboot/
# Cp/media/image/pxeboot/vmlinuz/tftpboot/
# Cp/media/isolinux/*. msg/tftpboot/
# Mkdir/tftpboot/pxelinux. cfg
# Cp/media/isolinux. cfg/tftpboot/pxelinux. cfg/default
 
 
Configure unattended installation:
 
1. edit the boot interface and add custom installation items.
[Root @ PXE/] # vi/tftpboot/boot. msg
^ Xsplash. lss
-To install or upgrade in graphical mode, press the ^ O0b ^ O07 key.
-To install or upgrade in text mode, type: ^ O0blinux text ^ O07.
-To Auto Install ^ O0bCentOS5.2 Linux ^ O07, type: ^ O0blinux autoinstall ^ O07.
-To Auto Install ^ O0bCentOS5.2 sn01 ^ O07, type: ^ O0blinux sn01 ^ O07.
-To Auto Install ^ O0bCentOS5.2 sn02 ^ O07, type: ^ O0blinux sn02 ^ O07.
-To Auto Install ^ O0bCentOS5.2 sn03 ^ O07, type: ^ O0blinux sn03 ^ O07.
-Use the function keys listed below for more information.
^ O0f [F1-Main] [F2-Options] [F3-General] [F4-Kernel] [F5-Rescue] ^ O07
The red color is the custom installation item I added, autoinstall sn01 sn02 sn03
2. edit the startup configuration file: add custom installation item labels and commands.
[Root @ PXE/] # vim/tftpboot/pxelinux. cfg/default
F3 general. msg
F4 param. msg
F5 rescue. msg
Label linux
Kernel vmlinuz
Append initrd = initrd. img
Label text
Kernel vmlinuz
Append initrd = initrd. img text
Label ks
Kernel vmlinuz
Append ks initrd = initrd. img
Label local
Localboot 1
Label memtest86
Kernel memtest
Append-
Label autoinstall
Kernel vmlinuz
Append ks = http: // 192.168.40.163/ks/ks228.cfg initrd = initrd. img devfs = nomount ramdisk_size = 9216 nofb
Label sn01
Kernel vmlinuz
Append ks = http: // 192.168.40.163/ks/ks01.cfg initrd = initrd. img devfs = nomount ramdisk_size = 9216 nofb
Label sn02
Kernel vmlinuz
Append ks = http: // 192.168.40.163/ks/ks02.cfg initrd = initrd. img devfs = nomount ramdisk_size = 9216 nofb
Label sn03
Kernel vmlinuz
Append ks = http: // 192.168.40.163/ks/ks03.cfg initrd = initrd. img devfs = nomount ramdisk_size = 9216 nofb
In red, the custom items I added point to the automatic response files on the HTTP server,
When a custom installation item is entered in the BOOT interface, the automatic response file on HTTP is automatically called to enable automatic unattended installation.
 
 
Client configuration:
Set the startup machine to PXE, and then specify the installation items to be used.
It is recommended that you do not set PXE to the first startup. Otherwise, the system will be installed once every startup. you should manually specify it to start from PXE, and the DELL server PXE should start with the F12 key.
First, the client will apply for an IP address from DHCP.

In the DHCP response, the client connects to the TFTP server to read the startup file, load the/tftpboot/boot. msg and/tftpboot/pxelinux. cfg/default files, and you can see the written custom installation items.
For example, to use the automatic response file KS02.cfg on the server,
You only need to press enter SN03 in BOOT to start automatic installation.

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.