How to fix MBR from Ubuntu

If you've ever tried to dual boot for your Windows system using Linux, it is likely that your system has experienced some unnecessary changes.

If you've ever tried to dual boot for your Windows system using Linux, it is likely that your system has experienced some unnecessary changes.When installing Linux in this environment, the GRUB bootloader will override the Windows bootloader in the Master Boot Record (MBR).

The same is true of the opposite: If you installed Linux first and then decided to install Windows, then Windows' bootloader will override GRUB's bootloader and there will be no way to boot the computer. Your Linux anymore.Or perhaps you have decided not to use Linux anymore and want to remove it completely, leaving only Windows.

Any of the above can cause problems for new users, but with a bit of patience and care, you will have many ways to restore thebootloader, and thereby repair the MBR.

Request

The first step is to download and create a CD or USB disk containing the operating system (live USB, live CD) hunting on your Linux.Ubuntu is the easiest and most accessible platform, although most Linux versions can be used for this.Then, if you use another computer, visit the Ubuntu website and download the copy that matches your system configuration.If you're not sure, download the 32-bit version, which is available on any system.

How to fix MBR from Ubuntu Picture 1How to fix MBR from Ubuntu Picture 1

Boot live USB contains Ubuntu

The next step is to boot your computer into Ubuntu via the BIOS and select'Try Ubuntu without installing' from the menu.If that fails, make sure that secure boot has been DISABLED in the BIOS, otherwise your system will never boot into the GRUB loader to allow Linux selection.

After the desktop has started, you will need to open Terminal (which can be found in the Applications menu).

How to fix MBR from Ubuntu Picture 2How to fix MBR from Ubuntu Picture 2

Note: at this point, notice that you are processing directly on your hard disk, please read the instructions carefully before making any changes, otherwise your entire system may become up unstable, error or worse is broken.

Until now, the easiest way to fix MBR is to use a small utility called "boot-repair" instead of working directly in Terminal.

First method: Use the Boot Repair utility

First, you will need to add more archives.Type the following command:

 sudo add-apt-repository ppa: yannubuntu / boot-repair 
sudo apt update
sudo apt install boot-loader

After the installation is successful, click on theBoot Repairiconin your application menu to get started.

How to fix MBR from Ubuntu Picture 3How to fix MBR from Ubuntu Picture 3

After the utility has been started, select the repair type.For most users, the following repair type will be Recommended repair:

How to fix MBR from Ubuntu Picture 4How to fix MBR from Ubuntu Picture 4

After selecting the repair type, you can boot the system by selecting Windows or Linux from the GRUB menu.This utility will also allow you to change or check some of the other options above if you need to repair the repair more complexly.To use the MBR tab, click "Restore MBR".

How to fix MBR from Ubuntu Picture 5How to fix MBR from Ubuntu Picture 5

Method 2: Use Syslinux

This is a slightly higher method, requiring you to work directly with the Terminal.If you are not really confident then follow the first method.

Open a terminal and type the following command:

 sudo apt-get install syslinux 

After the command completes, continue typing as follows, paying attention to changing the drive letter "sda" when needed:

 sudo dd if = / usr / lib / syslinux / mbr.bin of = / dev / sda 

Alternatively, you can restore MBR by entering the following command:

 sudo apt-get install mbr 
sudo install-mbr -i n -p D -t 0 / dev / sda

3rd method: LILO

Boot the above mentioned live CD or live USB disk, and enter the following command in the terminal:

 sudo apt-get install lilo 
sudo lilo -M / dev / sda mbr

where "/ dev / sda" is your drive letter.

Conclude

MBR is easily overwritten when you perform dual boot Windows and Linux.The above steps will help you recover your MBR.Good luck!

See more:

  1. How to fix Master Boot Record in Windows 10
  2. Troubleshoot Linux boot problems with GRUB
  3. Restore the Ubuntu Bootloader Wubi component
  4. Transfer MBR to GPT on Windows drive
4 ★ | 82 Vote