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..."