As its name indicates, VHD Resizer is a tool that allows you to resize a VHD (Virtual Hard Disk). VHD is Microsoft’s format for virtual disks, and is used by Virtual PC, Virtual Server, and Hyper-V. VHD Resizer can be used to enlarge or shrink virtual disks of all three virtualization solutions. Windows Vista and Windows 7’s system backup tools also use this format. However, it doesn’t make much sense to enlarge a backup image. There are also third party virtualization tools, such as VirtualBox, that support the VHD format.
The most common problem with VHDs occurs when the disk of a virtual server is full. The nice thing about virtual disks is that they are quite easy to expand. I can’t help but wonder why Microsoft’s virtualization solutions haven’t integrated this option. In theory, this should be possible even while the server is running. After all, it is no problem to defragment the disk of a running server, so why shouldn’t it be possible to resize an online VHD?
In any case, VHD Resizer is free and easy to use. One thing to remember is that you have to shut down your virtual server first. All you have to do is to tell VHD Resizer the new size, and the name of the new virtual disk. VHD Resizer supports fixed disks (disks with an unchanging physical size) and dynamic disks (disks that grow dynamically). It seems as if the tool also supports conversion from dynamic to fixed disk types and vice-versa, but this didn’t work in my tests. Enlarging a VHD, however, worked fine.
VHD Resizer changes the size of the VHD, but not the size of the NTFS partition. Thus, if you access the VHD through a virtual machine, you just see a larger disk with additional unpartioned space. You have to use a partition management tool, like diskpart, to extend the partition. Only then can you make use of the full capacity of the virtual disk. Diskpart is a Windows command line tool.
Extending a partition with diskpart is very simple:
- Launch diskpart on a command prompt.
- Type “list volume.” This gives you the number of the volume that you want to extend.
- Type “select volume volume-number.“
- Type “extend.”
Note that Microsoft’s documentation for diskpart states that only the extension of data volumes is supported. System or boot volumes may be blocked from extension. Even so, during my test, I was able to extend a Windows 7 system volume without problems. Still, it might be safer to add the VHD to another virtual machine as a data volume and extend it there.
By the way, if you only want to enlarge a data volume, you don’t need VHD Resizer. Just create another virtual disk with the appropriate size for your virtual machine, and then copy all files to the new disk.