VMware Cloud Community
GPxr
Contributor
Contributor
Jump to solution

How can I release an unused partition from HDD back to datastore

Hello everybody,

I have a VM with windows server 2016 running as a file server for my organization. At the beggining of the VM construction I configure much more space from the datastore than I will ever need. The extra space is in offline partition and I want to know if there is a way to reclaim this space back to the datastore. The datastore is stored in an external storage (dell ME4012) and the esxi is on version 6.7. There is also a vCenter appliance managing the esxi host.

Thank you.

1 Solution

Accepted Solutions
tayfundeger
Hot Shot
Hot Shot
Jump to solution

You can enlarge the disk of a virtual machine on ESXi, but you cannot shrink it. This is not recommended.

As far as I can see, it is installed on the C disk of the operating system. You can give the virtual machine a new disk, move the data in the F drive to the new disk, and then erase the F disk. This would be a smoother way.

--
Blog: https://www.tayfundeger.com
Twitter: https://www.twitter.com/tayfundeger

vBlogger, vExpert, Cisco Champions

Please, if this solution helped your problem, "Helpful" if it solves your problem "Correct Answer" to mark.

View solution in original post

0 Kudos
11 Replies
Nawals
Expert
Expert
Jump to solution

Are you using single VM disk and inside OS created multiple partitions or each partition have separate disk ? You need to use vCenter Converter to reclaim unused partition. Can you share the screenshot which partition you need to reclaim.

NKS Please Mark Helpful/correct if my answer resolve your query.
0 Kudos
scott28tt
VMware Employee
VMware Employee
Jump to solution

So you oversized a virtual disk, you have multiple partitions within that virtual disk, and now you want the virtual disk to take up less space in your datastore by shrinking it - right?


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

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

Here is the screenshot:

offline partition.png

0 Kudos
scott28tt
VMware Employee
VMware Employee
Jump to solution

Presumably it’s the “unallocated” space on Disk 1 that you wish to no longer have allocated to the virtual disk?


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

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

Yes. I do not know if it possible and if it is what is the risk of harming the online partition.

0 Kudos
tayfundeger
Hot Shot
Hot Shot
Jump to solution

You can enlarge the disk of a virtual machine on ESXi, but you cannot shrink it. This is not recommended.

As far as I can see, it is installed on the C disk of the operating system. You can give the virtual machine a new disk, move the data in the F drive to the new disk, and then erase the F disk. This would be a smoother way.

--
Blog: https://www.tayfundeger.com
Twitter: https://www.twitter.com/tayfundeger

vBlogger, vExpert, Cisco Champions

Please, if this solution helped your problem, "Helpful" if it solves your problem "Correct Answer" to mark.
0 Kudos
Nawals
Expert
Expert
Jump to solution

Okay. So now want to reclaim unallocated space from Disk1 which shows in the screenshot. This can only done via V2V using vCenter converter.

Below are the link how using vCenter Convete to perform V2V.

http://www.vmwarearena.com/vmware-converter-how-to-perform-p2v-and-v2v-migration/

Note: You have need downtime for this activity to reclaim. Also, I would suggest to take backup or clone the vm before doing V2V.

From below steps also reclaim. however , I never performed this way in production for larger disk.

Shrink OS disk in Windows running on VMware. – Knowledge is POWER…!!!!!

NKS Please Mark Helpful/correct if my answer resolve your query.
continuum
Immortal
Immortal
Jump to solution

In your case you can cut off the  unused part of the flat.vmdk.

You can use dd instead of a pair of scissors.

I explained how to do it here: How to use dd to work with VMDKs stored on VMFS | VM-Sickbay
Warning: this is not for the faint at heart - if you have doubts rather ask first.!!!


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

GPxr
Contributor
Contributor
Jump to solution

I agree. I want to do it anyway just to practice and learn, but in a production enviroment is risky. Thank you.

0 Kudos
GPxr
Contributor
Contributor
Jump to solution

I will try to do that, but first I will need some extra disks to my storage, so I can backup the data. I will try to do it in test enviroment first. Thank you

0 Kudos
Nawals
Expert
Expert
Jump to solution

Okay. This only you can do it via V2V as I said earlier without any issue.

NKS Please Mark Helpful/correct if my answer resolve your query.