I’ve recently updated my computer and realised that the drive containing my Windows 10 partition didn’t contain a MBR (master boot record) partition. This is because I originally installed Windows on a new disk while another disk with another version of Windows installed was present in the computer. This lead the MBR partition to be on the old disk.
This wasn’t a problem until the disk with the old installation died, and with it my ability to boot my computer.
Fixing it wasn’t as simple as booting the Windows 7 DVD and using a tool, so here are the steps I took and problems I faced.
First of, make sure there are no other drives attached to the computer except for the drive with your Windows partition. The repair tool on the DVD didn’t want to work as long as I had several disks connected.
Also, I had to make sure I was booting from the DVD in “UEFI” mode, since my motherboard is modernish (2011). This meant using the F8 key on the bios screen, and selecting the correct drive. I was also prompted to press on a key to actually start the Windows DVD. Doing nothing meant booting in “normal” mode, which also prompted an error.
With that out of the way, I managed to boot on the DVD and enter the repair tool, which is just a console command. I was lucky that my ssd still have about 500 mb of unpartitioned space that I could use for the MBR.
I ended up doing the following commands, following the instructions from here.
diskpart list disk select disk 0 list partition create partition efi format quick fs=fat32 list partition exit
A breakdown of what I did.
diskpart. This is the tool to view and edit partitions on your drives.
list disk. Lists all your disks. Should only be one.
select disk 0. This is to select my first disk, based on the previous command.
list parition. Self-explanatory, it lists your partitions. Allowed me to make sure I had unaffected space at the end of my disk. If you don’t have space at the end, the rest will become more tricky, but you can resize your partition using other tools.
create partition efi. This tells diskpart to create a partition tagged “efi” at the end of the disk with all the remaining available space. If you don’t have enough space, following the link provided earlier as there is walk-through on how to shrink your main partition’s size.
format quick fs=fat32. Quickly format the new partition in the fat32 format. This is required for the MBR to load properly.
list partition. Make sure your new partition has been created and is in fat32 format.
exit. Exists the diskpart command, because there is still more to do.
Now that the efi partition is created and ready, we can rebuild the mbr with the following commands.
Replace C:\ with the letter of your windows partition. This will recreate the mbr on your new partition and tell it where your windows is located.
There you go, you should be able to boot again.