Everything SharePoint and XAML

My continuous learning of SharePoint, XAML, Silverlight, Windows Phone 7, Windows 8, Office, VSTO, C#…

Expand VHD File

Posted by Steve Pietrek on August 7, 2007

Today I needed to expand a VHD file. Below are the “easy” steps I followed to get it working.
1. Download VHD Resizer and follow instructions to expand the VHD file. The problem is the extra space will be unformatted raw space.

2. Download Virtual Server. Do a Custom install and only install VHDMount. I use only VPC 2007 so I only cared about VHDMount.

3. Open a Command Prompt and type the following commands (in the host OS). Note: I copied the vhd file to the same directory as VHDMount.

a. C:\Program Files\Microsoft Virtual Server\Vhdmount>vhdmount /p /f MOSS2007DEVA.vhd

The Virtual Hard Disk is successfully plugged in as a virtual disk device.

b. C:\Program Files\Microsoft Virtual Server\Vhdmount>diskpart

Microsoft DiskPart version 6.0.6000
Copyright (C) 1999-2007 Microsoft Corporation.
On computer: XXXXXXXX

c. DISKPART> list volume

Volume ### Ltr Label Fs Type Size Status Info
———- — ———– —– ———- ——- ——— ——–
Volume 0 C NTFS Partition 87 GB Healthy System
Volume 1 F NTFS Removable 3920 MB Healthy
Volume 2 D NTFS Partition 93 GB Healthy
Volume 3 G SYSTEM NTFS Partition 16 GB Healthy
Volume 4 E Apricorn Ae NTFS Partition 149 GB Healthy

d. DISKPART> select volume 3

Volume 3 is the selected volume.

e. DISKPART> detail volume

Disk ### Status Size Free Dyn Gpt
——– ———- ——- ——- — —
* Disk 4 Online 30 GB 14 GB

Read-only : No
Hidden : No
No Default Drive Letter: No
Shadow Copy : No
Dismounted : No
BitLocker Encrypted : No

Volume Capacity : 16 GB
Volume Free Space : 3027 MB

f. DISKPART> extend

DiskPart successfully extended the volume.

g. DISKPART> detail volume

Disk ### Status Size Free Dyn Gpt
——– ———- ——- ——- — —
* Disk 4 Online 30 GB 0 B

Read-only : No
Hidden : No
No Default Drive Letter: No
Shadow Copy : No
Dismounted : No
BitLocker Encrypted : No

Volume Capacity : 30 GB
Volume Free Space : 17 GB

h. DISKPART> exit

Leaving DiskPart…

i. C:\Program Files\Microsoft Virtual Server\Vhdmount>vhdmount /u moss2007deva.vhd

Virtual disk device(s) successfully unplugged.

Advertisements

4 Responses to “Expand VHD File”

  1. Jim Holmes said

    Ouch. That’s pretty painful, but at least you can get it done.

    I just got a copy of VMWare and will be rolling over to it. Hopefully this kind of task isn’t as painful there…

  2. Yep, it wasn’t so bad once I had all the information. Unfortunately it was like a 4 hour process to find it.

    You will have to let me know how VMWare is. I’ve heard great things about it but haven’t wanted to spend the $200. Maybe I’ll download the evaluation copy and give that a whirl. I did download a beta version and ran into some issues (can’t remember off the top of my head) – I’m sure they are fixed now.

  3. Satish Reddi said

    Hi,

    Thank you very much. It’s worked well. We have spent around 2 days for this solution.

  4. Very nice work on this web site. Enjoying it a lot hah.

    Favorited! 😛

Sorry, the comment form is closed at this time.

 
%d bloggers like this: