Master Boot Record (MBR) is the data stored on the first sector of the storage drive that locates and loads Windows. If you’re getting different errors like ‘Operating System Not Found’, ‘Missing Operating System’, ‘Invalid Partition Table’, ‘Bootmgr is missing’, etc., these all could mean that the MBR is probably corrupted.
When this happens, you’re likely going to face boot problems. There’s no fixed reason why the MBR could get corrupted. But usually, this is due to improper shutdowns and ransomware attacks.
Fortunately, it’s possible to troubleshoot this problem using the Bootrec.exe utility or by completely rebuilding the BCD. Here are some troubleshooting tips that you can try to fix MBR on Windows.
Perform Startup Repair
Before anything else, I recommend performing startup repair. This is a built-in Windows feature that lets you fix any issues that may be failing your OS to boot up. You can access this from the Windows Recovery Environment/Advanced Startup.
- Force shut down your computer and turn it back on.
- Repeat the step two to three times until Automatic Repair screen appears.
- Click on the Advanced options button.
- Now, navigate to Troubleshoot.
- Then, choose Advanced options.
- Next, pick Startup Repair.
- Wait until your PC is diagnosed with possible startup problems and restarts your computer. This might take a few seconds to even more than an hour depending on what’s wrong with your computer.
- If it doesn’t solve your problem or you will see the Startup Repair couldn’t repair your PC error, choose Advanced Options and move on to the next method.
Note: If your PC doesn’t get to the Windows Recovery Environment after performing a hard reset, you need to insert a bootable disc or flash drive. Then, from the Windows Setup screen, pick ‘Repair my computer.’
Repair Critical Disk Structures Using Bootrec.exe
Startup Repair is just a general fix and might not work for the majority. On the other hand, Bootrec.exe is a specialized utility that can repair the MBR, boot sector, and BCD Store. Executing the dedicated commands can help fix the corruption issues and update the MBR code.
- Once you’re in the advanced recovery environment, pick Troubleshoot > Advanced Options.
- This time, choose Command Prompt.
- Wait until you get to the account selection screen. Once you’re there, select your account to continue.
- Now, enter your correct password and press the Continue button.
- After the Command Prompt window opens, check for your boot drive. Usually, this should be a C drive (unless you’ve installed your PC on another one). But sometimes, it can change in the Windows RE. Just note that the drive should have the Windows directory. If you do not see it, check in another drive.
You can take a reference from the below screenshot. I first entered C drive and then used thedir
command to list all its directories. - Next, start executing the following commands one after other:
bootrec /fixmbr
(writes a compatible MBR to the system partition and removes nonstandard code)bootrec /fixboot
(writes a new boot sector to the same partition)bootsect /nt60 sys
orbootsect /nt60 all
(if you see an ‘Access is denied‘ error when fixing the boot)bootrec /fixboot
(re-execute the command and this time, it should work)bootrec /scanos
(wait until the file is scanned)bootrec /rebuildbcd
(rebuilds the BCD Store)exit
(exits from the Command Prompt window)
- Once you’re in the Choose an option screen, pick Continue and check if you’re able to boot into Windows again.
Complete Rebuild of BCD Store
In most cases, a simple rebuild of the BCD store should fix the MBR. However, if you’re getting the ‘Bootmgr is Missing’ error, the solution above might not be enough. In that case, I recommend backing up your BCD store first. Then, delete it and rebuild the BCD store as instructed below:
- From the Windows Recovery Environment, open Command Prompt as earlier.
- Now, execute the below commands:
bootrec /fixmbr
(attempts to fix MBR)bcdedit /export <drive>:\bcdbackup
(exports the contents of the system store inside the BCD_Backup file to the specified drive)attrib <drive>:\boot\bcd -s -h -r
(deletes the system, hidden, and read-only attributes for bcd)ren <drive>:\boot\bcd bcd.old
(renames bcd to bcd.old)bootrec /rebuildbcd
(rebuilds the BCD Store)exit
(exits Command Prompt)
- Pick Continue and check if you still get the ‘Bootmgr Is Missing’ error.
Perform System Restore
If neither of the two methods solved your problem, I recommend opting for System Restore. This should take your Windows back to a working configuration based on the specified restore point.
- In the Windows RE, navigate to Troubleshoot > Advanced Options > System Restore.
- Select your account and enter the correct password to continue.
- Wait until the System Restore dialogue box appears. On the first screen, hit Next.
- Then, pick a custom or automatic restore point and press Next.
- Click on Finish.
- Next, press Yes to confirm your action in the confirmation prompt.
- Wait until the system starts to be restored. Once a dialogue box pops up, hit the Restart button.
Clean Install Windows
The last option is to reinstall Windows. When you clean install the OS, both the corrupted MBR and boot sector will be replaced.
Before proceeding to perform a clean installation. make sure you have backed up all your important files. I understand you can’t boot into Windows right now. But there are plenty of solutions available on the web. I personally recommend removing the storage drive and cloning it to another one for the time being.
- First of all, create a bootable USB drive and boot using it. Make sure you have changed the boot order from BIOS.
- Select the appropriate option and hit Next.
- Next, click on Install Now.
- Now, enter your product key. If you want to add this later, you may pick the ‘I don’t have a product key’ option.
- Then, select the OS and hit Next.
- Accept the license terms and click Next.
- You may choose either of the option—Upgrade or custom.
- Now, allocate space to the storage drive and let Windows create system partitions for you.
- Hit Next and the Windows installation should start.
- Once it completes, you can sign in to your Microsoft account and finish setting up Windows.