linux_wiki:os_install_kickstart

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revision Previous revision
Next revision
Previous revision
linux_wiki:os_install_kickstart [2016/01/27 16:10]
billdozor [CentOS 6 Example Kickstart File]
linux_wiki:os_install_kickstart [2019/05/25 23:50] (current)
Line 6: Line 6:
  
 **Checklist** **Checklist**
-  * Enterprise Linux 6/7+  * Distro(s): Enterprise Linux 6/7 
 + 
 +---- 
 + 
 +====== External Resources ====== 
 + 
 +  * [[https://access.redhat.com/documentation/en-US/Red_Hat_Enterprise_Linux/6/html/Installation_Guide/s1-kickstart2-options.html|RHEL Kickstart Options]]
  
 ---- ----
Line 12: Line 18:
 ====== Kickstart Install ====== ====== Kickstart Install ======
  
-  * Boot a system to installation media +See this page for the complete process[[linux_wiki:os_install_bare_metal|OS InstallBare Metal]]
-  * 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:<code bash>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></code> +
-  * **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 ======+====== CentOS 6 Example Kickstart File (bios) ======
  
 The following kickstart file performs a network install of CentOS 6 minimal, on /dev/sda, using MBR, with LVM, and reboots after installation. The following kickstart file performs a network install of CentOS 6 minimal, on /dev/sda, using MBR, with LVM, and reboots after installation.
Line 35: Line 38:
 ## Install Location ## ## Install Location ##
 install install
-nfs --server=10.0.0.200 --dir=/ISO/centos6.7-dvd+nfs --server=10.0.0.200 --dir=/iso/centos6.7-dvd
  
 ## Locale Settings ## ## Locale Settings ##
Line 42: Line 45:
  
 ## System Configuration ## ## System Configuration ##
-rootpw  --iscrypted <root-hash-here>+rootpw  --iscrypted <root-encrypted-password-here>
  
 ####################################### #######################################
Line 66: Line 69:
 # Physical Partitions # # Physical Partitions #
 part /boot --fstype=ext4 --size=512 --ondisk=sda part /boot --fstype=ext4 --size=512 --ondisk=sda
-part pv.01 --grow --size=18512 --ondisk=sda+part pv.01 --grow --size=26624 --ondisk=sda
  
 # LVM Setup # # LVM Setup #
Line 72: Line 75:
 logvol /home --fstype=ext4 --name=lvhome --vgname=vglocal --size=4096 logvol /home --fstype=ext4 --name=lvhome --vgname=vglocal --size=4096
 logvol / --fstype=ext4 --name=lvroot --vgname=vglocal --size=4096 logvol / --fstype=ext4 --name=lvroot --vgname=vglocal --size=4096
-logvol swap --name=lvswap --vgname=vglocal --size=4096+logvol swap --name=lvswap --vgname=vglocal --size=8192
 logvol /tmp --fstype=ext4 --name=lvtmp --vgname=vglocal --size=2048 logvol /tmp --fstype=ext4 --name=lvtmp --vgname=vglocal --size=2048
 logvol /var --fstype=ext4 --name=lvvar --vgname=vglocal --size=4096 logvol /var --fstype=ext4 --name=lvvar --vgname=vglocal --size=4096
Line 85: Line 88:
  
 ## Reboot After Installation ## ## Reboot After Installation ##
-reboot+reboot --eject
  
 #### Auto execute post install commands #### #### Auto execute post install commands ####
-%post --interpreter /bin/sh+%post --interpreter /bin/sh --log=/root/ks-post.log
 ( (
-## Enter post install commands here (to launch a script maybe?)+## Enter post install commands here to execute prior to reboot 
 +# Useful for performing something like the below example:
  
 +# Startup rpcbind for NFS
 +#service rpcbind start
 +
 +# Mount admin share
 +#mount -vt nfs 10.1.2.3:/admin /mnt
 +
 +# Create /root/scripts dir
 +#mkdir /root/scripts
 +
 +# Copy the firstboot script to the new dir, set owner/permissions
 +#cp -v /mnt/deploy/firstboot/firstboot.sh /root/scripts/
 +#chown -Rv root:root /root/scripts
 +#chmod -Rv 700 /root/scripts
 +
 +# Create line in rc.local to auto-execute the firstboot script
 +#echo "/root/scripts/firstboot.sh" >> /etc/rc.d/rc.local
 +
 +# Un-mount admin share
 +#umount -v /mnt
 ) )
 %end %end
Line 98: Line 121:
 ---- ----
  
-====== CentOS 7 Example Kickstart File ======+====== CentOS 7 Example Kickstart File (bios) ======
  
 **Modify the encrypted root password before using.** **Modify the encrypted root password before using.**
Line 112: Line 135:
 ## Install Location ## ## Install Location ##
 graphical graphical
-nfs --server=10.0.0.200 --dir=/ISO/centos7.2-dvd+nfs --server=10.1.2.--dir=/iso/centos7.2-dvd
  
 ## Locale Settings ## ## Locale Settings ##
Line 120: Line 143:
  
 ## System Configuration ## ## System Configuration ##
-rootpw  --iscrypted <root-hash-here>+rootpw  --iscrypted <root-encrypted-password-here>
  
 ####################################### #######################################
Line 148: Line 171:
 volgroup vglocal --pesize=4096 pv.01 volgroup vglocal --pesize=4096 pv.01
 logvol /tmp  --fstype="ext4" --size=2048 --name=lvtmp --vgname=vglocal logvol /tmp  --fstype="ext4" --size=2048 --name=lvtmp --vgname=vglocal
-logvol swap  --fstype="swap" --size=4096 --name=lvswap --vgname=vglocal+logvol swap  --fstype="swap" --size=8192 --name=lvswap --vgname=vglocal
 logvol /home  --fstype="ext4" --size=4096 --name=lvhome --vgname=vglocal logvol /home  --fstype="ext4" --size=4096 --name=lvhome --vgname=vglocal
 logvol /  --fstype="ext4" --size=4096 --name=lvroot --vgname=vglocal logvol /  --fstype="ext4" --size=4096 --name=lvroot --vgname=vglocal
Line 170: Line 193:
  
 ## Reboot After Installation ## ## Reboot After Installation ##
-reboot+reboot --eject 
 + 
 +#### Auto execute post install commands #### 
 +%post --interpreter /bin/sh --log=/root/ks-post.log 
 +
 +## Enter post install commands here to execute prior to reboot 
 +# Useful for performing something like the below example: 
 + 
 +# Startup rpcbind for NFS 
 +#systemctl start rpcbind 
 + 
 +# Mount admin share 
 +#mount -vt nfs 10.1.2.3:/admin /mnt 
 + 
 +# Create /root/scripts dir 
 +#mkdir /root/scripts 
 + 
 +# Copy the firstboot script to the new dir, set owner/permissions 
 +#cp -v /mnt/deploy/firstboot/firstboot.sh /root/scripts/ 
 +#chown -Rv root:root /root/scripts 
 +#chmod -Rv 700 /root/scripts 
 + 
 +# Copy firstboot service unit to system, set owner/permissions 
 +#cp -v /mnt/deploy/firstboot/firstboot.service /etc/systemd/system/ 
 +#chown -v root:root /etc/systemd/system/firstboot.service 
 +#chmod -v 644 /etc/systemd/system/firstboot.service 
 + 
 +# Enable firstboot service for next boot 
 +#systemctl enable firstboot.service 
 + 
 +# Un-mount admin share 
 +#umount -v /mnt 
 +
 +%end
 </code> </code>
 +
 +----
 +
 +====== CentOS 6/7 EFI Kickstart ======
 +
 +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.
 +<code bash>
 +# 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
 +</code>
 +
 +----
  
  • linux_wiki/os_install_kickstart.1453929033.txt.gz
  • Last modified: 2019/05/25 23:50
  • (external edit)