Avatar of Sunny Sebastian
Sunny Sebastian

asked on 

Shrink a volume

I have created a virtual machine in Vspere 6 having 3 partitions of total size 950 GB. Later I realized that I need to expand the volume beyond a certain limit, so I added another hard drive - Storage piece - everything works fine. One of my partitions - D drive - is now free and I deleted the volume. That space, aprox. 550GB is now un allocated. I want to free up this space from virtual hard disk - I followed the procedure to edit the vmdk file that I got from exchange expert which says that: -

Locate the vdmk files and we need to edit the *.vmdk, which is the descriptor file, which contains the variables for the size of the *.-flat.vmdk. Using cat, this is what the descriptor file contains
Then edit using vi xxxx.vmdk storage file. There will be an entry under the heading “#Extent description, after the letters RW, defines the size of the VMware virtual disk (VMDK).
For example, 40GB files will have an entry like 83886080 and the calculation is
40GB = 40*1024*1024*1024/512 = 83886080.
We wanted to reduce the size of the VMware virtual machine disk (VMDK) from 40 GB to 20 GB. So the value we need to enter into the descriptor file is:-

20 GB = 20 * 1024 * 1024 * 1024 / 512  =  41943040

Using vi, edit the descriptor file, and change the number from 83886080 to 41943040, and save the file.
Migrate or Copy the virtual machine to another datastore.

--------------------------------------------------------
I can see some flat and ckt files and I am not sure am I editing the right file or not. every time I get a error as attached. luckily I took the backup of the vmdk file and once I got the error I restored and all are back to normal.

My question is here, how I can shrink the volume which I am not able to use in windows. I want to free up the un allocated space in windows from Virtual machine hard drive.
VMWARE-Errorr.JPG
VMWARE-Errorr1.png
VMware

Avatar of undefined
Last Comment
Sunny Sebastian

8/22/2022 - Mon