Tayyabali007
Contributor
Contributor

how can i expand the storage from partition D to C

Jump to solution

Hello,

I have VM which has two partition C and D,  The D drive is much bigger and i want to reduce it and the storage i reduce from D wants to add in C drive but i dunno how can i do it any help will be appreciated. Thanks

Capture.PNG

The above screen i have shrink the D drive but when i click on C to extend it shows gray option with no option to click to expand ! how can i do this ?

1 Solution

Accepted Solutions
peetz
Leadership
Leadership

Hello Tayyab, and welcome to the forums!

your VM has two disks attached. The first disk is used for the C: partition, the second disk is used for an E: partition and has some unallocated space.

If I understand you correctly then you want to make the first disk bigger, because you need more space available on the C: drive. And you want to make the second disk smaller to get rid of the unallocated space.

While it is easily possible to enlarge a virtual disk (this can even be done online while the VM is running) there is no way to reduce the size of a virtual disk.

As a workaround you can do the following:

1. Add a third disk to the VM that has exactly the size that you need for the E: drive. In Windows create a new partition/drive on the new disk (e.g. F:)

2. Inside Windows copy all files from E: to F: (use "xcopy e:\ f:\ /O /X /E /H /K" to preserve permissions etc).

3. Remove the second disk from the VM

4. In Windows rename drive F: to E:

5. Extend the first disk of the VM to the size that you require. In Windows Disk Manager expand the C: drive to occupy the whole disk.

- Andreas

Twitter: @VFrontDe, @ESXiPatches | https://esxi-patches.v-front.de | https://vibsdepot.v-front.de

View solution in original post

10 Replies
scott28tt
VMware Employee
VMware Employee

Moderator: Thread moved to the vSphere area, since your question is more about VM management than anything specific to vCenter Server.

0 Kudos
scott28tt
VMware Employee
VMware Employee

Which version of Windows are you running? (Older versions do not support increasing the C drive via the GUI or at all)

Even if you can increase the C drive size, I'm not sure Windows will allow you to do that onto a different disk - it could be considered dangerous to do so if either disk was offline.

In VMware terms, you may therefore need the virtual disk holding the C drive to be larger in size, and the virtual disk holding the D drive to be smaller in size.

You may need to use something like vCenter Converter Standalone in order to do this - this would create a new VM with different virtual disk and partition sizes which you could then use in place of the existing VM.

0 Kudos
Tayyabali007
Contributor
Contributor

It's server 2012 R2, that standalone converter you told me about can do this ? and is it free to download ?

0 Kudos
scott28tt
VMware Employee
VMware Employee

Documentation: About VMware vCenter Converter Standalone User Guide

Download: https://my.vmware.com/en/web/vmware/downloads/info/slug/infrastructure_operations_management/vmware_...

Backup your VM before you do anything, just in case.

As you seem to want to go down that path, I am moving this thread to the Converter Standalone area.

0 Kudos
continuum
Immortal
Immortal

Now you have 2 VMDKs.

VMDK 1 has the boot partition and the Windows-partition ( C: in this case )

VMDK 2 has a single datapartition ( E: in this case )

If you talk about a D-drive you acchieve that we can not follow as you do not have anything that can be called D-drive.

Do you want a single VMDK with 3 partitions : boot + partition C: + partition E ?

If you want something different than that - please explain using the same terms as we do.

In Windows slang

VMDKs are called DISK 0 , Disk 1 ....

Partitions can be addressed by Driveletters - if they are mounted like here - so you can have 3 partition inside a first VMDK

System-reserved partition

+   C: - partition

+   E - partition.:

Do you need support with a recovery problem ? - call me via skype "sanbarrow"
0 Kudos
peetz
Leadership
Leadership

Hello Tayyab, and welcome to the forums!

your VM has two disks attached. The first disk is used for the C: partition, the second disk is used for an E: partition and has some unallocated space.

If I understand you correctly then you want to make the first disk bigger, because you need more space available on the C: drive. And you want to make the second disk smaller to get rid of the unallocated space.

While it is easily possible to enlarge a virtual disk (this can even be done online while the VM is running) there is no way to reduce the size of a virtual disk.

As a workaround you can do the following:

1. Add a third disk to the VM that has exactly the size that you need for the E: drive. In Windows create a new partition/drive on the new disk (e.g. F:)

2. Inside Windows copy all files from E: to F: (use "xcopy e:\ f:\ /O /X /E /H /K" to preserve permissions etc).

3. Remove the second disk from the VM

4. In Windows rename drive F: to E:

5. Extend the first disk of the VM to the size that you require. In Windows Disk Manager expand the C: drive to occupy the whole disk.

- Andreas

Twitter: @VFrontDe, @ESXiPatches | https://esxi-patches.v-front.de | https://vibsdepot.v-front.de

View solution in original post

Tayyabali007
Contributor
Contributor

This is the best idea so far you suggest ! let me try this, but could you please tell me how can i get back the unoccupied storage in (Datastores) ? simply delete the VMdk file ?

Another thing yesterday from Vcenter i have click template and export the OVF template of this VM now i can't be able to edit this machine how can i get back this machine in same state so i can edit it.. I thought if i export OVF i can later edit on another machine easily... but somehow i messed something which i don't know. picture is shown below

Capture.PNG

0 Kudos
peetz
Leadership
Leadership

Did the OVF export finish successfully? Or is there any other task currently running on that VM?

Exporting a VM should not change whether you are able to edit the VM's settings or not. Have you maybe logged in with a different account that is not allowed to edit VMs?

Does the VM have snapshots?

When you remove a disk from the VM then you will be asked if you just want to remove the disk or if you also want to delete the disk from the datastore. Choose the latter option to free up the space.

Twitter: @VFrontDe, @ESXiPatches | https://esxi-patches.v-front.de | https://vibsdepot.v-front.de
Tayyabali007
Contributor
Contributor

I have the admin rights on the other VM's i have the options to edit the machines !  only this one does not allow me now

When i export it didn't ask me anything beside a small window appears which is shown below exactly and i click ok. after then i logged out had to go somewhere when i came back and checked the option to edit is gone.

Capture.PNG

No snapshot taken

0 Kudos
Tayyabali007
Contributor
Contributor

My issue has been resolved and thanks alot everyone to help me out. The task was running in below which i killed and after that i have the options again to edit it.

0 Kudos