Se você estiver usando o VMware, uma maneira muito melhor é usar as ferramentas integradas no VMware para recuperar qualquer espaço não utilizado na unidade virtual.
Eu usei isso para reduzir o tamanho do disco virtual de 28 gigabytes para 13 gigabytes. Sua milhagem pode variar.
Quando tentei usar sdelete -z c: , ele realmente aumentou o tamanho das unidades virtuais para 30 gigabytes, que era seu tamanho máximo.
Consulte o site da VMware e Compacte um Disco Rígido Virtual , que está em Using VMware Workstation > Configuring and Managing Devices > Configuring and Maintaining Virtual Hard Disks .
Atualizar
Às vezes, as ferramentas GUI não são tão confiáveis quanto as ferramentas de linha de comando. Já me deparei com problemas em que as ferramentas da GUI falham, mas as ferramentas de linha de comando funcionam bem. Aqui estão as opções para VMware Desktop 10 :
C:\Program Files (x86)\VMware\VMware Workstation>vmware-vdiskmanager -h
Diskname or some other argument is missing.
VMware Virtual Disk Manager - build 1895310.
Usage: vmware-vdiskmanager.exe OPTIONS <disk-name> | <mount-point>
Offline disk manipulation utility
Operations, only one may be specified at a time:
-c : create disk. Additional creation options must
be specified. Only local virtual disks can be
created.
-d : defragment the specified virtual disk. Only
local virtual disks may be defragmented.
-k : shrink the specified virtual disk. Only local
virtual disks may be shrunk.
-n <source-disk> : rename the specified virtual disk; need to
specify destination disk-name. Only local virtual
disks may be renamed.
-p : prepare the mounted virtual disk specified by
the mount point for shrinking.
-r <source-disk> : convert the specified disk; need to specify
destination disk-type. For local destination disks
the disk type must be specified.
-x <new-capacity> : expand the disk to the specified capacity. Only
local virtual disks may be expanded.
-R : check a sparse virtual disk for consistency and attempt
to repair any errors.
-e : check for disk chain consistency.
-D : make disk deletable. This should only be used on disks
that have been copied from another product.
Aqui está um exemplo de redução de um disco. Esta linha de comando funcionou, apesar do mesmo comando da GUI ter falhado:
C:\Program Files (x86)\VMware\VMware Workstation>vmware-vdiskmanager.exe -k
"H:\VMware\WindowsXP.vmdk"
VixDiskLib: Invalid configuration file parameter. Failed to read configuration file.
Shrink: 100% done.
A mensagem de erro que começa com VizDiskLib é nova no VMware Desktop 10 e pode ser ignorada com segurança.