Linux Journey Kickstart installing the operating system

Source: Internet
Author: User
Tags file transfer protocol

the principle of network installation systemWhen you choose to use a network installation in the motherboard BIOS, the PXE protocol is used to install the operating system. PXE (Pre-Boot execution Environment) is a protocol designed by Intel that enables a computer to boot over a network. The protocol is divided into client and server side, the PXE client writes to the ROM of the network card, when the computer starts booting, the BIOS sets the PXE client into memory according to the Boot key setting, PXE The client requests the IP address from the DHCP server on the LAN, obtains the configuration after the IP address according to the DHCP server, and goes to TFTP (Trivial File Transfer Protocol) server to download the system boot boot files and kernel files that will be placed on the remote operating system to be downloaded locally to run. That is, during its startup, the client requests the server to assign an IP address, in which a server is required to provide startup files, installation files, and automatic answer files during installation. The whole process is as follows: First step: PXE client sends request to DHCPThe PXE-enabled client is set to boot from the network, the BIOS sends the PXE client into memory after booting, and the client transmits a UDP (simple User Datagram Protocol) broadcast request to the DHCP server on the local area network for information such as IP addresses. Step Two: DHCP server provides informationThe DHCP server receives a request from the client to verify that it is from a legitimate PXE client, and after validation passes it gives the client a "provide" response that includes the IP address assigned to the client, the Pxelinux initiator (TFTP) location, and the location of the configuration file. Step three: PXE client requests download boot fileAfter the client receives a "response" from the server, it responds with a frame to request the file to be sent for launch. These boot files include: pxelinux.0, Pxelinux.cfg/default, Vmlinuz, initrd.img, and so on. Fourth Step: Boot server responds to client requests and transmits filesAfter the server receives the client's request, there will be more information between the client and the server to determine the startup parameters. Bootrom The files (pxelinux.0, pxelinux.cfg/default) that are necessary to launch the Setup program from the boot server by the TFTP communication protocol. When the default file is downloaded, the system configuration file Ks.cfg is loaded based on the boot order and boot location defined in the file, and the boot kernel vmlinuz and initrd.img of the Linux installer are started. Fifth Step: request to download the auto answer fileAfter the client has successfully booted the Linux installation kernel through the Pxelinux.cfg/default file, the Setup program determines what installation media you install with Linux based on the configuration in the default file, and if it is installed over a network (NFS, FTP, HTTP), The network is initialized at this time, and the installation source location is located according to the configuration option Inst.repo in the default file. The IP address is requested again from the DHCP server because the PXE client obtains the installed kernel and boot files, and the installer that installs the system after successful boot is getting the binaries and configuration files required to install the system. The PXE client module and the installer are relatively independent because they require different content, and the network configuration of the boot is not passed to the installer. This allows you to get the IP address process two times. It then reads the location of the auto answer file ks.cfg specified in the file (default) and downloads the file based on that location request. Sixth step: The client installs the operating system    After downloading the ks.cfg file, locate the OS Server through the configuration in the file, and follow the configuration option "URL--url=" of the file to request a download of the packages required for the installation process. After the OS server and the client establish a connection, the transfer package begins and the client begins to install the operating system. After the installation is complete, you will be prompted to restart your computer. At this point, be sure to change the BIOS back to boot from the hard drive during the reboot process, or repeat the automatic installation of the operating system. In the description above, the PXE client is the computer that needs to install Linux, and the TFTP server, DHCP server, and NFS server are running on another Linux server. Bootstrap files, configuration files pxelinux.0 and Pxelinu.cfg/default, Linux kernel vmlinuz, and initrd.img are placed under the root directory of the TFTP server on the Linux server. The Linux root file system resides in the shared Directory of NFS server. While the PXE client is working, it requires three binaries: bootstrap, Linux kernel, and Linux root file system. The bootstrap file is an executable program that provides the user with a simple control interface and, depending on the user's choice, downloads the appropriate Linux kernel and Linux root file system.   A, to realize the function of Remote installation Server system, to achieve unattended automatic installation.   Second, the configuration process 1. Installing the configuration DHCP server
Ddns-update-style    interim;ignore client-updates; option routers                  192.168.2.1;default-lease-time 21600; Max-lease-time 43200;subnet 192.168.2.0 netmask 255.255.255.0 {                range DYNAMIC-BOOTP 192.168.111.100 192.168.111.200;        FileName    "pxelinux.0";                 #pxelinux startup file location;        Next-server 192.168.2.1;                 The IP address of the #TFTP Server;}
2. Install and configure the TFTP server
Yum-y Install Tftp-server
To edit the TFTP profile/etc/xinetd.d/tftp change the Disable Yes to disable no, save to exit the restart XINETD
Systemctl Restart Xinetdsystemctl Enable xinetd
3. Configure startup and startup files to first attach the ISO file to the/media directory
Mount/dev/sr0/media
(1) Copy the pxelinux.0 file to the/var/lib/tftpboot/folder
CP  /usr/share/syslinux/pxelinux.0    
If this file is not found in the/usr/share/directory, the syslinux is not installed and needs to be installed manually
Yum-y Install Syslinux
Description: Syslinux is a powerful boot loader and is compatible with a variety of media. More precisely: Syslinux is a small Linux operating system that is designed to simplify the first time you install Linux, and to create repair or other special-purpose boot disks.
(2) Copy the/image/pxeboot/initrd.img and Vmlinux to the/var/lib/tftpboot/folder in the image file
Cp  
(3) Copy the/media/isolinux/boot.msg in the ISO image to the/var/lib/tftpboot/folder
Cp/media/isolinux/*.msg    /var/lib/tftpboot/
(4) Create a new pxelinux.cfg directory in/var/lib/tftpboot/
Mkdir/var/lib/tftpboot/pxelinux.cfg
(5) Copy the isolinux.cfg from the/isolinux directory in the ISO image to the Pxelinux.cfg directory, and change the file name to the default
CP  /media/isolinux/isolinux.cfg    
(6) Modify the default file to comment out the default VESAMENU.C32 on the first line add a new line of default Linux and then find the label Linux, modified as follows: (Here is the HTTP installation source to install)
Label Linux                                  menu label ^install CentOS 7  kernel vmlinuz  append initrd=initrd.img ks=http://192.168.1.210/ Os/ks.cfg Inst.repo=http://192.168.1.210/os
Then save the exit so that all configuration files are configured; 4. Install configure the operating system source location (NFS or HTTP) (1) HTTP installation Source installation method first install the configuration httpd
Yum-y Install httpd
Second, configure the installation files directory
mkdir/var/ww/html/oscp/media/*/var/www/html/os
5. Create a ks.cfg configuration file
Vim/var/www/html/os/ks.cfg
My profile default configuration is as follows  
#platform =x86, AMD64, or Intel em64t#version=devel# Install OS instead of upgradeinstall# Keyboard layoutskeyboard ' Us ' # R Oot passwordrootpw--iscrypted $1$wjgxthbg$svk/yh3jp0zg3smlgt0lt0# System timezonetimezone Asia/Shanghai--isUtc# System Languagelang en_us# Firewall configurationfirewall--disabled# System authorization Informationauth--useshadow- -passalgo=sha512# Use graphical installgraphical# Run the Setup Agent on first bootfirstboot--enable# SELinux Configurati Onselinux--permissive # Use NFS installation Media#nfs--server=192.168.1.210--dir=/tmp/isoimg# use HTTP installation Me Dia#url--url=http://192.168.1.210/os/url--url=http://192.168.1.210/os/# Network informationnetwork--bootproto= DHCP--device=eth0--onboot=on--noipv6# Reboot after installationreboot# System bootloader Configurationbootloader-- location=mbr# Clear the Master Boot recordzerombr# Partition clearing information#clearpart--all--initlabel# Disk Partit Ioning Informationpart/boot/efi--fstype= "EFi "--ondisk=sda--size=256part/boot--fstype=" XFS "--ONDISK=SDA--size=500part/--fstype=" XFS "--ondisk=sda--size= 5000part/home--fstype= "XFS"--ondisk=sda--size=5000%packages@base@core@fonts@input-methods@multimedia%end%pre#  >2.0TB hard disk need to try-to-use GPT instead of mbr.parted-s=boot_disk_device= Mklabel gpt%end%post########### #EFI BOOT ############ #mkdir-P/boot/efi/efi/boot\cp-r/boot/*/boot/efi\cp/boot/efi/efi/redhat/grub.efi/boot/efi/efi/ Boot/bootx64.efi\cp/boot/grub/grub.conf/boot/efi/efi/boot/bootx64.conf\cp/boot/grub/splash.xpm.gz/boot/efi/efi /boot/splash.xpm.gz%end
Configure to save Exit 6 later. Start the client host, set the first boot entry for the network boot, and then start the installation; Restart the machine when the installation is complete change the boot option to boot from the local hard disk, or repeat the installation process, and later will learn to use cobbler to install the operating system, and to be continued.

Linux Journey Kickstart installing the operating system

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.