Fully automatic linux installation

Source: Internet
Author: User
Friends who have installed linux may feel that it is not too difficult to install the linux system. However, if we can install a linux system directly in the future without any operation, is it awesome! Especially when you need to install the system in batches and often install the system, the advantages of automatic installation...

 

 

Friends who have installed linux may feel that it is not too difficult to install the linux system. However, if we can install a linux system directly in the future without any operation, is it awesome! Especially when systems need to be installed in batches and often, the advantages of automatic installation are fully reflected, we only need to add and modify the existing image, disk, and other files that store the installed files of the system, so that you can do whatever you want to do when installing the system, you do not have to be bound by system installation. Of course, this method can be applied to the installation methods of the CD, disk, http, ftp, and other systems. In fact, the method is similar. it can be used multiple times. it's very cool. Is there any wood ?!

 

Let's just start. here we will explain how to use a CD image to install the system.

1. create the ks file

To implement this function, we have to generate a file to record the configuration ks for the linux system. that is to say, this ks file records the configuration of the installed linux system, when installing the system, you will read this file and set the system to be installed.

We need to use the system-config-kickstart software, through which we can operate on the graphical interface

(1) install the system-config-kickstart software and run the command: yum install system-config-kickstart.

(2) after the installation is successful, run the system-config-kickstart command to start the software and open the graphical interface.

(3) configure the linux system to be installed in each option

(4) click "file" --> "save file" --> select the name and path to save (the name must end with. cfg, and ks. cfg by default)

Then, a ks file is generated in the corresponding directory that stores the configuration of the linux system to be installed,

2. assign our "soul" to our ISO image.

(1) mount the image system mount-o loop name. iso/mnt

Because the content in the/mnt directory we mounted is read-only, we can create a new directory, mkdir aaa, and test everything in/mnt into aaa: cp/mnt/* aaa next we will perform the operation in the aaa directory.

(2) When cd/mnt/aaa enters the aaa Directory, we will find a file and a directory (we assume the directory name is isolinux). We don't have to worry about these files and directories, copy the saved ks file to the aaa Directory (you can also copy it to the image directory, but it is inconvenient for us to specify the location of the ks file later.

3. reencapsulate the directory added to the ks file as an iso image.

The entire aaa directory is encapsulated into a new iso, and we name it new. iso.

Mkisofs-o new. iso-B isolinux/isolinux. bin-c isolinux/boot. cat-no-emul-boot-load-size 4-boot-info-tabie-R-J-v-T aaa/

This command is long and hard to understand. I will explain it below.

-O: specifies the name of the image to be generated.

-B specifies which file is the boot file from the CD drive (the file ending with. bin in the directory)

-C: Display the configuration information of the boot. cat file (files ending with. cat in the directory)

-No-emul-boot does not imitate the boot format (boot cannot be started without MBR in the CD)

At this point, our automatic installation image is created successfully. you can perform an experiment on a virtual machine. of course, can we also cut it into a CD? on the boot interface of the installation system, we only need to enter the location of the ks file. for our image, just enter the following command: linux ks = cdrom: ks. after cfg, press enter to perform automatic installation.

Some friends may find out that what they need is to find our ks file and specify the location and name of ks on the boot installation interface. I have to say that you are smart, whether we install the system through a CD, disk, ftp, or http, you must specify the location and name of the ks file as long as you want to perform automatic installation. of course, for different installation methods, the format of ks files is also different. you can enter the file name and path based on your actual situation. this is very important!

 

This article is from the "redhat" blog

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.