Earlier this month I wrote how you can mount a VHD using the command line utility DiskPart. This is an extremely useful utility, but sometimes you just want the simplicity of using the Windows GUI interface. Well, in Windows 7 the Disk Management MMC snap-in makes this a breeze.

The easiest way to load the snap-in is to open Computer Management by right-clicking on the “Computer” link in the Windows start menu and choosing “Manage”. This action will open a whole host of utilities you can use to manage your computer, but for this exercise you will only need to use the Disk Management link located in the left pane under Computer Management\Storage. Once you click on Disk Management it may take Windows a few seconds to find all of your storage devices and display them in the right pane.

Once the storage devices have loaded you can click on the Action menu at the top of the window. You now have the “Attach VHD” menu option. Simply click that option and select the VHD file you want to attach.

Detaching the file is a little more confusing. To detach it you have to navigate to the disk in the bottom pane of the Disk Management utility. The left most column in that pane is a series of buttons with the disk name shown. Right click on the disk name (e.g. Disk 2 in the image below) and select “Detach VHD”. Ensure you don’t check the delete checkbox, unless you don’t want any data on the VHD anymore.

 

detach

Copyright © Scott P. Rudy 2009 All Rights Reserved

If you are running the Business, Enterprise or Ultimate version of Windows Vista or Windows 7 you can use the Windows Backup and Restore Center to conduct full hard drive backups of your computer. All you need is enough storage media that can accommodate the used portion of your hard drive. While you could use CD or DVD storage, the simplicity of using a large external USB hard drive is much more convenient, especially with the size of some of the hard drives shipped out today.

This feature has been long overdue in the Windows world, but it now provides some great reassurance. Full backups simply place your files into VHD files. However, what happens when you backup your machine and then reinstall an OS from scratch? How do you get the files off of your VHD. Well, if you are running Vista you need to use a tool like VHDMount that ships inside the Windows Virtual Server 2005 R2 sP1, unless you have a Windows 7 install CD handy and you swap out the boot loader by looking at one of my previous posts.

You can’t install VHDMount on Windows 7, but you don’t need to either. The built-in DISKPART utility allows you to mount VHD files as a drive letter just like VHDMount. Simply locate your VHD file and use the following commands in a command prompt with elevated privileges.

Microsoft Windows [Version 6.1.7600]
Copyright (c) 2009 Microsoft Corporation. All rights reserved.
C:\users\scottrudy\>DISKPART

Microsoft DiskPart version 6.1.7600
Copyright (c) 1999-2008 Microsoft Corporation.
On computer: SCOTTRUDY

DISKPART> SEL VDISK file="E:\…\1c44c446-91c0-11dd-8709-806e6f6e6963.vhd"
DiskPart successfully opened the virtual disk file.

DISKPART> ATTACH VDISK
DiskPart successfully attached the virtual disk file.

When you are finished simply type DETACH VDISK to unmount the file.

Copyright © Scott P. Rudy 2009 All Rights Reserved