Skip to main content

Creating Disk Image

qemu-img convert -f qcow2 -O raw PBX.qcow2 PBX.img

# Shrink the internal partitions
# gparted and lvm idr go google it u chud

fdisk -l ./PBX.img

# Change first number to be the ending sector from fdisk
fdisk PBX.img
truncate --size=$[(#ChangeME+100)*512] PBX.img

# Set the output dir to your USB stick to save time writing to local disk and rewriting againt to USB
dd if=PBX.img bs=64M conv=sync status=progress | lz4 -z > /mnt/USB/Images/PBX.img.lz4