Linux Basics Tips & Tricks

How to restore / backup MBR in Linux

backup MBR
backup MBR

How to  restore / backup MBR in Linux

This post explains how to restore / backup MBR on Linux. Master Boot Record (MBR) is the first sector of any hard drive. It consists of information that where is the operating system located. It helps to load the operating system into computer’s primary storage, so it is critical to backup the MBR.

Backup MBR:

 
dd if=/dev/sda of=/root/mbr.back bs=512 count=1

The above command will backup the MBR (First 512 bytes of the hard disk).

NOTE: Replace /dev/sda with the actual device name.

Restore MBR from backup:

 
dd if=/root/mbr.back of=/dev/sda bs=512 count=1

The above command will restore the MBR from the previously taken backup.

Also, read more about Master Boot Record from Here

That’s it!

If you like this post and wish to receive more articles from us, please like our FB page: Grepitout

Your suggestions and feedbacks will encourage us and help to improve further, please feel free to write your comments.

For more details on our services, please drop us an E-mail at info@grepitout.com