This will put the contents of the Master Boot Record of /dev/hda in a file /hda-mbr.dd.
Code:
dd if=/dev/hda of=/hda-mbr.dd bs=512 count=1 conv=notrunc,noerror
This will restore it.
Code:
dd if=/hda-mbr.dd of=/dev/hda bs=512 count=1 conv=notrunc,noerror
I always perform this MBR backup before I use tar to back up the root partition.