Sometimes you need to shrink a thin provisioned VMDK file after a lot of data has been removed as we all find out the hard way that thin provisioning is great for allowing a disk to grow as data fills it up but with the caveat that the disk will not shrink again automatically when data is removed. Hopefully this quick guide will help you to achieve just that.
This can be resolved by resizing the volume using vmkfstools from the ESX command line:vmkfstools -X g Once the copy completes, proceed to the Cleanup section of this article to continue. When the transfer completes, access your vSphere environment.
Performance cookies are used to analyze the user experience to improve our website by collecting and reporting information on how you use it. They allow us to know which pages are the most and least popular, see how visitors move around the site, optimize our website and make it easier to navigate. The same steps can be used to shrink a Windows drive. With Vista/2008 and newer the disk manager can be used to change the size of the partitions instead of Gparted or Gparted can be used as well. Related Articles (HowTo) Grow a VMDK with VMKFSTOOLS (HowTo) Convert a VMDK from Thick to Thin on ESX. Convert thick provisioned to thin with vmkfstools in ESXi Shell (command line) In this step by step guide, you will learn how to convert a thick provisioned lazy zeroed disk to thin on VMware ESXi 6.7. The steps are the same for other ESXi versions. You will use the vmkfstools command. Before we can use “vmkfstools” to shrink the VMDK file we must zero out any unused space on the thin provisioned disk. A simple way of doing this is by using a free utility called SDelete from Sysinternals. Download SDelete onto the VM you want to shrink and run the following command, replacing DRIVE: with the actual drive letter to be.
Please note this will just reduce the VMDK’s size on the datastore, it will NOT change the provisioned size of a thin disk.
To shrink a VMDK we can use an ESX command line tool vmkfstools, but first you have to zero out any free space on your thin provisioned disk. On Windows guests we can use the sysinternals tool SDelete (replace the [DRIVE:] with the relevant Windows drive letter) you must use v1.6 or later!:
This will fill any unused space on the drive specified with zero-blocks.
Caution: This operation will expand your thin-disk to its maximum size, ensure your datastore has the capacity to do this before you run this operation.
As of v1.6 -c and -z have changed meanings, many instructions say -c zeros free space, this is no longer the case, it zeros the space then fills with random data in accordance with DOD spec: DOD 5220.22-M, the trigger to zero space with 0x00 has changed to -z! On linux guests use:
Again, replace [PATH] with the relevant path to a location on the target storage device. Next we will shut down the guest OS and SSH into the ESX shell, once in the shell we need to navigate to the VMDK’s datastore -> directory and we’ll check the VM’s actual size:
Punch all zeroed blocks out of the VMDK:
Check the size again (should now be less):
Make sure to replace [DISKNAME] with your VMDK’s actual name. That's it, all the free space should now be reclaimed.
This site contains documentation of the various things I have happened to invest some time into investigating and decided to make documentation for
I believe that specific kind of knowledge in the right hands can do a lot of good things, so I decided to document things I know about. The things I know are very niche and I’d be shame if that information would happen to just dissapear one day.
I have decided to use 3kliksphilip’s approach to tutorials, based on his old Hammer World Editor tutorial series. Raw simple knowledge that you can kickstart yourself from to do many things. As this knowledge is supposed to create a starting point for you, it is recommended to study more than just the documentation located on this site.
It is highly encouraged to fork and expand on the knowledge and information located on this site.
List of documentation
Linux
Restrict SFTP user to a specific folder
Backing up MySQL database on Linux with rclone and Azure Blob Storage
Mounting Onedrive with Rclone mount on startup with Systemd
Changing dynamic or static IP to dynamic or static IP on RHEL based Linux
Network booting CentOS 7 via iPXE and Windows IIS by chainloading iPXE via on-board PXE ROM
Reverse Engineering TP-Link TL-WA901ND firmware and obtaining the filesystem
Migration of RHEL system to a new server (CentOS 7)
Fixing Ubuntu VM on Hyper-V stuck in read-only mode after hot backup or live migration
Booting to Windows remotely on dual-boot CentOS 7 system
Windows
Using Windows applications with the Windows Subsystem for Linux (WSL) Linux filesystem
Using Windows Deployment Services (WDS) with iPXE
Adding AWS Shell to Windows Terminal
Virtualization
Migrating a physical server or a VM from a different hypervisor into a new VM
Connecting to Hyper-V VM console via RDP
Converting a Hyper-V VHD/VHDx to VMWare Workstation VMDK
Using VMWare Workstation VMDK image in ESXi
Networking
Routing all traffic through OpenVPN client on Windows
L2TP with IPSec Point to Point VPN setup on Mikrotik
Deploying pfSense on a system with a single network interface using VLANs on Dell Wyse D90D7 Thin Client
Vmkfstools Windows 10 Download
Hardware
World of Warcraft
Vmkfstools Windows 10 Free
WoW data extraction resource sheet
Recognizing WoW files with no listfile or extension
Source Engine and Source Filmmaker
Importing Source Engine models into a 3D program
Putting your own model into SFM (very simplified)
Getting the best image quality out of SFM
SFM Depth of Field Post-production
Exporting SFM animations to Blender and 3DS Max, or how to use SFM as an animation tool
3DS Max
Bootstrapping Powershell commands to 3DS Max’s Maxscript to send notifications
Applying Turbosmooth on an already rigged mesh in 3DS Max
Combining multiple skinned meshes into a single mesh while keeping the skinning in 3DS Max
3DS Max and Blender interoperability