Originally Posted by business_kid
When you get it up & running, do the following to put backups in /boot
dd if=/dev/sda of=/boot/sdambr bs=512 count=1
dd if=/dev/sda1 of=/boot/sda1mbr bs=512 count=1
Then when windows overwrites, just boot anything unix and copy them back.
WARNING: that's assuming alot. First of all, the GRUB code is about 29KB for GRUB2 (smaller for GRUB-legacy). Never fits into 512 bytes. Although, it might be enough if the "destroyer" was Windows which puts more bootloader stuff into the system partition, i.e., it might have overwritten only 512 bytes indeed. *Might have*. A bit more uncommon on Linux installations because you usually install GRUB to sda, not sda1.
Second, tell the OP that you assume that "sda1" is what you believe to be his/her root partition, or more precisely, what the OP has originally specified to write to using "grub-install".
And eventually, this MBR backup stuff isn't explained in one sentence. It is a low-level operation which needs some knowledge in the first place. What if "sda1" is not marked bootable and already starts with the partition superblock in that very first sector, but then, that sector has changed over the last months and then you come and restore an old sector copy the hardcore way? Oha.
There is no real problem using this DD/MBR stuff - as long as you *exactly* know what you're doing. Giving such kind of advice to someone who asks, especially with a one-liner ala "do this and be happy" is dangerous.. no offense..