VMware Communities
sanjaykumarjain
Contributor
Contributor

space reclaim in VMware machine

i have linux virual machine on vmware, i had folder of size 3gb on linux machie. I have deleted that 3gb sized folder but i am not getting that space much space as free on disk. How to regain that space. Thanks in advance.

15 Replies
schepp
Leadership
Leadership

Hey welcome to the communities,

where do you don't get that space back? Inside the guest VM or on your host system?

How did you delete the directory? Maybe the linux uses some kind of trashbin concept like windows and ubuntu? So the files are just flagged as deleted and you need to purge them?

Regards

0 Kudos
sanjaykumarjain
Contributor
Contributor

Thanks schepp,

      i did not get the space back to my host system.

Suppose ,lets take example:-

i have linux vm machine which is taking 10gb on host machine after complete installation . I copied a folder of 3gb on vm linux machine. now size of vm machine would increase to 13gb on host. i mean on host machine it would take space of 13gb. Now when i deleted the folder of 3gb which was inside the vm machine, then after deletion of that folder vm machine size should also decrease on the host back to 10gb ,

  But its not happening like that, space keeps on increasing and finally the size of my vm machine also increasing on the host machine.even i have deleted the large items from inside of vm machine.

Ya linux has also trashbin but i have deleted the directory permanently. Trashbin of vm machine  is empty.

0 Kudos
schepp
Leadership
Leadership

Ok,

sound like your virtual hard disk ( the vmdk file ) of your linux VM is configured as thin provisioned, right?

That means the vmdk on your host filesystem will grow as the data inside the guest grow.

When you delete something inside the guest, the VMDK on the host will stay the same size. This is normal behaviour and unfortunately, there is no easy wasy to reclaim this space from thin provioned disks.

Tim

0 Kudos
sanjaykumarjain
Contributor
Contributor

Thanks Sir,

     But I am new user of vmware , could you please suggest that how to work with these kind of scenarios.

I have no idea of thin provisioned etc... suggest Either i have to re install the Linux vm machine again using some alternate method or something else. Please suggest.

0 Kudos
WoodyZ
Immortal
Immortal

Assuming you're using VMware Workstation (since you didn't actually say but posted in the VMware Workstation Forum) and running a supported Linux OS (again you didn't say what Linux Distro) and you have VMware Tools installed and no Snapshots then use the following command in a Terminal from within the Guest OS.

sudo /usr/bin/vmware-toolbox-cmd disk shrink /

WoodyZ
Immortal
Immortal

Tim Scheppeit wrote: sound like your virtual hard disk ( the vmdk file ) of your linux VM is configured as thin provisioned, right?

Thick and or Thin Provisioned Virtual Hard Disks are not typically referenced with VMware Workstation.  On ESX/ESXi hosts, VMDK files are type VMFS_FLAT or VMFS_THIN while on VMware Workstation VMDK files are type MONOLITHIC_SPARSE, MONOLITHIC_FLAT, SPLIT_SPARSE or SPLIT_FLAT.  While VMFS_THIN and MONOLITHIC_SPARSE or SPLIT_SPARSE are growable nonetheless using terms specifically associated with ESX/ESXi with Workstation only confuses the unknowledgeable user even more! (Much like this reply will.) Smiley Wink

When you delete something inside the guest, the VMDK on the host will stay the same size. This is normal behaviour and unfortunately, there is no easy wasy to reclaim this space from thin provioned disks.

Also it's very easy to shrink sparse disk in a Linux Guest in VMware Workstation as long as VMware Tools are installed and the VM has no Snapshots.  See my reply: Re: space reclaim in VMware machine

schepp
Leadership
Leadership

Ok thanks for the heads up Woody and sorry for producing confusion Smiley Wink

0 Kudos
sanjaykumarjain
Contributor
Contributor

Any body having any idea ,that how to deal with such condition of space reclaim after deletion of data from inside of  vm machine?

0 Kudos
sanjaykumarjain
Contributor
Contributor

my VMWare vitual disk files are growing constantly, even i have deleted huge amount of data from VM machine, but space remain same.

Detail:

Earlier the Total Size of Vm machine was 10Gb, then i pasted a folder of 5 gb inside the VmMachine, Now the VmWare virtual disk files became 15gb, but while i deleted the 5 gb folder from Vm Machine ,size  of VmWare virtual disk was same.!!!!!!. How to reclaim the space??

Please suggest for same.

0 Kudos
WoodyZ
Immortal
Immortal

I suggest you reread my reply Re: space reclaim in VMware machine and if that doesn't address the issue then you'll need to provide more details! Smiley Wink

0 Kudos
sanjaykumarjain
Contributor
Contributor

No it did not solve the issue,,please suggest what detail are to be posted to get this resolved..

because it is the issue which  i am facing since last 1 years.Please suggest

0 Kudos
WoodyZ
Immortal
Immortal

Since you are not giving any additional relevant and appropriate information I have nothing else to say since I've already given you the answer!  Reread my reply: Re: space reclaim in VMware machine

0 Kudos
markp1994
Contributor
Contributor

NOTE: I know, this is an old thread; wanted to let folks who might find this thread in a (google) search know that WoodyZ's instructions still work!

WoodyZ,

Your instructions worked like a charm!

host: Windows 7

VMWare: Workstation 12

client #1: SUSE 11

client #2: Solaris 11 (x86)

For each client: I shutdown the VM, deleted all snapshots, started up the VM, logged in as root (so was able to skip the 'sudo' part) and ran the following:

        /usr/bin/vmware-toolbox-cmd disk shrink /


The command initially runs what looks like a defrag (complete with %done status line), then disconnects my session while opening a Workstation pop-up window that displays the message "Shrinking disk <path_to_client_vm_disk_file>.vmdx" and a status bar.


Once the pop-up disappeared (ie, the shrink operation had completed) I found the following results in terms of host FS space usage for the client VMs:


client #1: before shrink: 25.6 GB; after shink: 14.0 GB => 11.6 GB savings !

client #2: before shrink: 34.6 GB; after shrink: 21.7 GB => 12.9 GB savings !

0 Kudos
totalnoob
Contributor
Contributor

This is great to know but what if i already deleted the vm and the virtual machine files is gone because I would have thought pressing delete disk would automatically cover everything.

So now i don't have the old VM to run this command that zeros everything and shrinks. And i am stuck with 500G of disk space being used. Anyone how to get rid of this? 

I am on Workstation Pro with a Windows Host

the guest was a linux but again i already deleted the files so i can't run commands on guest.

0 Kudos
continuum
Immortal
Immortal

Did you empty the trashbin ?

Ulli

 


________________________________________________
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