Third Shelf

Resizing a virtual hard disk

Posted in windows by Sydney du Plooy on June 29, 2010

Recently, I had to resize a VHD (virtual hard disk) that I installed Windows Server 2008 on. I soon found out that the size of 10GB is not such a hot idea when installing Team Foundation Server 2010 and SQL Server 2008 on the same instance. Hence, I decided to resize the disk instead of re-installing all of the software.

Below is the recipe to resize the virtual hard disk:

Part 1:

The first part is to resize the container of the partition, which is done by means of a sector copy. After the resize completed,  the container will have increased but the partition will not be fully extended yet.

  1. Download VHD Resizer from VMToolkit.
  2. Install and run VHD Resizer.
  3. In the file open dialog select the VHD that you want to resize.
  4. Type in the new filename to use for the extended VHD.
  5. Type in the size of the new container to create.
  6. Click on Resize. The process takes a few minutes…

Part 2:

Now that the container is resized, we must now extend the partition to make use of the full container size.

  1. Attach the new extended VHD as a non-primary drive to another virtual machine. Do not extend the partition using the virtual machine that will make use of it.
  2. Start the virtual machine to which the extended VHD was attached as the non-primary drive and open a command prompt.
  3. Type in diskpart and press Enter.
  4. Type in list disk.
  5. Ensure that disk 1 or greater is the extended disk.
  6. Type in select disk 1.
  7. Type in list partition.
  8. Ensure that the partition sizes matches the old size.
  9. Type in extend.
  10. Wait for the process to complete and type exit.

Remember to change the disk on the original virtual machine to now use the extended disk. The disk is now resized and ready to be used from the original virtual machine.

Advertisement
Tagged with:

Leave a Reply

Fill in your details below or click an icon to log in:

Gravatar
WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Connecting to %s

Follow

Get every new post delivered to your Inbox.

Join 143 other followers