Contents[Hide]

Here are some usefull hints on how to Backup Restore Destroy and Install MBR on linux. If the need comes to backup, restore and destroy your MBR you can use a dd command to do that job. First we need to find find our storage device to backup MBR. To do that use a command:

fdisk -l 

Let's assume that the storage device we want to work with is /dev/hdb.

WARNING: DO NOT COPY AND PASTE COMMANDS FROM THIS PAGE UNLESS YOUR DEVICE IS ALSO /dev/sdb !!

1. BACKUP MBR

To backup Master Boot Record ( MBR ):

# dd if=/dev/sdb of=my.mbr bs=466 count=1

where my.mbr is a file where we would like to store our MBR backup.

2. RESTORE MBR

To restore a MBR we need to just switch the order of input and output files.

# dd if=my.mbr of=/dev/sdb bs=466 count=1

3. DESTROY MBR

If you from any reason want to destroy your MBR us as a input file /dev/zero:

# dd if=/dev/zero of=/dev/sdb bs=466 count=1

4. INSTALL MBR

Installing MBR can be very useful especially when creating linux USB boot sticks. To install MBR from scratch we can use install-mbr command found in mbr package:

# install-mbr /dev/sdb

Free Linux eBooks

Do you have the right skills?

Our IT Skills Watch page reflects an up to date IT skills demand leaning towards the Linux and Unix environment. We have considered a number of skills and operating systems.

See the result...

Linux Online Training

Learn to run Linux servers and prepare for LPI certification with Linux Academy. 104 available video lessons with PDF course notes with your own server!

Go to top