I have read so many kickstart configs and pressed recipes that my head is spinning, and I just need some help or clarification regarding this. Before I go too much into the config, the gist is that I am trying to create an unattended Ubuntu Server 18.04 install, the bit that splices my kickstart config and other files into the ISO for it to be used later works perfectly, however the intention here is to utilise two hard disks with LVM, and that's what isn't working.. At all.
Current KS:
#System bootloader configuration
bootloader --location=mbr
#Clear the Master Boot Record
zerombr yes
#Partition clearing information
clearpart --all --initlabel
# Disk partitioning information
################### PARTITIONING ###################
part /boot --size=1024 --onpart=sda1
part /boot/efi --fstype=efi --grow --maxsize=200 --size=20 --onpart=sda2
part pv.01 --size 20480
volgroup mainvg pv.01
logvol swap --fstype swap --name=swaplv --vgname=mainvg --size 1024
logvol / --fstype ext4 --vgname=mainvg --size=4096 --name=rootlv
logvol /var --fstype ext4 --vgname=mainvg --size=4096 --name=varlv
logvol /root2 --fstype ext4 --vgname=mainvg --size=4096 --name=root2lv
preseed partman-lvm/confirm_nooverwrite boolean true
preseed partman-auto-lvm/no_boot boolean true
###################### END #########################
This actually sort-of works, and I get a similar output as below for df -k
:
/dev/sda1 ..... /boot
/dev/mapper/mainvg-rootlv .... /
/dev/mapper/mainvg-root2lv .... /root2
/dev/mapper/mainvg-varlv .... /var
However I now need to manually partition SDB and apply a volume group to it along with LV's.. If I try to do this automatically during the installation process via KS, all I do to the block above is:
#System bootloader configuration
bootloader --location=mbr
#Clear the Master Boot Record
zerombr yes
#Partition clearing information
clearpart --all --initlabel
# Disk partitioning information
################### PARTITIONING ###################
part /boot --size=1024 --onpart=sda1
part /boot/efi --fstype=efi --grow --maxsize=200 --size=20 --onpart=sda2
part pv.01 --size 20480
volgroup mainvg pv.01
logvol swap --fstype swap --name=swaplv --vgname=mainvg --size 1024
logvol / --fstype ext4 --vgname=mainvg --size=4096 --name=rootlv
logvol /var --fstype ext4 --vgname=mainvg --size=4096 --name=varlv
logvol /root2 --fstype ext4 --vgname=mainvg --size=4096 --name=root2lv
part pv.02 --size 10240 --ondisk=sdb # This disk is only 10GB
volgroup datavg pv.02
logvol /data --fstype ext4 --vgname=datavg --size=4096 --name=datalv
preseed partman-lvm/confirm_nooverwrite boolean true
preseed partman-auto-lvm/no_boot boolean true
###################### END #########################
However not only does this not work, but it completely prevents the original partitioning block from executing successfully and when the install succeeds, all I get is one SDA partition with a default "ubuntu-vg" group which comes from god-knows-where and that group has a root and swap volume pair and nothing else. SDB is not even mentioned anywhere no matter the tool I use to check, whether it is df -k or sudo lvdisplay so I am completely confused by this behaviour. Also note that pressed recipes have the same result, so after trying hundreds of permutations I am about to give up..
Additionally, the output of sudo fdisk -l | less
is confusing and does not seem to match my config at all, when it works (when using the first block I showed above)
fdisk -l output image of the very first and successful run
If anyone at all has any advice on how to successfully use Kickstart to have one VG with several LV's on SDA which also has BOOT as a physical partition (SDA1) while also having a VG for data inside SDB with a /data logical volume, I would be ever-so-grateful.
If more info is needed, I am happy to post back. Thanks in advance.