Linux KickStart – Automated Installation
What Is KickStart Installation?
/tmp
directory to assist with debugging installation failures.Note
You must read your distribution documents about fresh installation and upgrading current OS because some distributions don’t support upgrading via KickStart.
How Do You Perform a Kickstart Installation?
- Create a Kickstart file.
- Make the Kickstart file available on removable media, a hard drive or a network location.
- Create boot media, which will be used to begin the installation.
- Make the installation source available.
- Start the Kickstart installation.
Creating a Kickstart File
anaconda-ks.cfg
, located in the /root/
directory on the installed system. You can then copy this file, make any changes you need, and use the resulting configuration file in further installations.KickStart Example
Here is an example for KickStart configuration file:
#version=DEVEL #interactive install cdrom lang en_US.UTF-8 keyboard us network --onboot no --device eth0 --bootproto dhcp --noipv6 rootpw --iscrypted C8P8$ENbGfJxRkXFxZot4dwxWMu2kG07rqnlC7u8e64P0TT13olx9IDYfZnjRBU3OwNLz5OKVWkPWj.nJb4T93aOKb/ firewall --disable authconfig --enableshadow --passalgo=sha512 selinux --disabled firstboot --disabled services --disabled bluetooth,kdump,postfix,iptables,ip6tables,NetworkManager,lvm2-monitor services --enabled ntpd timezone --utc Etc/GMT bootloader --location=mbr --driveorder=sda --append="crashkernel=auto rhgb quiet" zerombr yes clearpart --all --drives=sda ignoredisk --only-use=sda part /boot --fstype=ext4 --size=512 part swap --size=32768 part / --fstype=ext4 --size=20480 part /u01 --fstype=ext4 --grow --maxsize=102400 --size=102400 part /tmp --fstype=ext4 --grow --maxsize=10240 --size=10240 part /var --fstype=ext4 --grow --maxsize=10240 --size=10240 %packages @base @client-mgmt-tools @core @debugging @basic-desktop @desktop-debugging @desktop-platform @development @directory-client @fonts @general-desktop @graphical-admin-tools @hardware-monitoring @input-methods @internet-browser @java-platform @legacy-unix @legacy-x @network-file-system-client @network-tools @perl-runtime @remote-desktop-clients @server-platform @server-policy @storage-client-multipath @uek4-kernel-repo @x11 mtools pax python-dmidecode oddjob wodim sgpio genisoimage device-mapper-persistent-data systemtap-client tigervnc-server abrt-gui gcc-gnat gcc-java jpackage-utils gcc-objc gcc-objc++ samba-winbind certmonger pam_krb5 krb5-workstation lm_sensors telnet-server telnet tcp_wrappers libXmu iptraf lksctp-tools perl-DBD-SQLite tsclient rdesktop vinagre tigervnc kernel-uek-devel libdtrace-ctf -ql23xx-firmware -rt73usb-firmware -ql2200-firmware -rt61pci-firmware -ql2100-firmware -kernel-firmware %end %post %end
The KickStart file has been copied from an exist Linux and I have customized that for other machines.
The file should be named as “ks.cfg”. It’s usual name for KickStart configuration file.
You can remove “#” from second line and active “Interactive” mode that means, administrator can override KickStart configuration, this mode is disabled by default.
If you face with “Storage Device Warning” then you should add “zerombr yes” in your configuration file.
Prepare Local Installation Media
After preparing KickStart configuration file, you need to create a boot media or prepare PXE for booting servers. I want to show you process of preparing boot and installation ISO on a single DVD.
I have used Oracle 6.8 ISO for that and you can use this instruction for RedHat Enterprise Linux and any other distributions that those are based on RHEL.
At first step, you need to a exist Linux and mount ISO on it and then follow the instruction:
- Mount the ISO file to a folder such as /mnt
- Make a folder for source files: /iso
- Copy all files and folders to /iso:
cp -Rp /mnt/DiskLabel/* /iso
It takes some minutes because more than 3GB should be copied.
- Two hidden files won’t copy by the above command, so copy the files manually:
cp /mnt/DiskLabel/.discinfo /iso cp /mnt/DiskLabel/.treeinfo /iso
- Then copy “ks.cfg” (KickStart configuration file) to “/iso/isolinux”
- Now, menu should be configure, so edit “/iso/isolinux/isolinux.cfg” and add the below lines to that:
label auto menu label ^Kickstart Installation menu default kernel vmlinuz append initrd=initrd.img ks=cdrom:/isolinux/ks.cfg inst.stage2=hd:LABEL=Linux-KickStart
Add them top of first “label” keyword. We are going to create an installation DVD for KickStart installation and normal installation, so don’t touch rest of menu sections. If you are using RHEL 7, use “inst.ks” instead of “ks” and also if you want to boot your machine by USB or hard disk, you should replace “cdrom” with “hd:LABEL”. Read “Boot Options” on RHEL document library or “Anaconda” document or “Oracle KickStart Boot Options” for more information.
- Now, you need to make ISO file from /iso directory:
mkisofs -r -T -J -V "Linux-KickStart" \ -b isolinux/isolinux.bin -c isolinux/boot.cat \ -no-emul-boot -boot-load-size 4 -boot-info-table \ -o /tmp/linux-kickstart.iso /iso
Make sure that ISO label is same as label that you have added to “isolinux.cfg” in previous steps.
- After the ISO file has been created completely, ISO checksum should be calculated:
implantisomd5 /tmp/linux-kickstart.iso checkisomd5 /tmp/linux-kickstart.iso
If you don’t have access to the command above, make sure the “genisoimage” and “isomd5sum” RPMs have been installed on your system.
- Burn the ISO file and check it.
Please share with me, if you face with any error or issue.
If you want to have advanced configurations or find more details about configuration that i have used, please read your distribution vendor documents. You will find very useful information.