Guest Reclaim to recover lost space on thin provisionned disks.
After the announce few days ago I was wondering on how to possibly use this tool, since there are some limitations. Most likely, as said in the Guest Reclaim ReadMe (pdf) file, the tool will take part in future updates to VMware hypervisor. For now this tool will only work on RDMs using physical compatibility mode.
This tool, called Guest Reclaim – a Fling – is available at labs.vmware.com, enables you to recover dead space from thin provissionned SCSI disks. The tool works from Windows XP to Windows 7. Guest Reclaim will issue SCSI Unmap commands to the underlying storage for reclaiming dead space.
What exactly it does?
Guest Reclaim reclaims dead space from NTFS volumes hosted on a thin provisioned SCSI disk. The tool can also reclaim space from full disks and partitions, thereby wiping off the file systems on it. As the tool deals with active data, please take all precautionary measures understanding the SCSI UNMAP framework and backing up important data.
- Reclaim space from Simple FAT/NTFS volumes
- Works on WindowsXP to Windows7
- Can reclaim space from flat partitions and flat disks
- Can work in virtual as well as physical machines
What is Dead Space Reclamation? Deleting files frees up space on the file system volume. This freed space sticks with the LUN/Disk, until it is released and reclaimed by the underlying storage layer.
The unmap does not work on linked clones or on disks with snapshots. The tool can only operate on one disk/volume in a single invocation of the command.
Another limitation is that this tool don't work on VMDKs which are thin provisionned SCSI disks, in vSphere 5: (Currently ESX 5.0 doesn't expose SCSI virtual disks as disks as thin provisioned.) Only RDMs with physical compatibility mode. Here is the update provide in the Guest Reclaim Read Me (PDF).
The tool transparently operates on virtual disk if the hypervisor emulation layer reports virtual disks as thin provisioned. End to End reporting of thin provisioning status in a virtual storage stack is required to fully leverage Thin Provisioning in a virtualized environment. This tool is not related to any VMWare ESX or any other Hypervisor Release. If ever ESX supports unmaps on virtual disk in the future, it will be tied to “Virtual Hardware Version Upgrade” and will mostly be in a release after vSphere 5.0.
GuestReclaim allows transparent reclamation of dead space from NTFS volumes.
View the Guest Reclaim ReadMe (pdf) for details.
Guidelines: guestReclaim.exe [ –list | –volumefreespace | –fullvolume | –disk ] [command specific options]
–list : List available drives and their volume/partition mapping
–volumefreespace : Unmap free space on a NTFS/FAT volume. Expects drive letter
–fullvolume : Unmaps entire volume. Destroys filesystems that exists on the partition. Expects
partition drive letter
–disk : Unmaps full disk. Destroys all volumes/partitions/data on disk. Expects partition
I tried to use this tool inside a 2003 x64 VM running in vSphere 5. The VM had 2 disks:
Disk 1 – system disk – NTFS volume, size=80Gb Thin provissioned, volume letter = C:
Disk 2 – data disk – NTFS volume, size=80Gb Thin provissioned, volume letter = E:
I wanted to recover some space from the second disk, E:
See what returned the guestreclaim.exe –list command
The hypervisor does not yet report disks as thin provisioned to the guest OS, when using VMDKs. For now this tool will only work on RDMs using physical compatibility mode.