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:
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 !!
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.
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
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
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