# Friday, 22 February 2013

There are now many thin Windows based Ultrabooks and Windows Tablets running on SSDs, for budget reasons you might have bought one with limited storage. Say 32GB or 64GB and had hoped to expand your storage via other means, either by the use of SD cards, slim form factor USB drives, or some other cheap expandable storage. But after a while you'll realize a very serious limitation to such an upgrade path. Quite a few programs will detect if they're being installed to or running from a removable media and refuse to work in such a manner.

Luckily there is a way around this limitation, which is through the use of a Virtual Hard Disk (VHD) file. A VHD is a file that represents an entire disk, hence it's name.

It's easy to create a VHD file, just press the Windows key to bring up the Start screen or menu depending on wheter you're in Windows 8 or Windows 7 and type Disk Management into the search box. You'll see an option called Create And Format Hard Disk Partitions select that. (In Windows 8, the option is under the Settings category of the search results).


In the Disk Management program, click on Action -> Create VHD.


You'll then be presented with a dialog box to decide on what kind of VHD to make.


Use the Browse button to select where to create the VHD file, you should probably choose to directly create the VHD file on the USB stick or SD card to save the time to move the file onto it later.

Specify the size of the VHD file under Virtual Hard Disk Size. This CANNOT be changed once so make up your mind about it.

IMPORTANT NOTE : Due to the difference in how storage manufacturers and the OS calculates free space, remember to ALWAYS give a buffer of around 10% from the stated capacity of your media if you're not creating the file on it directly. For example if you have a 32GB thumb drive, you should specify 29GB (10% of 32GB being 3.2GB) as the size of your VHD file. Also note that you'll need to format your storage media to NTFS or exFAT instead of FAT32 in order to support extremely large files.

Under Virtual Hard Disk Type make sure it's FIXED.

Press OK and then go grab a snack or something, cause it'll take a while to make the disk depending on the size you wanted.


Once the VHD is ready you should see it in the bottom section of disk management. It should be at the bottom of the list so you might need to scroll down to see it. If you don't see it, then under the Action menu where you selected Create VHD previously, select Attach VHD and select the file you created.


It'll be the one that has the Not Initialized words on it, and of course it'll be of the size you specified. Right Click on it and select Initialize Disk.


Leave all the options as default in the next dialog and just press OK. The disk will now be ready as a basic disk.


Right Click in the Unallocated area and select New Simple Volume.


A dialog with a few pages will pop up, the first is a greetings screen, the second...


Is for you to confirm the formatted size of the volume, by default it should already be the maximum capacity which is what you should keep it as. The next dialog is important.


It'll ask you for the drive letter you want to assign to this drive. You should assign a drive letter that's near the end of the alphabet if you plan on permanently using the VHD in this PC. The next screen will ask you about formatting parameters.


Just leave everything on default, but give it a Volume Label if you'd like. Click on next and then finish up the wizard and wait a while for it to format, once completed the new drive letter will appear in the status display and Windows Explorer.


So... you now have a virtual hard drive that for all intent and purpose IS a real hard drive to Windows. So you can do anything you want to it, install programs on it, back it up using file history, etc. etc.

But there's a slight problem, the VHD goes away everytime you reboot your system. It'll stay in your system if you do a standby or hibernate as long as the media the VHD is on isn't removed from the system when it wakes up. Which means that you'll need to reattach the VHD everytime you reboot the PC.

Running into Disk Management everytime you reboot your PC isn't the most convenient thing to do. So what you need is a quicker method to mount the VHD files.

Here are two batch files which automate the process of mounting the VHD

Update You dont' need this if you're using Windows 8, double clicking on a VHD file will mount them even if the OS says there was a problem doing so!

Single VHD AutoMount Script

Multi VHD AutoMount Script

To use the SINGLE VHD script, copy it to the same folder as your VHD file, and rename it to the same name as the VHD file. ie. If the VHD name is mainvhd.vhd the batch file name is mainvhd.bat. Double click to run and mount the VHD

The MULTI VHD script will mount ALL VHD FILES IN THE SAME FOLDER as the script file itself, it's basically for anyone who doesn't know how to rename a file properly... although if you fall in that group you probably shouldn't be doing this. Smile with tongue out

Note that you still need Administrator rights to mount the VHD.

Hope this super long post gave you some help on how to deal with the relatively limited capacity of your Windows Tablet / Ultrabook! On a last note, writing to a VHD on an external storage should be slower than directly writing directly to the storage itself, but I don't find it that much of a problem, your mileage may wary depending on the performance of your media.

Note that you can Post As GUEST as well.
blog comments powered by Disqus