Skip to content

Instantly share code, notes, and snippets.

@cjcolvar
Created November 15, 2013 05:58
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save cjcolvar/7479811 to your computer and use it in GitHub Desktop.
Save cjcolvar/7479811 to your computer and use it in GitHub Desktop.
Commands I used to zero out space on a virtual disk from the host without running the guest vm
#Magic to zero out space on host without running guest
modprobe nbd max_part=16
qemu-nbd -c /dev/nbd0 /home/cjcolvar/VirtualBox\ VMs/avalon-installer_default_1383930303/box-disk1.vdi
partprobe
vgchange -a y VolGroup
zerofree /dev/mapper/VolGroup-lv_swap
zerofree /dev/mapper/VolGroup-lv_root
vgchange -a n VolGroup
qemu-nbd -d /dev/nbd0
#End magic
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment