From b000730adb82d6ffa49a2dca23e8f20098017b7a Mon Sep 17 00:00:00 2001 From: poslop Date: Thu, 31 Jul 2025 11:32:17 -0500 Subject: [PATCH] DEBUG varibel adn add true return to partprobe calls --- Ventoy/CloneToDisk.sh | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/Ventoy/CloneToDisk.sh b/Ventoy/CloneToDisk.sh index 0be68c5..78ac993 100755 --- a/Ventoy/CloneToDisk.sh +++ b/Ventoy/CloneToDisk.sh @@ -1,7 +1,6 @@ #!/bin/bash set -e - cleanup() { echo "Cleaning Mounts" @@ -48,21 +47,23 @@ mount $usb_name /mnt/ventoy cd /mnt/ventoy/Images # Decompress and write image -echo "Writing image to $disk_name..." -lz4 -dc PBX-LVM.img.lz4 | dd of=$disk_name status=progress +if [[ $DEBUG==false ]]; then + echo "Writing image to $disk_name..." + lz4 -dc PBX-LVM.img.lz4 | dd of=$disk_name status=progress +fi # Repartition disk using sgdisk echo "Repairing partition tables" sgdisk -e $disk_name sgdisk -v $disk_name -partprobe + +partprobe || true echo "Expanding Partition 3 on $disk_name..." sgdisk --delete=3 $disk_name sgdisk --new=3:0:0 --typecode=3:8e00 --change-name=3:"Linux LVM" $disk_name -# Inform the OS of partition table changes -sleep 2 # Give the system a moment to recognize changes +partprobe || true # Resize physical volume echo "Resizing physical volume..."