Thursday, December 11, 2014

Extending VHD / VHDX Volume

I have prepared the VHDX (or VHD in some cases) and it’s SYSPREP.  Now my C Drive is only 60GB but I would like to extend the hard disk to 100GB, to enable for me to install other applications on the C Drive.

I’m going to share how I do it.

My VHD is in the external drive (USB connected Hard Drive). 

Location E:\VHD\Demo

The VHD File is WIN81-ENT-x64-SYSPREP1.vhdx

image

I mount the drive to check on the space

image

As you can see it’s about 60GB. I’ll unmount and show the steps using DISKPART command

The command as follow :

  • Open Command Prompt with Administrator rights
  • Key in DISKPART
  • Next key in Select the Disk of where your VHD is located. For me is located at E Drive.  Therefore I key in as select vdisk file=”E:\VHD\Demo\WIN81-Ent-x64-SYSPREP.vhdx” 
  • Next to expand the TOTAL size of the VHD. I key in as expand vdisk maximum=100000
  • Next key in attach vdisk
  • Then key in list disk to view. If it’s not online then key on ONLINE DISK. It should be online automatically.

image

  • Next key in list volume
  • As you can see the volume shows as still 60GB
  • I key in as select volume 6
  • Key in extend
  • Key in list volume to see the new size

image

  • Opening up the attach disk, now it’s close to 100GB

image

Now I’m done, I would like to detach the VHD

Back to the DISKPART command prompt

  • Key in detach vdisk
  • Key in exit to quit diskpart from command prompt

image

In summary, I’ve keyed in as follow :

  • DISKPART
  • select vdisk file=”E:\VHD\Demo\WIN81-Ent-x64-SYSPREP.vhdx 
  • expand vdisk maximum=100000
  • attach vdisk
  • list disk
  • list volume
  • select volume 6
  • extend
  • list volume 
  • detach vdisk
  • exit 

Command in diskpart is in GREEN, you change those values in PINK 

Hopefully the steps are helpful.

keywords : diskpart, extend vhdx, extend vhd, expand volume size

No comments:

Post a Comment