Backing up the MBR Revision as of Wednesday, 26 June 2024 at 10:57 UTC

Quite simple, really. Use the ancient and powerful dd to do this!

Backing up

dd if=/dev/sda of=~/mbr.backup bs=512 count=1

Restoring

dd if=/path/to/media/mbr.backup of=/dev/sda bs=512 count=1

Notes

The 512 byte sector is composed of three parts:

When restoring, these numbers become important. If restoring to a
partition of the exact size, use bs=512 for backup and restore.
Else, you have to use bs=446. This is vitally important.