Concepts of .VHD file and .VHDx file formats

A  Hyper-V VM has following drives C:\ and E:\. Below are the space specifications of C: and E: drive:

Total Size of C: drive is 270 GB and Free Space is 160 GB.
Total Size of E: drive is 1 TB and free space is 0.9 TB

 I used disk2vhd tool to create a online clone of the drives of the VM. When I ran the disk2vhd utility it created the .VHD file of C: drive for only 45 GB and E: drive of around 100 GB. Then I created a new VM using the newly created .VHD files of C: and E: drive.  After booting the new Virtual machine I could see the original 270 GB of C: drive with free space of 160GB and E: drive of 1TB and free space of 0.9 TB.
Now I would like to know how the .VHD file is created only with 45GB for C: drive and 100 GB for E: drive and when converted as a virtual machine it provides the exact format and size of the disk. Can anyone help me to know what exactly happens when converting to .VHD format and how it compresses the data size.
jmohan0302Asked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

Philip ElderTechnical Architect - HA/Compute/StorageCommented:
Swap and Hibernation files would represent a huge chunk of space from the original.

Volume Shadow Copy snapshots can take up a huge hidden chunk of space too (Previous Versions).

Those may not have carried over.
0
arnoldCommented:
The VHd is supported as a disk 2008/7 vhdx is an enhanced version that can be used on 2012/8/10 as well as backwards compatible to vhd.
Now the disk2vhd creates a disk that can expand but initially is the size of the used space of the source.
I.e your c: and e: use 45gb and 100gb respectively.
0
David Johnson, CD, MVPOwnerCommented:
your pagefile.sys/hiberfil.sys and other large areas i.e. System Volume Information  are not copied over.
Only the required areas are copied and uses a dynamically expanding disk
0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
Cloud Class® Course: Microsoft Azure 2017

Azure has a changed a lot since it was originally introduce by adding new services and features. Do you know everything you need to about Azure? This course will teach you about the Azure App Service, monitoring and application insights, DevOps, and Team Services.

Muhammad BurhanManager I.T.Commented:
for example if we copy a 10GB file to the 50GB dynamically expanding disk type so it consumes 10GB from 50GB, but what if you delete that 10GB file from there ?

after deleting that 10GB file the actual capacity of VHD doesn't decreases. Now when you perform conversion/editing on VHD then it convert/edit the VHD with its existing capacity.

in your case it seems that C drive consumed 270GB out of 430GB in past in-terms of folders/files, System Volume Information, Recycled items, pagefile and hibersys file etc. After conversion/editing it only consider actual capacity for new VHD file.
0
jmohan0302Author Commented:
Any detailed explanation is appreciated?
0
arnoldCommented:
I do not understand what it is you are looking for
VHDx was added with the newer windows 8 and windows 2012 server version.
It is supposed to be an "enhanced version" of the  VHD which is the only format 2008's Hyper-V can handle.
0
Philip ElderTechnical Architect - HA/Compute/StorageCommented:
VHD:
 + Limited to 2TB in size
 + Limited to 512n drives

VHDX
 + Limited to 64TB in size
 + Can run on 512n, 512e, and 4Kn drives
 + Custom block sizes/formats
 + Online Resizing

TechNet: VHDX Overview
0
David Johnson, CD, MVPOwnerCommented:
A detailed explanation of what exactly?
Why the VHD is smaller than the used space on the source drive.. We already told you that files that are of no consequence are NOT copied and this includes the System Volume Information files, Recycle Bin, any .tmp files, pagefile.sys, hiberfil.sys
0
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Hyper-V

From novice to tech pro — start learning today.

Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.