VMware Communities
Voldash
Contributor
Contributor

Recover unallocated disk space from a VM to my physical hard drive

Hello,

After a few research, I found on the website of VMWare that we can't resize a VM. Once it is expanded, you cannot go back. Well, VMware doesn't provide official solution for that.

The thing is, I have 45Gb from a VM I would like to recover, it is unallocated right now on my VM, I want it back on my physical hard drive, and I didn't find any solution. The few solutions I found are not for the Workstation but more for vsphere.

Is there any unofficial solution to do that ? A file to edit or some risky manipulations to recover it ?

10 Replies
scott28tt
VMware Employee
VMware Employee

This should help you: VMware Knowledge Base


-------------------------------------------------------------------------------------------------------------------------------------------------------------

Although I am a VMware employee I contribute to VMware Communities voluntarily (ie. not in any official capacity)
VMware Training & Certification blog
Voldash
Contributor
Contributor

Hello Scott,

Thanks for your answer.

I have already try the manipulations indicated in this guide (defragmenting then VM > Manage > Clean up Disks) but it won't give me my 45Gb back.

Hard Disk : 90 GB

Disk Space used: 29.8 Gb

pastedImage_1.png

scott28tt
VMware Employee
VMware Employee

So you want to truncate the virtual disk.

You have the option to do that when using something like Converter Standalone, it can create a new VM with a smaller disk that the current VM.

Other than that you're probably hacking about with VMDK files.


-------------------------------------------------------------------------------------------------------------------------------------------------------------

Although I am a VMware employee I contribute to VMware Communities voluntarily (ie. not in any official capacity)
VMware Training & Certification blog
0 Kudos
Voldash
Contributor
Contributor

Initially, all 90 Gb were assigned to my disk (C:), but I don't need that much anymore, so I wanted to reclaim 45 Gb from those 90 Gb, which are no longer needed on this VM. I tried multiples things, such as "Clean up disks" but it didn't work, so I tried to separate 45 Gb from the 90 Gb to another new disk, I formated it, tried "Clean up disks", it didn't work neither so then I moved those 45 Gb to an unallocated area to try again the "Clean up disks".

So basically, with Converter Standalone I will be able to duplicate my VM to a new one with predetermined parameters such as custom disk size ? That would but a solution !

Just in case, what would be the last solution, the one with the VMDK files ? Edit the .vmx file ?

0 Kudos
scott28tt
VMware Employee
VMware Employee

So basically, with Converter Standalone I will be able to duplicate my VM to a new one with predetermined parameters such as custom disk size ?

Yes, you would be able to set a reduced disk size for the new VM.

Just in case, what would be the last solution, the one with the VMDK files ? Edit the .vmx file ?

I've never done it. Wait for a reply from someone who has before touching any of your files.


-------------------------------------------------------------------------------------------------------------------------------------------------------------

Although I am a VMware employee I contribute to VMware Communities voluntarily (ie. not in any official capacity)
VMware Training & Certification blog
continuum
Immortal
Immortal

If this discussion is about a growing type of vmdk such as it is typically used by Workstation then  you cant reclaim 45gb !

Actually only a few MBs are used for the unallocated part.

If this virtual disk is preallocated then you could "reclaim" the unused area by cutting the flat.vmdk at the location where the first partition ends.


________________________________________________
Do you need support with a VMFS recovery problem ? - send a message via skype "sanbarrow"
I do not support Workstation 16 at this time ...

0 Kudos
wila
Immortal
Immortal

Hi,

The "Clean up" disk functionality only works for NTFS partitioned parts of your disk.

In other words, by shrinking your partition in the guest you disabled the ability to reclaim the part that would have been recovered by a shrink/clean up operation.

The easy and non risky way to reclaim that size would be by growing your partition again to the maximum size of the virtual disk so that "clean up"/shrink can do its job.

--

Wil

| Author of Vimalin. The virtual machine Backup app for VMware Fusion, VMware Workstation and Player |
| More info at vimalin.com | Twitter @wilva
0 Kudos
manasrrp
Contributor
Contributor

I am trying to reclaim unallocated disk space by Compacting, but it still showing same.
 
 
Tags (1)
0 Kudos
manasrrp
Contributor
Contributor

vm disk.jpgI am trying to reclaim unallocated disk space by Compacting, but it still showing same.
0 Kudos
RDPetruska
Leadership
Leadership

Not sure what you're trying to do.  As wila stated in this thread, the Cleanup function will only work on NTFS-formatted allocated partitions of your virtual disk.  You have a large section unallocated... and as such, it is not taking up any space on your host (see your screenshot where it shows the virtual disk only takes up 19.1 GB on your host).

0 Kudos