From 5f119e80410cbec68abfa11479076fe1d7c4d100 Mon Sep 17 00:00:00 2001 From: Neil Hanlon Date: Sat, 25 Feb 2023 00:04:04 -0500 Subject: [PATCH] Use LVM for Libvirt Vagrant --- Rocky-8-Vagrant-Libvirt.ks | 37 ++++++++++++++++++++++++++++--------- 1 file changed, 28 insertions(+), 9 deletions(-) diff --git a/Rocky-8-Vagrant-Libvirt.ks b/Rocky-8-Vagrant-Libvirt.ks index 3fb05ca..7858ad6 100644 --- a/Rocky-8-Vagrant-Libvirt.ks +++ b/Rocky-8-Vagrant-Libvirt.ks @@ -25,16 +25,35 @@ skipx # System services services --enabled="vmtoolsd" # System bootloader configuration -bootloader --append="no_timer_check console=tty0 console=ttyS0,115200n8 net.ifnames=0 biosdevname=0 elevator=noop" --location=mbr --timeout=1 -# Clear the Master Boot Record -zerombr -# Partition clearing information -clearpart --all --initlabel --disklabel=gpt +bootloader --append="no_timer_check console=tty0 console=ttyS0,115200n8 net.ifnames=0 biosdevname=0 elevator=noop rd.lvm.vg=rocky rd.lvm.lv=rocky/root" --location=mbr --timeout=1 + # Disk partitioning information -part biosboot --size=1 --fstype=biosboot --asprimary -part /boot/efi --size=100 --fstype=efi --asprimary -part /boot --size=1000 --fstype=xfs --label=boot -part / --size=8000 --fstype="xfs" --mkfsoptions "-m bigtime=0,inobtcount=0" --grow +part /boot/efi --fstype="efi" --onpart=vda1 +part /boot --fstype="xfs" --label=boot --onpart=vda2 +part prepboot --fstype="prepboot" --onpart=vda3 +part biosboot --fstype="biosboot" --onpart=vda4 +part pv.01 --grow --size=1 --onpart=vda5 +volgroup rocky pv.01 +logvol / --grow --size=8000 --mkfsoptions="-m bigtime=0,inobtcount=0" --name=root --vgname=rocky + +%pre +# Clear the Master Boot Record +dd if=/dev/zero of=/dev/vda bs=512 count=1 +# Create a new GPT partition table +parted /dev/vda mklabel gpt +# Create a partition for /boot/efi +parted /dev/vda mkpart primary fat32 1MiB 100MiB +parted /dev/vda set 1 boot on +# Create a partition for /boot +parted /dev/vda mkpart primary xfs 100MiB 1100MiB +# Create a partition for prep +parted /dev/vda mkpart primary 1100MiB 1104MiB +# Create a partition for bios_grub +parted /dev/vda mkpart primary 1104MiB 1105MiB +# Create a partition for LVM +parted /dev/vda mkpart primary ext2 1106MiB 10.7GB +parted /dev/vda set 5 lvm on +%end %post # Attempting to force legacy BIOS boot if we boot from UEFI