Install Linux in batches using Kickstart (1)

Source: Internet
Author: User
Use Kickstart to install Linux in batches (1)-Linux Enterprise Application-Linux server application information. The following is a detailed description. In our daily work, we often need to install the same Linux on multiple computers with identical hardware, especially for cluster applications or backup database servers. I am a part-time Linux teacher. Due to the needs of lectures, I often need to install up to 10 or more Linux systems for students on computers with identical hardware configurations. If you use the most common CDROM installation method, it may take one day. With Kickstart, the installation is completed in about 60 minutes.

Kickstart is a fast and customized installation method developed by Red Hat. It allows the computer to automatically install it in a pre-designed manner. The most common method is network installation. You can also use CDROM or hard disk installation. This article describes how to install Kickstart over the network.

Create a boot disk

The installation of a disk can be completed in either Windows or Linux.

In Windows, use Red Hat to install the first rawritewin program on the CD. This program is in the dosutils/rawritewin directory under CDROM. When creating the first floppy disk, select images/bootnet. img for the Image File. This is the boot disk. When creating the second floppy Disk, select images/drvnet.net for the Image File. This is called a Driver Disk ). Depending on the model of your Nic, the drive disk may not be needed.

To create an installation disk in Linux, run the following command:

Dd if =/mnt/cdrom/images/bootnet. img of =/dev/fd0 (BOOT disk)

Dd if =/mnt/cdrom/images/drvnet. img of =/dev/fd0 (drive disk)

The boot disk contains the most common Nic drivers, such as 3Com 509/Intel eepro NE 2000. If your network card is not the most common, such as Lenovo D-Link530TX, you must make a more card drive.

Edit the file syslinux. cfg

Edit the syslinux. cfg file on the boot disk and rewrite the first line:

Default linux ks = floppy

If you need to use the drive disk of the NIC, rewrite the first line:

Default linux ks = floppy dd

The system will automatically prompt you to insert the drive disk.

Then delete the prompt and timeout rows.

Edit the ks. cfg file

This step is also the most important step for Kickstart installation. Ks. cfg is the core file for Kickstart installation. It specifies the method, where to install Linux, and what package to install. Ks. cfg is placed in the root folder of the floppy disk.

In the newly installed Red Hat system,/root/has an anaconda. cfg file, which can be edited as the basis, or the ksconfig program in X-Window. If you use the ksconfig program to set it, you may need to manually modify it. Below is the content of the ks. cfg file. For the convenience of explanation, I added the line number to the original article. Note that the official file cannot contain a row number.

1 # Generated by Kickstart aggregator

2 # System language

3 lang en_US

4 # Language modules to install

5 langsupport -- default en_US zh_CN.GB2312

6 # System keyboard

7 keyboard us

8 # System mouse

9 mouse genericps/2

10 # System timezone

11 timezone -- utc Asia/Shanghai

12 # Root password

13 rootpw 12345

14 # System bootloader configuration

15 bootloader -- location = mbr

16 # Install Red Hat Linux instead of upgrade

17 install

18 # Use FTP installation media

19 url -- url ftp: // 192.168.203.2/download

20 # Disk partitioning information

21 clearpart -- all

22 part/-- size 4200

23 part swap -- size 300

24 # Use DHCP networking

25 network -- bootproto dhcp

26 # System authorization information

27 auth -- useshadow -- enablemd5

28 # Firewall configuration

29 firewall -- disabled

30 # XWindows configuration information

31 # Probe for video card

32 # Probe for monitor

33 xconfig -- depth 16 -- resolution 1024x768 -- defadesktop desktop = GNOME

34% packages

35 @ KDE

36 @ Emacs

37 lynx

38% pre

39 echo "Welcome to my kickstart"

40% post

41 echo "192.168.10.55 Server">/etc/hosts

All comments starting with "#" can be ignored.

The language used for installation is specified in row 2nd. In fact, when the configuration is correct, kickstart installation does not require manual intervention. This article sets it as English.

Line 2 specifies the language environment supported by the system. If you do not install X-Window, you only need English. This article adds support for simplified Chinese.

Line 6-9 specifies the keyboard and mouse types used by the system. Generally, the keyboard is compatible with us. PS/2 with scroll wheel should be written:

Mouse msintelliips/2

We recommend that you use the ksconfig program to configure lines 6-9.

Line 10-11 is the time zone. users in China can select Shanghai.

Line 12-13 specifies the password of the root user. Another form is to encrypt the password.

Line 16-17 specifies whether to Install or upgrade. If yes, line 16 should replace the Install parameter with upgrade.

Lines 18th-19 indicate the location of the installation media, which is one of the key points for Kickstart installation. The installation media can be placed on the NFS, FTP, or HTTP server, or on the local hard disk. This article does not discuss hard disk installation, but only network installation. The specific method is to copy the Red Hat Directory from the three Red Hat installation discs to a certain location on the server, for example, under/tmp/install. If NFS is used for installation, you need to share/tmp/install and ensure that the clients that will install Red Hat Linux can access it. Read-Only permissions can be configured as follows:

The/etc/exports file is as follows:

/Tmp/install 192.168.10.0/255.255.255.0 (ro)

For FTP or HTTP installation, you can put the Red Hat Directory under ftproot or httproot. It is worth noting that in Windows, the "/" and "/" may be different. If the FTP Server is a Windows system, it is best to place the Red Hat Directory In the ftproot directory and then the next level directory.

Line 21-23 describes the partition to which Linux will install. clearpart-all indicates clearing all partitions. Create a 22nd GB partition in row as a "/" partition. Create a 23rd MB swap partition in line 3.

If an existing partition is used, write as follows:

Partition/-- onpart sda1

Partition swap-onpart sda2

Note: Line 21-23 is recommended not to use the ksconfig program to automatically set parameters. Manual configuration is more secure.

Row 25th means that the IP address is automatically allocated by the DHCP Server. If the number of installed machines is large, DHCP is undoubtedly the first choice. If you want to specify your own IP address, you should write it:

Network -- bootproto static -- ip 192.168.10.55 -- netmask 255.255.255.0
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.