Home PC Games Linux Windows Database Network Programming Server Mobile  
  Home \ Linux \ Linux Basics Tutorial: Linux Kickstart automated installation     - Git uses a small mind (Linux)

- Fedora 22 installation and configuration optimization (Linux)

- How to install and use the malware detection tool LMD and ClamAV antivirus engine on Linux (Linux)

- Use matplotlib scientific drawing in Linux (Linux)

- Linux crontab commands and detailed usage examples (Linux)

- The bulk batch multiple rows of data collect (Database)

- How to install and use the Snort in Ubuntu 15.04 (Linux)

- Ubuntu mysql stop fail to solve the problem (Database)

- Oracle 11g maintenance partitions (Seven) - Modifying Real Attributes of Partitions (Database)

- Forgot Linux root password (Linux)

- Hive start being given: Found class jline.Terminal, but interface was expected (Database)

- MySQL binary packages install for RedHat Linux Enterprise 6.4 (Database)

- Installation Atom text editor on Mint Ubuntu / Linux (Linux)

- Getting Started with Linux system to learn: how to install USB webcams come in raspberry (Linux)

- Linux Task Scheduler (at, crontab) (Linux)

- Ubuntu install Liferea news subscription software (Linux)

- Ubuntu 14.04 LTS 64-bit install GNS3 1.3.7 (Linux)

- XtraBackup achieve non-stop use of master-slave synchronization service (Database)

- A detailed introduction to the Hadoop ecosystem (Server)

- PLSQL often lose resolution process automatically disconnect the connection (Database)

  Linux Basics Tutorial: Linux Kickstart automated installation
  Add Date : 2018-11-21      
  Speaking from the system installation

In RHEL, CentOS, Fedora and other systems, the installation system uses named anaconda, it belongs FedoraProject, the Python developers, providing a graphical or text interfaces for the installation.

Before installing the system, it may be no operating system on the computer's hardware, so in order to be able to run the installation program, you need a temporary operating system, boot boot, start the installation program, use the CD to install the operating system Linux (RHEL especially here Series system) when a total of two stages, namely boot and installation.
Stage 1

When using the bootable CD, the system startup process for the POST (Power On Self Test) ---> BIOS hardware detection and loading discs MBR ---> CD boot program is isolinux.bin, it generates according to a isolinux.cfg menu. When the user chooses to install the operating system bootstrap load the kernel (vmlinuz) and initrd.img files, initrd.img will generate a temporary operating system in memory for the installation process to provide an installation environment. When the system is switched to the initrd file system, initrd.img the init process calls / sbin / loader program, loader detect installation media, mount the CD /images/stage2.img (called in RHEL6 in install.img), switch to the stage2, stage2.img file system type is suqashfs, anaconda installation program on the system included.

Stage 2

stage2.img is SquashFS file system type, which contains the installer anaconda and its configuration file. anaconda provides the configuration interface of the installation process, it can provide text, graphics and other installation management, and support kickstart script provides automatic installation and other features. /root/anaconda-ks.cfg Automatically generates configuration information after you install the system, which records the installation of the system, select the option to automatically generate automatically after installation easy.
Here is the stage when installed CentOS 6 menu interface 1:

The menu options are from the CD /isolinux/isolinux.cfg file set. In the menu interface, press the Esc key to enter the command line mode, enter linux, the effect is equivalent to the first menu option, namely to install Linux operating system.

At the command line interface, you can also use other commands:
Network configuration:
netmask = MASK
gateway = GATEWAY
dns = DNS_IP
ifname = NAME: MAC_ADDR

Specify the kickstart file path
ks = cdrom: /path/to/ks.cfg
ks = http: //server/path/ks.cfg
ks = ftp: //server/path/ks.cfg
ks = nfs: server: /path/ks.cfg

dd: Loading drivers

Here ks instruction can specify a kickstart configuration file path, anaconda can automate kickstart install an operating system based on the configuration file.


Various options in the conventional system requires manual installation of the selected system installation, the kickstart file defines these installation options to choose, after reading the anaconda kickstart file, you can set the file system to be installed, without the need choose to install artificial configured.

Kickstart files can be obtained via a network during installation, it supports http, ftp, nfs other protocols, also kickstart files can be stored in the installation media (such as a CD image), read from the disc at the time of installation.

Create a kickstart file

After the end of a conventional installation, anaconda installation system based on this set, generating a set of identical files this kickstart installation, this file is located /root/anaconda-ks.cfg, you can modify this file for later use.

RHEL-based system also provides a graphical configuration tool kickstart file system-config-kickstart, the graphical interface can select installation options and save the result as a kickstart file.

kickstart file consists of three parts:

Command section

Command section is divided into the necessary commands and optional commands.

Required command
Setting the keyboard type keyboard us #
lang en_US # language settings
timezone [--utc] Asia / Shanghai # time zone selection
reboot | poweroff | halt # install the operating system after the completion of the (restart or shutdown)
selinux --disabled | --permissive # whether selinux enabled
authconfig --useshadow --passalgo = sha512 # system authentication, password authentication choice here, the encryption algorithm sha512
rootpw --iscrypted .... # encrypted root password
bootloader --location = mbr --driveorder = sda # bootloader installation location, where to choose to install the mbr

Optional command
install | upgrade # install / upgrade the operating system
url --url = .... # specified to install the system via FTP or HTTP path to the remote host
firewall --disabled | --enabled # firewall is turned on
firstboot --disabled | whether or not the user to configure the system for the first time after the start --enabled #
text | graphical # installation interface text / graphics
clearpart --linux | --all # installation before scavenging system which partitions, - all clears all the partitions
zerombr # using clearpart --all, you need to add this option, otherwise the installation process will be suspended, need to manually select
part # partition settings
part swap --size = 2048 # example of the swap partition
part / boot --fstype ext4 --size = 100000 # for the / boot partition an example of
part pv. --size = ... # create a PV
volgroup vgname pvname # Create VG
logval / home --fstype ext4 --name = home --vgname = vgname --size = 1024 # example creates a logical volume
% Include # the contents of other files can be included into the kickstart file, the file must be included in the process of installing the system can access

Package Selection section

Packages defined here to install the system to be installed by the beginning of the representation @ package groups, you can also specify a single package name, such as:
% Packages
@ Basic-desktop
@ Chinese-support
@ Client-mgmt-tools
@ Desktop-platform
@ General-desktop
@ Graphical-admin-tools
@ Legacy-x
@ Network-file-system-client
@ Perl-runtime
@ Remote-desktop-clients
@ X11
% End

Script section

After the script assigns pre-install script and installation script

% Pre represent pre-installation script, this time as a miniature version of the Linux system environment environment, the script should be as simple as possible

Here's script is usually used to query some system information, and then install the configuration information dynamically based on these settings, for example, use the following script
% Pre
# Set the configuration partition, configuration, swap and memory size is the same size as
#! / Bin / sh
act_mem = `cat / proc / meminfo | grep MemTotal | awk '{printf ("% d ", $ 2/1024)}'`
echo ""> /tmp/partition.ks
echo "clearpart --all --initlabel" >> /tmp/partition.ks
echo "part / boot --fstype = ext3 --asprimary --size = 200" >> /tmp/partition.ks
echo "part swap --fstype = swap --size = $ {act_mem}" >> /tmp/partition.ks
echo "part / --fstype = ext3 --grow --size = 1" >> /tmp/partition.ks
% End

This script before installing the system performs, it queries the system memory size, and generates partition command depending on memory size, stored in /tmp/partitoin.ks file.

Partition.ks then include this file in the kickstart file, you can dynamically set the partition size:
% Include /tmp/partitions.ks

% Post installation script indicates, this time Linux system environment is already installed system.

Here's the script can make some system configuration after installation, such as public key injection, storage configuration, third-party software installation, system service configuration file is modified and so on.

Make a bootable CD

As we mentioned above, the installation guide and install the system into two cloth. In CentOS installation CD 6, / isolinux directory is stored in the boot program for the boot, which is responsible for booting the system, a kernel is loaded into the temporary system, start the anaconda installer. The installer will make some initial system settings, install user package.

So, you can create a bootable CD, it is only responsible for the system boot, and install the system required installation tree entirely on the remote host, the CD-ROM can also built a kickstart file and modify the boot options menu when you install it automatically using a kickstart file to install.

Was produced as follows:
1. Prepare the working directory, such as / tmp / iso
2. Copy the installation CD / isolinux directory to / tmp / iso directory
3. The pre-made kickstart files into / tmp / iso directory

4. Edit /tmp/iso/isolinux/isolinux.cfg file so that it when installing directly kickstart profile

Found label linux menu item in the document, additional settings after ks append command, such as:
 label linux
  menu label ^ Install or upgrade an existing system
  menu default
  kernel vmlinuz
  append initrd = initrd.img ks = cdrom: /ks.cfg

5. Create iso image:
 mkisofs -R -J -T -v --no-emul-boot --boot-load-size 4 --boot-info-table
 -V "CentOS 6.6 X86_64 boot disk" -b isolinux / isolinux.bin -c isolinux / boot.cat -o /root/boot.iso cdrom /

You can then use the boot.iso image to install the operating system, of course, there need to be able to access a remote host installation tree over the network during installation.
- MySQL Tutorial: Using tpcc-mysql pressure measurement (Database)
- Ubuntu 14.04 Fixed update information is outdated error (Linux)
- Linux cut Command Study Notes (Linux)
- Ubuntu install Liferea news subscription software (Linux)
- The simple multi-threaded Python (Programming)
- Android Studio commonly used shortcuts and how to follow the Eclipse Shortcuts (Linux)
- Android will save the picture to see the album and timely (Programming)
- Linux C programming and Shell Programming in the development of practical tools similarities summary (Programming)
- C ++ Supplements --new delete overload (Programming)
- Install Oracle JDK 8 and JVM class loading mechanism in Linux (Linux)
- Thinking in Java study notes - everything is an object (Programming)
- Ansible installation configuration and simple to use (Server)
- Basic Java JNI (Programming)
- Linux system monitoring tool set cpu (Linux)
- MySQL optimization resulting order by using filesort (Database)
- Forwarding module with Apache reverse proxy server (Server)
- 2 minutes to read large data framework Hadoop and Spark similarities and differences (Server)
- ActiveMQ5.11.1 and JDK version matching relation (Linux)
- MD5 and simple to use (Linux)
- CentOS How quickly customize kernel binary RPM package (Linux)
  CopyRight 2002-2022 newfreesoft.com, All Rights Reserved.