Article Title: How to install a Linux (CentOS) system over the network. Linux is a technology channel of the IT lab in China. Includes basic categories such as desktop applications, Linux system management, kernel research, embedded systems, and open source.
I. Principles
If you want to install Linux on a server without an optical drive or a soft Drive. We need to install Linux after booting through the PXE protocol of the NIC. process: Machine startup-Nic boot-IP address obtained through DHCP-obtain the most basic kernel file through tftp, use this kernel file to start the machine-after startup, you can configure the installer, select http, ftp, and nfs to remotely obtain the required software package for installation.
Obviously, the server must be configured for network installation. Our server must provide the following services:
DHCP
TFTP
HTTP (FTP, NFS)
II. service configuration
1. DHCP
Configuration File:
Option domain-name "mydomain ";
Ddns-update-style none;
Default-lease-time 600;
Max-lease-time 7200;
Server-name "bootserver ";
Subnet 192.168.123.0 netmask 255.255.255.0 {
Range 192.168.123.200 192.168.123.201;
Deny unknown-clients;
}
Host MyP5 {
Filename "pxelinux.0 ";
Server-name "bootserver ";
Hardware ethernet AE: 32: 20: 00: b0: 02;
Fixed-address 192.168.123.90;
}
Here is the copied configuration file. let's explain it a bit:
Filename is followed by a file in the tftp directory, and pxelinux.0 is a file in the syslinux package. By default, pxelinux.0 may be in the/usr/lib/syslinux directory and must be copied to the tftp directory.
Host MyP5:
Hardware ethernet AE: 32: 20: 00: b0: 02;
Fixed-address 192.168.123.90;
The MAC address and assigned IP address of the client (the machine on which the system is to be installed.
2. TFTP
Because the TSIZE protocol must be supported, the original TFTP package cannot be installed. I chose to use tftp-hpa
.
Edit the file/etc/xinetd. d/tftp (if not, add the tftp file) (if xinetd. d does not exist, install the xinetd package)
# Default: off
# Description: The tftp server serves files using the trivial filetransfer \
# 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
{
Disable = no
Socket_type = dgram
Protocol = udp
Wait = yes
User = root
Server =/usr/sbin/in. tftpd
Server_args =-s/tftpboot
Per_source = 11
CPIs = 100 2
Flags = IPv4
}
Here,/tftpboot is defined as the default directory of the tftp service. you can modify it on your own.
After saving the file, restart the/etc/init. d/xinetd service to enable the tftp service.
How can I test whether tftp is enabled successfully?
Create a file in the tftp Directory, such as 1.txt.
Connect to the tftp service in Shell:
Tftp 127.0.0.1
Tftp> get 1.txt
If the service is successfully enabled, you can see the prompt that the file is successfully downloaded. And find the 1.txt file in the current directory.
Copy the vmlinuz and initrd. imgfiles under the isolinux directory on the CD to the/tftpboot directory.
Create the syslinux. cfg. syslinux. cfg folder in/tftpboot and save the two configuration files pxelinux: default and list.
Default:
Default linux
Label linux
Kernel vmlinuz
Append initrd = initrd. img devfs = nomount nofb ramdisk_size = 9216
You can write many labels, depending on the number of Linux versions you want to provide on this server to the client for installation. One version and one label, of course, the kernel and initrd file names cannot be repeated.
List:
Choose one of the following Linux distributions for your installation:
Name Distribution Arch. Installation media
-----------------------
CentOS 4.4 i386 192.168.99.90 :/
You can also add multiple lines to select different release versions. Enter the content under Name when selecting.
3. copy a CD file
Copy the CD file to the corresponding directory (ftp, http, and nfs). If you are using http, run the following command to copy multiple CD files to one Directory:
[Root @ bootserver] # cp-arv/media/cdrom/*/install
If you use ftp, make sure that you can access it (with a user name and password ).