Using Kickstart to Automate Linux Installations February 6, 2011Posted by Tournas Dimitrios in Linux.
My previous article presented a network based Linux installation , without doubt this method is much faster compared with the “traditional method ” (installing with cd’s) . Although the network method is a bit automated , you have to be on frond of the monitor to configure the installation ( what packages will be installed , firewall rules , root password etc ..) . Let us imagine a scenario where you have to set-up 40 computers on a small company (SOHO) ? . Even with the network installation method the process is terrible slow . Fortunately for us there is an alternative ” hands-free” installation method ( non-interactive) through a featured called kickstart.
The kickstart installation method is used primarily by Red Hat based distributions ( Fedora , CentOs ) to automatically perform unattended operating system installations .The configurations are taken from a file (anaconda.config.cfg) , so there is no need to be provided interactively from the user . A kickstart file consists of a series of options to be passed to the Anaconda installer which describe how to set up the system , optional it may include custom scripts to be run before and/or after the installation process . The file can be build by hand (simple editor) or using the GUI system-config-kickstart tool . Additionally Anaconda , the installer , produce a kickstart configuration file at the end of any manual installation process . This file can be taken and used to reproduce the same installation or even further configured by hand .
If you’re installing CentOs on a number of different computers, you will find the anaconda-ks.cfg file helpful. You can install CentOs the way you want on one computer. You can then use the anaconda-ks.cfg file from that computer as a template to install RHEL on the other identical computers on your network. If the computers aren’t identical, you can customize each anaconda-ks.cfg file as required, for elements such as a different hard disk size, host name, and so on.
A later article will provide details how to create a kickstart configuration file , for now let’s only focus on the practical implementation of this file . This article assumes that you are already familiar with the concepts of network based installation , to refresh your memory read my earlier article .So let’s get started :
- Copy the kickstart configuration file to the public directory of your server (FTP or HTTP) , after a fresh installation this file is found in the home directory of the root user .
scp anaconda.cfg 192.168.1.52:/var/ftp/pub/cf.cfg
- modify the permissions of the file with chmod
chmod 777 cf.cfg
- insert the boot cd in your computer and start the installation process
- Enter linux ks=ftp://192.168.1.52/pub/cf.cfg
My example made use of a FTP server , although the process is similar for HTTP .
- Relax or go to lunch🙂
As mentioned before , anaconda creates the configuration file that can be used as a template for the kickstart installation method . By default anaconda comments out the configurations that are related to the partition table , so the installation will be created with a default partition schema .
Probably you will need your own partition schema (like the one you created on your manual installation) , open the anaconda-config.cfg template file and comment out the lines that are related to the partition table . On my example , as you see on the picture below , I had to comment out 6 lines (19- 24) .