Use Kickstart to install Linux in batches

Source: Internet
Author: User
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 part-time Lin

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 to: default linux ks = floppy

If you need to use the drive disk of the NIC, rewrite the first line to: default linux ks = floppy dd

At this time, the system will automatically prompt you to insert the drive disk, and 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. 1 # Generated by Kickstart aggregator
  2. 2 # System language
  3. 3 lang en_US
  4. 4 # Language modules to install
  5. 5 langsupport -- default en_US zh_CN.GB2312
  6. 6 # System keyboard
  7. 7 keyboard us
  8. 8 # System mouse
  9. 9 mouse genericps/2
  10. 10 # System timezone
  11. 11 timezone -- utc Asia/Shanghai
  12. 12 # Root password
  13. 13 rootpw 12345
  14. 14 # System bootloader configuration
  15. 15 bootloader -- location = mbr
  16. 16 # Install Red Hat Linux instead of upgrade
  17. 17 install
  18. 18 # Use FTP installation media
  19. 19 url -- url ftp: // 192.168.203.2/download
  20. 20 # Disk partitioning information
  21. 21 clearpart -- all
  22. 22 part/-- size 4200
  23. 23 part swap -- size 300
  24. 24 # Use DHCP networking
  25. 25 network -- bootproto dhcp
  26. 26 # System authorization information
  27. 27 auth -- useshadow -- enablemd5
  28. 28 # Firewall configuration
  29. 29 firewall -- disabled
  30. 30 # XWindows configuration information
  31. 31 # Probe for video card
  32. 32 # Probe for monitor
  33. 33 xconfig -- depth 16 -- resolution 1024x768 -- defadesktop desktop = GNOME
  34. 34% packages
  35. 35 @ KDE
  36. 36 @ Emacs
  37. 37 lynx
  38. 38% pre
  39. 39 echo "Welcome to my kickstart"
  40. 40% post
  41. 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 as: 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.

Line 18-19 specifies 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 better 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

-- Gateway 192.168.11.1 -- nameserver 202.96.134.20.

The machine with multiple NICs is a little more complicated. This article will not introduce it.

Row 27th specifies the method by which the system authenticates the user. This document uses the default Shadow password and MD5 encryption, which is the most common method.

Line 3 shut down the custom firewall. Because the ipchains firewall is used to install Red Hat, I suggest using iptables firewall after installation.

Line 30-33 shows the configuration of X-Window. This indicates the configuration that is automatically detected by the system. Linux generally correctly detects the model of the display card and display.

Line 1 indicates GNOME as the default window manager. the color is 16 bits, and the screen resolution is 33rd × 1024. If "-- startxonboot" is added at the end, it is the X-Window login after the boot.

Line 34-37 specifies the software to be installed during installation. The preceding "@" symbol represents a group of RPM packages. Each package contains a list of installed software, the software can be found in the Redhat/base/comps file on the first installation disc of Red Hat. If no group is specified, the base combination in the Redhat/Base/comps file will be installed, that is, some basic RPM packages, such as Sendmail. Write @ Everything to install it completely. There is an RPM package with lynx installed separately in line 37th.

% Pre in line 38-39 indicates the command executed before installation.

Line 40-41% post indicates the command to be executed after installation. Line 3 executes a simple command.

The final task is to copy the written ks. cfg to the floppy disk: cp ks. cfg/mnt/floppy

I have installed VMware in Windows 2000. I don't know why the drive speed is very slow when I use a CD to install Linux on a virtual machine. Therefore, the Server-u ftp Server is installed in Windows 2000, and Kickstart is installed in VMware. The result is very satisfactory. In addition, you can use Omni-NFS to implement the NFS Server function in Windows 2000 and use NFS for installation.

Use the % post command in Kickstart installation to directly configure the server.

Kickstart installation is one of the key points of learning Linux. in the Red Hat RH133 training course, Kickstart installation courses are available, but there are still few Chinese materials in this field, I hope this article will serve as a reference. This article also applies to the latest Red Hat 8.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.