I made a major boo-boo mistake, inadvertently marking a non-boot partition as Active on my primary development server making it un-bootable and with no recovery image (doh!) a simple error could have been a catastrophe. On a sidebar, this error is just another reason to use the awesome BGINFO as it probably would have stopped me from doing what I was doing thinking I was in a virtual machine… 😉

In the old days, reloading Windows was not so much of a drama, but now with Hyper-V “importing” virtual machines that are not “exported” is a pain in the backside meaning that if you hose your host system, recovering everything can take a while.

Restarting the host server resulted in a “BOOTMGR is missing” error and a little shudder went down my spine.

I popped in the W2k8R2 DVD and (as I suspected) there were no available repair options, dropping into a command prompt, I tried to use DISKPART to mark the wrong partition inactive and mark the correct one active, but no dice.

I also tried from the prompt to rebuild the BCD with a “bootrec /rebuildbcd” but again, no dice.

Despair almost set in until I remembered something that a chum had told me about (if I ever remember who it was I will for sure credit them!) where he had used a Windows 7 x64 DVD to boot a non-booting Windows 2008 Server R2 server as the boot loading elements are essentially the same and Windows 7 comes with a user friendly recovery tool as part of the install/boot process.

Quickly burning an MSDN DVD image I booted the server off the DVD and after the requisite location choices dropped into repair mode and lo-and-behold Windows 7 (god bless it) noticed that something was awry with my bootable partition, offered to fix it, rebooted once, did some more silent magic and on the next reboot; presto! Windows Server 2008 R2 came back.

Once the server was back I knew a little bit of tinkering with the boot configuration data store would be required using bcdedit, so I opened an elevated command prompt and entered:

bcdedit /set {current} hypervisorlaunchtype auto

(note: this assumes there is only 1 bootable option, you may need to insert the actual id instead of “{current}” if you have more than one and are following this post in a cold sweat!)

then a quick check with:

bcdedit /enum

just to check that the hypervisor launch was indeed set to auto, and for the second time in as many minutes; hey presto! W2k8 is running smoothly and with the hypervisor underneath ready for me to be spinning up virtual machines until bedtime.

Now wouldn’t it be nice for Microsoft Windows Server Engineering Group to add some of the Windows 7 friendly goodness to Server 2k8 R2? I know that server admins know better and don’t need any help but wouldn’t it just be nice for the help to be there!

Just a thought!

Please note that if you stumble on this post and use it to recover your own system, you do so at your own risk and no warranty of any kind is expressed or implied in this blog posting; it’s just me sharing my experiences!