Save and Restore MBR in Linux

The MBR or Master Boot Record is an area at the beginning of your hard drive. It is very important because it contains the partition table. There are also routine boot whose goal is to load the operating system.

From a general point of view, backup your MBR does not really interest. Unless you intend to perform manipulations risky on your hard drive or install a new Boot Loader (Grub, Lilo …) for examples.

Save the MBR

To make a backup of your MBR, run the following command as root and adapting / dev / sda depending on the path to your hard disk:

dd if = /dev/sda of = MBR.dump bs = 512 count = 1

If you do not know the path to your hard drive, fdisk-l can help you.

Restore MBR

To restore the MBR if problem is a little less straightforward because it will initially start on a liveCD. Once the command prompt on the screen, he can run this (still adjusting the path of your hard drive):

sudo dd if = MBR.dump of = /dev /sda

Note that here we’ve reversed the inputfile and outputfile the dd command to perform the reverse operation.

Via Tux Planet (French) Special Thanks to

{loadposition user9}

Related Articles by Tag :

{module Related Articles Plus}

  • Dominik

    1) There are spaces in the command – it won’t work
    2) Be aware that this just backups the bootloader and the four primary partition slots. Extended partitions is a linked list spread over the HDD. If you need to backup the whole partition table, this won’t help.

  • macsim

    Hello, I took the liberty to translate your post in french on my personnal blog, links to the translation is here

    Indeed I add an original post link at the end.

    If you have any problem with this just email me.

    Keep going


  • Zinovsky

    As long you mention the original link i have no problem. :twisted: