I run windows server 2008 R2 to enable Hyper-V and I run it off a VHD.  As well I run Windows 7 x64 from another VHD.  So I can boot into either environment depending on what I need.  Also I can simply backup my machine in whole by just copying the VHD's to a backup drive.  I backup my code with SVN, and host my own SVN server on a colo machine I have.  That is backed up as well.  So I am covered in case of problems.  Well expect when I run out of hard drive space!

I actually ran out of hard drive space on host system when booting into Windows 7.

I have installed applications that I use everyday, and have hit my 30 GB max I set on my drive.  I looked around and saw that there was a tool called VHDResizer, but I know there has to be an easier way, and well there is.  As long as you have HyperV available. 

Make a copy of the VHD first, just in case...

Open Hyper-V manager, select Edit disk, select the vhd you want to resize.  Select expand, give it a new size.  The tool will run, depending on whether it is fixed or expandable, it should not take too long.

After all that expansion is finished, open the Storage manager, and attach the VHD.

Open a command prompt, run diskpart

Then type in the following:

>list disk

locate the disk you want, say it is Disk 3...

>sel disk 3

This will select disk 3.

>list part

This displays the partitions

>sel part 1

Selects the partition

>expand

Expands the partition to the rest of the allocated space.  It is important to note that the volume must be formatted NTFS for this operation to work.

Finally, simply reboot into Windows 7 (in my case) and the new storage is available.

Then, copy the new backup to a saved location and you are all set!

 

posted on Sunday, November 22, 2009 10:03 PM
Filed Under [ Windows 7 HyperV ]

Comments

Gravatar
# re: Resizing VHD files
posted by fmLisa
on 1/25/2010 12:18 AM
Very often, people write the thesis report by their own efforts. But some students like to order the superior knowledge just about this good post from the dissertation service, just because it is more simple.
Your Comment




 
Please add 8 and 3 and type the answer here: