I have a kickstart file I would like to reuse for machines of varying disk size. Can I statically set my volume sizes but then have it allocation the rest of the space to a single volume?
For example here is the disk part of my anaconda config:
# Disk partitioning information
part /boot --fstype="xfs" --ondisk=sda --size=1024
part pv.195 --fstype="lvmpv" --ondisk=sda --size=60214
part /boot/efi --fstype="efi" --ondisk=sda --size=200 --fsoptions="umask=0077,shortname=winnt"
volgroup cl --pesize=4096 pv.195
logvol swap --fstype="swap" --size=2048 --name=swap --vgname=cl
logvol / --fstype="xfs" --size=58160 --name=root --vgname=cl
Id like to be able to do this for the root volume:
# Disk partitioning information
part /boot --fstype="xfs" --ondisk=sda --size=1024
part pv.195 --fstype="lvmpv" --ondisk=sda --size=60214
part /boot/efi --fstype="efi" --ondisk=sda --size=200 --fsoptions="umask=0077,shortname=winnt"
volgroup cl --pesize=4096 pv.195
logvol swap --fstype="swap" --size=2048 --name=swap --vgname=cl
logvol / --fstype="xfs" --size=<****WHATEVER SPACE IS LEFT****> --name=root --vgname=cl
So this way no matter what the disk size of the VM Im running this kickstart config for the root volume will fit what space I have.
Best Answer
You would simply need to add the
--grow
option to your logvol line.From the RHEL 7 documentation:
Source: RHEL 7: 24.3.2 - Kickstart Commands and Options