The Master Boot Record (MBR), also called partition sector, is a small partition located at the beginning of a hard drive, which contains all boot information and partition layout.

Generally speaking, backing up an MBR is not useful most of the time. However, it will be useful if you intend to perform risky manipulations on your hard drive such as installing a new Boot Loader (Lilo, Grub, etc.).

  • Backing up an MBR

To back up an MBR, launch the terminal as root, then run this command:

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

Replace /dev/sda1 with your hard drive path. If you don't know how to get your hard drive path, then run this command as root:

fdisk -l 

  • Restoring an MBR

To restore an MBR in case of problems, start your system via LiveCD. Once the command prompt screen shows up, run this command:

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

Don't forget to replace /dev/sda1 with your own hard drive path. That's it.  

Post a Comment