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, with LVM, and reboots after installation.
Modify the encrypted root password before using.
- centos6-ks-bios.cfg
#### Title: CentOS 6 Generic Kickstart file #### Description: Uses /dev/sda, eth0, 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