How to backup your MBR

There's not much fun in having to restore your MBR and findiong you can only do this by using the windows mbr recovery console or using the grub installer, an easier way is to make a backup of your mbr now so this does not happen to you. It's easy to do and takes less than a minute to backup and save off somewhere, I like to send it to my gspace account via email but everyone has there own way.

MBR backup

To backup your mbr you need to copy only the first few bytes containing the MBR and the partition table from your bootable disk, check which disk your PC boots from if you have more than 1.

dd if=/dev/sdx of=/path/to/image count=1 bs=512

MBR restore

to restore ensure you only set the dd "count=1 bs=446" to exclude the partition table from being written to disk.Unless you really want to, if it is identicle it won't be an issue.

dd if=/path/to/image of=/dev/sdx