How to restore MBR in dualboot system

MBR (Master boot record) is the default bootloader of Windows. After you install a Linux distro alongside with Windows, MBR will be replaced by the bootloader of the Linux distro (usually Grub or Grub2). If you want to remove the Linux distro out of your computer, the first thing you need to do is to restore MBR. In this article, I will show you some methods to do that:

1 - Use Boot-Repair

Boot-Repair is a tool provided by Ubuntu to repair frequent boot issues you may encounter in Ubuntu or other Linux distros like when you can't boot Ubuntu after installing Windows or another Linux distribution, or when you can't boot Windows after installing Ubuntu, or when GRUB is not displayed anymore, some upgrade breaks GRUB, etc...

If you are using Ubuntu, you can install Boot-Repair by using the following commands:
 sudo add-apt-repository ppa:yannubuntu/boot-repair  
 sudo apt-get update  
 sudo apt-get install -y boot-repair && boot-repair  

After that, when you run Boot-Repair, you can select the option "Restore MBR" to replace Grub with MBR. From now when you reboot your computer, it will boot up with Windows.

How to restore MBR in dualboot system

2 - Use Lilo

Lilo was the popular bootloader of Linux before the time of Grub. You can use Lilo to replace Grub with MBR. The command to install Lilo in Debian-based distros is:
 sudo apt-get install lilo  

After you got Lilo installed, to replace Grub/Grub2 with MBR, you can use the following command ( let's assume you installed Grub/Grub2 on /dev/sda):
 sudo lilo -M /dev/sda mbr  

3 - Use Windows tools that can fix MBR

If you dont like using Linux tools, there are several good Windows tool that can do the task.

One free popular tool to fix MBR problems is MBTfix. You can download it here

Another tool I recommend is MiniTool Partition Wizard (its free too). On the left side of MiniTool Partition Wizard, there is an option to restore MBR:

And with MiniTool Partition Wizard, you can remove the Linux partition as well if you dont want to use Linux anymore.
linux tips and tricks