Google Plus

Save and Restore MBR in Linux

Written by Mel Kham on . Posted in Linux tutorials

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}

//
For questions please refer to our Q/A forum at : http://ask.unixmen.com

Mel Kham

Founder of Unixmen, Living in Amsterdam. Am working in my free time to help people to understand the Opensource and to explain them in easy way how to make the fist steps to the the light. Working day and night with my Co-founder Zinovsky to keep this website live even with less resources.
  • 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.

  • http://macsim.labolinux.net macsim

    Hello, I took the liberty to translate your post in french on my personnal blog, links to the translation is here http://macsim.labolinux.net/2010/02/12/sauver-et-restaurer-le-mbr-avec-gnulinux/

    Indeed I add an original post link at the end.

    If you have any problem with this just email me.

    Keep going

    Max

  • Zinovsky

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

Like us on Facebook

This week Top Posts

Write for us

Recent Comments

SK

|

Yes i will. Keep visiting. Subscribe us to get daily updates. Thanks for the comment

Rakesh Vijayan

|

Hi SK

I am Rakesh vijayan thanks for your great work ,by your work I start to learn what is ldap , my request is will you make tutorial for ldap and samba pdc for us on ubuntu 12.04

Guest

|

It was a typo. Now its corrected. Thanks for pointing out.

Michael T

|

You shouldn’t be so stupid, in the first time.

PrestaShop

|

Hi! Thank you for this nice article. We’ve 130,000+ active stores, you forgot the “1″ ;-)

 
IDG Tech Network
Copyright © 2008-2013 Unixmen.com .
Maintained by Anblik .