Microsoft’s Hyper-V is a really cool virtualisation technology I have been having fun exploring. You cannot run a Hyper-V Server on a Windows 7 host, however, so in order to run it, I installed Windows 7 and Windows Server 2008 R2 side-by-side, and used it in the latter.
All that has changed in the era of Windows 8, however, and you can run a Hyper-V Server on the client version of Windows 8, if it is Windows 8 Pro. Hooray!
So, to cut a long story short, post-upgrade, I felt I didn’t really need my separate Windows Server 2008 R2 partition for Hyper-V, so I deleted it and expanded the Windows 8 partition to fill the space. Only to find that Windows now wouldn’t boot. Oops.
I originally installed Windows 7 first, followed by Windows Server 2008 R2, following best practice to install newer operating systems after earlier ones. What had happened now, though, was that I had just wiped out the bootloader that was sitting happily on the Windows Server 2008 R2 partition.
Fixing the Bootloader: First Steps
The first port of call when you have a broken Windows bootloader is Microsoft’s own Startup Repair tool on the Windows disc, or in your Recovery Environment.
This tool is generally completely useless in situations where Windows will not boot because the hard drive has failed, but in this situation, where we genuinely have a missing boot loader, it is often the only thing you need to do to get everything running again.
Unfortunately, it didn’t work in my case. More investigation, or perhaps more advanced tools, were needed.
Choosing to enter the Command Prompt instead of the Automatic Repair option grants you more power — if you know how to use the command line tools for dealing with broken bootloaders.
In my scenario, it was possible that the bootloader on the Master Boot Record of the disk was missing after the change in partition layout, so this was the first command I used.
This operation completed without issue, but it didn’t solve my issue — Windows still would not get to a bootloader. Since my Windows Server 2008 R2 partition likely had the
BOOTMGR code on it, perhaps it wasn’t the MBR that needed to be fixed.
Upon running this command, I saw an Element not found error, suggesting that there were no Windows installs at all! This obviously was not correct, however — the partition could be mounted and everything was still there.
Bootsect.exe and Setting the Active Partition
As it turned out, in my case, not only did the boot code require reinstallation, but I had to set the ‘active’ flag on the new C: drive, or it won’t get invoked at all! This is in contrast to what I’m more familiar with, where the GRUB bootloader will kick a Linux system into action regardless of whether any partitions are ‘active’.
Now, a reboot into the Windows 8 CD and back to the command prompt, and the following command reinstalled the boot sector on this new C: drive.
bootsect.exe /nt60 C:
After another run through BootRec.exe’s options just for luck…
There was no longer an error about Element not found, and these commands were able to complete.
Finally, I rebooted to this:
Windows 8, booting normally. Fixed!
If You Havin’ Boot Problems…
Try the following steps:
- From your Recovery Environment, or a Windows disc, use the built-in Automatic/Startup Repair.
- Use the command line in the same recovery environment to
- Use a tool like Gparted to set the desired partition active.
- Reinstall the boot sector to the target drive with
bootsect.exe /nt60 C: