linux_wiki:os_install_kickstart

This is an old revision of the document!


OS Install: Kickstart Examples

General Information

Kickstart file examples.

Checklist

  • Enterprise Linux 6/7

Kickstart Install

  • Boot a system to installation media
  • On the “Welcome to CentOS” screen, highlight “Install or Upgrade an existing system” and press “tab” to edit boot options.
  • After “vmlinuz initrd=initrd.img”, append:
    ks=nfs:<nfs-server-ip>:/ISO/centos6.7-dvd/centos6-ks.cfg ksdevice=eth0 ip=x.x.x.x netmask=x.x.x.x gateway=x.x.x.x nameserver=<dns-ip>
  • Note: This can be pasted into the console by using most KVM menus. (Keyboard > Send Text to Target… > Paste in text > click Ok)

CentOS 6 Example Kickstart File

The following kickstart file performs a network install of CentOS 6 minimal, on /dev/sda, using MBR, with LVM, and reboots after installation.

Modify the encrypted root password before using.

centos6-ks-bios.cfg
#### Title: CentOS 6 Generic Kickstart file for BIOS systems
#### Description: Uses /dev/sda, MBR, and LVM to prepare a CentOS minimal installed system.
 
########################################
#### CUSTOMIZE THESE SECTIONS BELOW ####
########################################
 
## Install Location ##
install
nfs --server=10.0.0.200 --dir=/ISO/centos6.7-dvd
 
## Locale Settings ##
lang en_US.UTF-8
keyboard us
 
## System Configuration ##
rootpw  --iscrypted <root-hash-here>
 
#######################################
#### END OF CUSTOMIZATION SECTIONS ####
#######################################
 
## Networking ##
#network settings are inherited from the kernel image boot options in order to keep the kickstart generic
 
## System Configuration ##
firewall --service=ssh
authconfig --enableshadow --passalgo=sha512
selinux --disabled
timezone --utc America/Chicago
 
## Disk Partitioning ##
bootloader --location=mbr --driveorder=sda --append="crashkernel=auto"
 
# Clear Partitions => clear disk /dev/sda partitions, initialize partition tables (zerombr) #
clearpart --drives=sda --all
zerombr
 
# Physical Partitions #
part /boot --fstype=ext4 --size=512 --ondisk=sda
part pv.01 --grow --size=18512 --ondisk=sda
 
# LVM Setup #
volgroup vglocal --pesize=4096 pv.01
logvol /home --fstype=ext4 --name=lvhome --vgname=vglocal --size=4096
logvol / --fstype=ext4 --name=lvroot --vgname=vglocal --size=4096
logvol swap --name=lvswap --vgname=vglocal --size=4096
logvol /tmp --fstype=ext4 --name=lvtmp --vgname=vglocal --size=2048
logvol /var --fstype=ext4 --name=lvvar --vgname=vglocal --size=4096
 
## Packages to Install ##
%packages
@core
@server-policy
@workstation-policy
nfs-utils
%end
 
## Reboot After Installation ##
reboot
 
#### Auto execute post install commands ####
%post --interpreter /bin/sh
(
## Enter post install commands here (to launch a script maybe?)
 
)
%end

CentOS 7 Example Kickstart File

Modify the encrypted root password before using.

centos7-ks-bios.cfg
#### Title: CentOS 7 Generic Kickstart file for BIOS systems
#### Description: Uses /dev/sda, MBR, and LVM to prepare a CentOS minimal installed system.
 
########################################
#### CUSTOMIZE THESE SECTIONS BELOW ####
########################################
 
## Install Location ##
graphical
nfs --server=10.0.0.200 --dir=/ISO/centos7.2-dvd
 
## Locale Settings ##
keyboard --vckeymap=us --xlayouts='us'
lang en_US.UTF-8
timezone America/Chicago --isUtc --ntpservers=x.x.x.x,x.x.x.x
 
## System Configuration ##
rootpw  --iscrypted <root-hash-here>
 
#######################################
#### END OF CUSTOMIZATION SECTIONS ####
#######################################
 
## Networking ##
#network settings are inherited from the kernel image boot options in order to keep the kickstart generic
 
## System Configuration ##
auth --enableshadow --passalgo=sha512
eula --agreed
firewall --service=ssh
selinux --disabled
 
## Disk Partitioning ##
ignoredisk --only-use=sda
bootloader --location=mbr --boot-drive=sda
clearpart --all --initlabel --drives=sda
zerombr
 
# Physical Partitions #
part /boot --fstype="ext4" --ondisk=sda --size=512
part pv.01 --fstype="lvmpv" --ondisk=sda --grow --size=18512
 
# LVM Setup #
volgroup vglocal --pesize=4096 pv.01
logvol /tmp  --fstype="ext4" --size=2048 --name=lvtmp --vgname=vglocal
logvol swap  --fstype="swap" --size=4096 --name=lvswap --vgname=vglocal
logvol /home  --fstype="ext4" --size=4096 --name=lvhome --vgname=vglocal
logvol /  --fstype="ext4" --size=4096 --name=lvroot --vgname=vglocal
logvol /var  --fstype="ext4" --size=4096 --name=lvvar --vgname=vglocal
 
## System services ##
services --enabled="chronyd"
 
## Packages to Install ##
%packages
@^minimal
@core
chrony
nfs-utils
%end
 
## KDUMP - Disable ##
%addon com_redhat_kdump --disable --reserve-mb='auto'
 
%end
 
## Reboot After Installation ##
reboot

The only difference for EFI based systems in a kickstart file is the addition of a /boot/efi partition.

It is placed in the “Physical Partitions” section after the /boot partition.

# Physical Partitions #
part /boot --fstype="ext4" --ondisk=sda --size=512
part /boot/efi --fstype="efi" --ondisk=sda --size=512 --fsoptions="umask=0077,shortname=winnt"
part pv.01 --fstype="lvmpv" --ondisk=sda --grow --size=18512

  • linux_wiki/os_install_kickstart.1453929240.txt.gz
  • Last modified: 2019/05/25 23:50
  • (external edit)