[Okta Webinar] Learn how to a build a cloud-first strategyRegister Now

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 543
  • Last Modified:

diskpart command confusion

I am following a process to create a pc to boot from vhd only.

http://blogs.technet.com/b/keithcombs/archive/2009/05/22/dual-boot-from-vhd-using-windows-7-and-windows-server-2008-r2.aspx 

Part of the diskpart command is to create a vdisk file.
Create vdisk file=c:\7ent.vhd maximum 40960 type=expandable.

I read this as the vhd file will max out at 40gb and the vhd should be large enough to install Window 7.

When all is complete and I do boot from the vhd and check the size of the VHD, it is already 40gb.

What am I missing? What is the point of setting a maximum and type =expandable if the vhd will already be 40gb.

I also tried creating a vhd file only 7gb (large enough to install windows)  If I try to copy above the 7gb I get the message not enough disk space. No being expanded.

Can someone explain this to me?

All help is appreciate.
0
maquet
Asked:
maquet
  • 4
  • 3
  • 2
1 Solution
 
Andrew Hancock (VMware vExpert / EE MVE^2)VMware and Virtualization ConsultantCommented:
The VHD that is being booted from will expand to the maximum size specified at creation.  It will revert to the used size when you shut it down.  
0
 
megaman5Commented:
When you boot the vhd?  I think it needs to tell the OS that the drive is 40gb for file system reasons.  I think the 'host file' (the vhd itself) will only take up an expandable amount of space on the host volume.  
0
 
Andrew Hancock (VMware vExpert / EE MVE^2)VMware and Virtualization ConsultantCommented:
In answer to your question, storage of the VHD, when the machine is off, it will use less disk space, but also a word of caution here, you must ensure, you have at least the expandable size, to start to boot the machine.

So this process will allow you to boot multiple machines (at different times), as the stored machines will be less.

Some people confuse this with VMware Thin provisioned disks. Where disks start small (due to storage in use) and grow to the max of the disk and stop.
0
Get free NFR key for Veeam Availability Suite 9.5

Veeam is happy to provide a free NFR license (1 year, 2 sockets) to all certified IT Pros. The license allows for the non-production use of Veeam Availability Suite v9.5 in your home lab, without any feature limitations. It works for both VMware and Hyper-V environments

 
maquetAuthor Commented:
So if boot from a usb stick and look at the size of the vhd it will not be 40 gb?  
0
 
megaman5Commented:
Wrong, just as thin provisioned disks, the on-disk space used is equal to the data size and meta data.

https://blogs.technet.com/b/ranjanajain/archive/2010/03/23/virtual-hard-disk-vhd-architecture-explained.aspx

Thanks!
0
 
megaman5Commented:
If you are storing the vhd on a usb disk, and you are not booted to it, it should only show used size plus meta data.  There is no 'expanding and contracting' on boot and shutdown, just a layer of abstraction where the on disk size is kept as small as the data.

Thanks!
0
 
megaman5Commented:
If the vhd didnt 'fake' the os thinking that it is 40gb, you would always be out of free space and applications would fail when requesting disk space.  so when you are booted to the vhd, it 'lies' to the os saying that its already 40gb, and just resizes in the background.
0
 
Andrew Hancock (VMware vExpert / EE MVE^2)VMware and Virtualization ConsultantCommented:
when you boot will always be the expandable size.
0
 
maquetAuthor Commented:
Nice article but I still cannot do what I am trying to do.
0

Featured Post

Veeam Disaster Recovery in Microsoft Azure

Veeam PN for Microsoft Azure is a FREE solution designed to simplify and automate the setup of a DR site in Microsoft Azure using lightweight software-defined networking. It reduces the complexity of VPN deployments and is designed for businesses of ALL sizes.

  • 4
  • 3
  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now