Rather than a full system restore, I just booted from the backup VHD.

Boot to VHD is one of those cool Windows 7 / Windows Server 2008 R2 features that most people don’t use because it involves faffing about with BCDedit and ugly GUIDs. Did you know you could use it to boot into a backup image of your system as well?

Orin Thomas

September 29, 2010

3 Min Read
ITPro Today logo in a gray background | ITPro Today

Boot to VHD is one of those cool Windows 7 / Windows Server 2008 R2 features that most people don’t use because it involves faffing about with BCDedit and ugly GUIDs. Did you know you could use it to boot into a backup image of your system as well?

(speaking of GUIDS - check out http://secretgeek.net/HotGuids/ )

Anyway in the last few days the HDD on one of my laptops has been throwing a bunch of S.M.A.R.T errors. Occasionally the system would freeze, but mostly it was just running like a wombat who has mildly overdosed on sedatives.

These errors annoy the heck out of me. I knew that I needed to replace the laptop HDD, but this was also my gaming laptop and buggered if I was going to be downloading half a terabyte of stuff off Steam and Impulse if the thing conked out before a successful backup was taken.

Eventually I took the backup (I use SharePoint Workspace to sync all my work files, so my data wasn’t at risk, the risk was more about the time it would take to replace the games if I had to do a clean install).

Put the new HDD in and went to do a system restore and encountered a couple of odd errors. I could have resolved these given a couple of hours faffing about, but then I figured - why not just boot off VHD?

Windows 7 backup files are stored in VHD format. I used the installation media and the command prompt to copy the backup file across from my USB drive to the new HDD.  If your skills in the force are strong, you can configure Windows 7 to boot directly off the backup file. I renamed it from the evil GUID looking name it had to something a little more pleasant. Used BCDedit in the proscribed manner and my gaming laptop was back in business without having to redownload CIV 5, StarCraft II, Dawn of War II and a whole lot of other time wasters that I don’t actually have time to play, but which comfort me by there mere presence on my system.

Relaxation by knowing that if I wanted to relax they’d be there for me, rather than having time to actually crush the Zerg or get my Civ to Alpha Centauri.

The BCDEdit commands you want are as follows:

Copy the backup VHD file across to your volume

Rename it something less painful like WIN7.VHD

Run the command:

bcdedit /copy {current} /d “Boot_From_Backup”

Take note of the CSLID that is displayed

Then run:

bcdedit /set {CLSID} device vhd=[C:]win7.vhd

(substitute the CSLID, but keep the square brackets around your drive letter)

bcdedit /set {CLSID} osdevice vhd=[C:]win7.vhd

bcdedit /set {CLSID} detecthal on

Reboot and then the item “Boot_From_Backup” will appear in your boot menu.

Some caveats. If there is less space on the volume you put the VHD on than there was on the original volume that the VHD is an image of, you’ll get a STOP error. For example - if you create a backup of a 500 GB volume, even if you are only using 150 GB, you’ll need to put the backup VHD on a 500 GB or larger volume, even if the VHD itself is only 150 GB in size. There is some mucking around you can do with VHD resizing, but prior to taking the backup, consider defragmenting and then shrinking the volume. This will reduce the size that the expanded VHD wants, giving you more placement options.

Sign up for the ITPro Today newsletter
Stay on top of the IT universe with commentary, news analysis, how-to's, and tips delivered to your inbox daily.

You May Also Like