VMware Cloud Community
usevm
Contributor
Contributor
Jump to solution

Possible to take back the disk space that was mistakenly allocated?

I've mistakenly allocated more disk space of 50 GB to the wrong disk.  The VM has 2 disks and I was

intending to add more disk space to disk 1 but ended up adding it to disk 2.

I haven't expanded the mistakenly allocated disk space in the OS.  It still shows up as Unallocated in Disk Management.

Is there a way to delete the unallocated 50GB in ESXi so it frees up the space?

Thanks

Reply
0 Kudos
1 Solution

Accepted Solutions
ThompsG
Virtuoso
Virtuoso
Jump to solution

Hi there,

Unfortunately not. There is no way to reduce the size of a VMDK once you have allocated the space or not officially anyway.

Not that I'm advocating this or even suggesting you give it a try but there is a way using the linux dd command. See the answer from Continuum in this post if you want to give this a try: Help with VM HDD resizing

I'm assuming from the drive numbers that the disk wrongly expanded was the data drive. In this case then you could add a new disk at the correct size and then just move the data, switch the drive letters and remove the original when finished. Another option is to use VMware Converter to make a resized copy. A lot of this depends on space that you might have in the environment to do this. Before doing any of this I would definitely make sure you have a known restore-able backup!!

Kind regards.

View solution in original post

Reply
0 Kudos
2 Replies
ThompsG
Virtuoso
Virtuoso
Jump to solution

Hi there,

Unfortunately not. There is no way to reduce the size of a VMDK once you have allocated the space or not officially anyway.

Not that I'm advocating this or even suggesting you give it a try but there is a way using the linux dd command. See the answer from Continuum in this post if you want to give this a try: Help with VM HDD resizing

I'm assuming from the drive numbers that the disk wrongly expanded was the data drive. In this case then you could add a new disk at the correct size and then just move the data, switch the drive letters and remove the original when finished. Another option is to use VMware Converter to make a resized copy. A lot of this depends on space that you might have in the environment to do this. Before doing any of this I would definitely make sure you have a known restore-able backup!!

Kind regards.

Reply
0 Kudos
ShrimantPatel
Contributor
Contributor
Jump to solution

I know this is a very old post but things are still the same even these espicially for LINUX VM so decided to post a reply...I had the same scenario, had a UBUNTU headless server VM on a ESXI host which was mistakenly allocated 300GB, the actual OS and application were well within 50 GB,  I had to send copies of it to various location and the 300GB was a time consuming process. Tried everything i.e Gparted, Excli, Vmware standalone convertor, nothing worked for LINUX. Below are the steps that has finally worked for me.

  • Clone to VM to a new VM
  • [OPTIONAL]Boot up the new Cloned VM using Gparted live CD iso, and shrink the sda/sdb to as as much possible, leaving around 3-4 GB or free space.
  • Use Vmware standalone convertor , and convert the cloned VM to a Workstation VM selecting Vmware Workstation or other VMware virtual machine as shown below ensuring the disk type is "Not pre-allocated"(sceen shot provided...the 2nd screen shot below:

VmConversiontoWorkstation.jpg

VmConversiontoWorkstation2.jpg

  • Once the conversion is complete use a trial version of Vmware workstation or fusion to open the VM selecting File-Open-Select the new converted VM's vmx file.
  • Once opened, Click Edit virtual machine settings , Select the Hard drive and do the following two steps as below following the attached screen shot too:
    1. Click Defragment
    2. Click Compact

VmConversiontoWorkstation3.jpg

 

I hope this hepls someone, I had stumbelled into too many other posts when I had the same issue, but none solved my issue. Hope this helps someone else.

Reply
0 Kudos