How do I install a Linux operating system in bulk?

Source: Internet
Author: User
Tags administrator password

First, the system installation principle:

Linux System Installation Process:

POST----> Bootloader (ramdisk)-----> Anaconda System Installer

In fact, installing the operating system is to import the compiled binary format of the operating system into the target disk, you need to access the hardware. This involves the installation program Anaconda can drive the target disk. If the target disk cannot be driven, the application cannot import the file into the target disk, in order to solve this problem, the springboard----ramdisk. It's a small Linux. is in memory. It will be able to drive the disk. Of course it does more than just drive the disk.

When RAMDisk starts up, it executes the/sbin/loader loader and then runs: Anaconda program, which interacts with the user to complete the installation of the system under the guidance of the program.

The Anaconda program provides a two-way interactive interface:

1, text text interface takes up less memory, the installation system speed is relatively fast. Of course it also depends on whether you are minimizing the installation or ...       2, GUI interface CentOS 6 memory requires 512M to start GUI interfaces. CentOS 7 memory requires 1G to start the GUI interface.

The process of installing the operating system in Anaconda is divided into two phases:

1, pre-installation configuration

Keyboard type

Language during installation: the language that is displayed under the boot of the Anaconda System Setup program. It is usually in English.

Support for language use

Time

Select the disk device you want to use

Planning for disk use:

Such as: whether the root (/) uses LVM. /Var,/home,/usr,/usr/local These are the directories in which data changes frequently are made as separate partitions,

Partition using File system, block size, etc.

Size of the swap partition?

Select the package to install

Administrator password

2, the installation phase (Anaconda installation program will be licensed in front of the configuration to perform the installation operation of the system)

Creating partitions on the target disk, performing partition formatting

To install the selected package to the destination disk

Install the bootloader to the target disk.

Second, how to implement the server batch deployment?

1, first realize the automatic installation of operating system

Since the installation program provides an interactive interface, to manual intervention to complete the installation of the system, then how to achieve automated installation?

If, when we deploy the server in bulk, or use the ISO CD image to install the operating system, the efficiency is conceivable. Anaconda is very friendly and provides us with a feature:

In the text installation mode, you can make the pre-installation configuration into a ks.cfg format file (using [[email protected] ~]# System-config-kickstart & Startup Text window, you can make the Ks.cfg file).

When the RAMDisk is started, it is passed to the kernel as a parameter.

As described below:

[email protected] isolinux]# cat isolinux.cfgdefault vesamenu.c32 #prompt 1timeout 600display boot.msg Menu Background Splash.jpg. label Linux menu label ^install or upgrade an existing system menu default kernel Vmlinuz-- -----> Boot kernel append initrd=initrd.img ks=cdrom:isolinux/ks.cfg---------> Parameters passed to the kernel.

Description

BootLoader, expand the kernel vmlunuz,initrd.img based on the configuration file isolinux.cfg. This is the RAMDisk boot process.

When the RAMDisk boot is complete, the/sbin/loader loader is executed, the Anaconda program is started, and the program reads the Ks.cfg file located in the Cdrom:isolinux directory.

The pre-installation configuration is automatically completed based on the file.

It is because we can put Anaconda install the operating system in the process of the first paragraph: pre-installation configuration, made into Ks.cfg file. No need for manual intervention, Anaconda.

You can follow the file to complete the configuration before installing the operating system. Then go directly to the installation phase (the Anaconda installer will perform the installation of the system according to the previous configuration).

This allows for automated installation of the operating system.


2. Realize the sharing of ks.cfg and installation source. How to implement the network boot system installation.

However, when we deploy the server in bulk, although it is possible to automate the installation of the operating system, but does not solve the problem of batch, that is, at some point, only for a single server

Install the operating system, wait until the server installation is complete, the next server can be installed on the system. However, we can make multiple installation disks. If our installation disk is a CD-ROM,

To provide an optical drive for the first server, if our installation disk is a USB flash drive, you need to provide a USB drive for each server. This does not fully automate the deployment of servers, then we

How to solve it?

Since, our system installation disk is exclusive. It can be made into a shared way. Put the Ks.cfg file and the installation source (install tree) in a public place. Each server is available to

The place to get the Ks.cfg file and installation source (install tree).

Ks.cfg and installation sources can be located locally or anywhere on the network, as long as they are available. So, how do they define it?

(1), ks.cfg is defined in the bootloader configuration file.

(A) If the installation disk is a CD-ROM, its bootloader configuration file is: Isolinux.cfg. In the Append directive, the Ks.cfg file is passed as a parameter to the kernel.

CentOS 6 way: ks=cdrom:/directory/ks.cfg ks=http://server/path/to/ks.cfg Ks=ftp://username:[ema Il protected]/path/to/ks.cfg CentOS 7 way Inst.ks=cdrom:/directory/ks.cfg inst.ks=http://server/path/to /ks.cfg Inst.ks=ftp://username:[email protected]/path/to/ks.cfg

(B) If you use a network card (PXE-enabled) for system boot. The configuration file for its bootloader is: Pub/pxelinux.cfg/default. Also in the Append directive, the Ks.cfg file is passed as a parameter to the kernel.

CentOS 6 way Ks=http://server/path/pxelinux.cfg/ks.cfg Ks=ftp://username:[email Protected]/path/pxelinux . cfg/ks.cfg CentOS 7 Way Inst.ks=http://server/path/pxelinux.cfg/ks.cfg Inst.ks=ftp://username:[ema Il protected]/path/pxelinux.cfg/ks.cfg

(2), installation source (installation tree install trees)

is specified in the ks.cfg.

CentOS 6 designation Method: Repo--name= "CentOS"--baseurl=http://192.168.100.7/centos6/--cost=100 CentOS 7 designation method: INST.R EPO--name= "CentOS"--baseurl=http://192.168.100.7/centos6/--cost=100

Although, through the FTP server, or the Web server or Server for NFS, the ks.cfg and installation sources are shared out. However, it is essential that the server to which the operating system is installed have an IP address to access these resources.

But how do you configure an IP address for a machine that doesn't have an operating system installed?

But also know where the shared resource is located (the IP address of the shared server resource),

If you know the URL of the Zixi, you should also download the resources locally. So to provide download tools to download the required resources. This is a problem, how to configure the IP address of the machine without installing the operating system, how to install the download tool?

In fact, this uses the PXE technology to the NIC. This card is a ROM chip with a built-in DHCP client application and a TFTP client application. Boot complete hardware self-test biso will put these client applications

To run in memory as long as the DHCP client is able to connect to the DHCP server and obtain the address from the DHCP server. The server that needs to install the system has an address that satisfies the basic conditions for accessing the shared resource. Also know that the shared resource server

Address and URI to access the shared resource. The DHCP server is a big help.

The DHCP server tells the client what server bootloader is on, and what the boot file is, so the TFTP client knows the URL of the bootloader. You can download the bootloader.

The following is the configuration in the DHCP server How to tell the NIC TFTP address and the network card to do the system boot program bootloader called What.

[Email protected] isolinux]# vim/etc/dhcp/dhcpd.conf...next-server 172.16.0.1 filename "pxelinux.0" ...

At this time, the TFTP client gets the URL of the shared resource from the DHCP server, downloads the Bootloader,vmlinuz and initrd.img to the local deployment according to the profile default (boot configuration file)

Displays the menu of the installation interface, completes the Rardisk boot in memory

[[email protected] isolinux]# cat isolinux.cfgdefault vesamenu.c32-----> Menu #prompt 1timeout 600display boot.msg Me    Nu background splash.jpg-----> Background image ... label linux menu label ^install or upgrade an existing system menu default Kernel vmlinuz-------> Boot kernel append initrd=initrd.img ks=http://tftp_server/tftpboot/ks.cfg----> Parameters passed to the kernel Number.

When the RAMDisk boot is complete, the Anaconda system installer is started through/sbin/loader, and the program reads the Ks.cfg file, which is defined in the Ks.cfg file, where the installation source (install tree) is located.

Position. This enables the batch to the server to install the operating system.


This article is from the "Linux" blog, so be sure to keep this source http://9528du.blog.51cto.com/8979089/1533042

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.