I've seen two pages explaining how to backup & restore the MBR:

They've shown an example with restoring only the partition table (64 bytes):

dd if= sda-mbr.bin of=/dev/sdX bs=1 count=64 skip=446 seek=446

And an example with restoring the entire MBR (512 bytes):

dd if=backup-sda.mbr of=/dev/sda

What's the reason one wouldn't want to restore the boot code (the first 446 bytes)?

  • Hypothesis 1: Disks are mounted in a different way, the boot code stops being valid. Hypothesis 2: There is already a boot code and someone doesn't want to override the code that already exists. – Doktoro Reichard Nov 16 '13 at 22:44
  • @DoktoroReichard: Ain't restoring the entire 512 bytes be the most common scenario? – Dor Nov 16 '13 at 22:50
  • I actually don't know, because I never did it, although I find the question interesting. – Doktoro Reichard Nov 16 '13 at 22:52

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.