Knowledgebase
emscom > emscom Help Desk > Knowledgebase

Search help:


ESXi consolidate space on thin disk

Solution

How to reclaim disk space on thin provisioned disk

 

ESXi thin disk format uses a sparse file format to allow OS layer partitions to appear larger than the physical  virtual hard disk file.  OS layer data deleted from the virtual hard disk file is removed from the virtual file allocation table however the contents of the file remain allocated in the virtual hard disk file, preventing the space being reclaimed by ESXi.  Before the space can be reclaimed the remaining data must be set to zeros.

1. On Windows platforms the sdelete (secure delete) utility from the sys internals tool set can be used to zero deleted data.  The sdelete utility should be executed using an elevated console prompt on the affected VMWare guest.

https://docs.microsoft.com/en-us/sysinternals/downloads/sdelete
https://download.sysinternals.com/files/SDelete.zip

syntax:
sdelete64 -z [target disk]
e.g. sdelete64 -z c:

2. To reclaim the space, shut down the VMware guest and use vmkfstools to recover the space.  vmkfstools can be executed from an ssh console on the ESXi hypervisor
syntax: vmkfstools -K [target virtual disk].vmdk
e.g vmkfstools -K /vmfs/datastore1/myvm/myvmvmdk

DO NOT attempt to run vmkfstools against the -flat.vmdk file.

 

 

 

 

 
Was this article helpful? yes / no
Related articles ESXi Ueful but poorly documented commands
ESXi Clone operations including snapshots
ESXi OVF Tool
ESXi Create clone from snapshot
Disk tools
Article details
Article ID: 126
Category: Virtualisation
Date added: 11-03-2020 17:10:27
Views: 399
Rating (Votes): Article not rated yet (0)

 
« Go back

 
Powered by Help Desk Software HESK, in partnership with SysAid Technologies