ID #1120

How to shrink a vmdk with ext4 or other unsupported filesystems

Like with any other filesystem that can not be handled by the VMware-tools the procedure goes like this …

  •  inside the guest: create a wiperfile for every single partition - or in other words - do this for any entry in fstab separately
  • inside the guest run
    dd if=/dev/zero of=/wiperfile bs=20971520 # bs=20m
    rm /wiperfile
  •  on Workstation power down the guest and use vmware-vdiskmanager -k disk-with-ext4.vmdk
  • on ESX power down the guest and use vmkfstools -i unshrinked.vmdk shrinked.vmdk -d thin
  • on ESX exchange the referenced vmdk in the vmx-file

see http://www.feyrer.de/g4u/#shrinkimg for more ways to create the wiperfile - can be used with BSD VMs as well.
I use this way for my OpenBSD VMs


Tags: dd, ext4, shrink

Related entries:

You can comment this FAQ