MBR or Master Boot Record is a small program that defines how operating systems are loaded. It resides in the first 446 bytes of your boot disk and could be deleted or replaced when installing a new operating systems such as Microsoft Windows, making you unable to boot into your other installed operating systems.

This makes it essential to backing up your MBR, especially prior to installing a new operating systems. MBR could be backed up from Linux using dd at the terminal.

Backup Master Boot Record from Linux:

  1. Launch your preferred terminal application.
  2. Check available disks and select the one with the MBR to backup.
    $ lsblk
    NAME   MAJ:MIN RM  SIZE RO TYPE MOUNTPOINT
    loop0    7:0    0   89M  1 loop /snap/core/7713
    loop1    7:1    0 54.6M  1 loop /snap/lxd/11964
    loop2    7:2    0 54.6M  1 loop /snap/lxd/11985
    loop3    7:3    0 88.7M  1 loop /snap/core/7396
    sda      8:0    0   20G  0 disk
    ├─sda1   8:1    0    1M  0 part
    └─sda2   8:2    0   20G  0 part /
    sr0     11:0    1  748M  0 rom
  3. Backup the master boot record of the disk using dd to a file.
    $ sudo dd if=/dev/sda of=/home/user/mbr.bak bs=446 count=1
    [sudo] password for user:
    1+0 records in
    1+0 records out
    446 bytes copied, 0.00140727 s, 317 kB/s
  4. Verify that the MBR is successfully backed-up.
    $ cat /home/user/mbr.bak
    �c����€t��pt���y|1��؎м �d|<�t��R��t��}��|�A��U�ZRr=��U�u7��t21��D@�D��D�f�\|f�f�`|f�\
    Z������}�f�ƈd�@f�D�������@�����f�f�`|f	�uNf�\|f1�f�4��1�f�t;}7����0�����Z�ƻp��1۸�r��`���1������a�&Z|��}���}�4��}�.���GRUB GeomHard DiskRead Error
    ����<u��

    The file is in binary format but you should be able to see some strings such as GRUB (if you're using GRUB as your bootloader) as hint that you've copied the right section of the disk.

  5. Store the backup in other medium such as removable media for easy restoration in case of MBR corruption in the future.
Discuss the article:

Comment anonymously. Login not required.

Share!