Issue
How can I force a single partition in cents 7 through the kickstart file?
Sometimes disk size is small (virtual box builder, 50GB) sometimes large (v-sphere builder 1TB) how can I ensure that only a single partition is created for both cases?
The regular autopart
will create multiple partitions.
The full kickstart file can be found here https://gist.github.com/geoHeil/e4944088c5350835672279ec3e7edd0b the (as far as I think relevant subparts (of me trying to achieve the goal as outlined) are:
clearpart --all --initlabel --drives=sda
# Make the volgroup
volgroup VolGroup --pesize=4096 pv.008002
# Setup swap on the volgroup
logvol swap --name=lv_swap --vgname=VolGroup --size=2016 --maxsize=2016
# Make / on the volgroup
logvol / --name=lv_root --vgname=VolGroup --fstype=ext4 --grow --size=1
# Setup the boot partition on the volgroup
part /boot --fstype=ext4 --size=500
Currently, it does not work and not enough space is assigned for the partition when using the packer script of https://github.com/chef/bento/blob/master/centos/centos-7.4-x86_64.json with my modified kickstart file.
Solution
the solution is
zerombr
clearpart --all --initlabel
# cant use autopart require one single big partition
part pv.008002 --size=1 --grow --ondisk=sda
volgroup VolGroup --pesize=4096 pv.008002
logvol swap --name=lv_swap --vgname=VolGroup --size=2016 --maxsize=2016
logvol / --name=lv_root --vgname=VolGroup --fstype=ext4 --grow --size=1
part /boot --fstype=ext4 --size=500
Answered By - Georg Heiler Answer Checked By - Marilyn (WPSolving Volunteer)