When it comes to protecting data on our hard drives, most of us do some sort of regular back up. What usually gets backed up? Perhaps, the important data on your disks that you can't afford to lose. That is a good starting point, but it is NOT enough. Besides the data itself, do you back up your primary partition table?
The partition table is located in the disk's very first sector, known as the Master Boot Record or MBR. The entries in the partition table specify (among other things) the starting and ending CHS (cylinder, head, sector) of the partition.
The MBR has a total length of 512 bytes. Within the MBR, the partition table consists of 4 entries of 16 bytes each, with a sum of 64 bytes.
Why is the partition table important enough to backup? If your MBR has a damaged partition table, your Windows system may not boot.
Believe me this: partition tables do get clobbered (seemingly more often if you run Windows according to my own experience). When it happens, you can try repairing it or simply restore it from a backup copy if you happen to take heed of my advice here.
To repair the partition table, you need to know its original configuration. If you are caught without a backup of your MBR, you can try using a program called gpart (available on Linux) to "guess" the proper configuration of the partition table.
You wish you had backed it up. I will explain how that is done below.
The Linux command to use is dd which basically makes disk images. If your system runs Windows , you can get a Linux Live CD (ubuntu, Knoppix are good choices) in order to run the exact same commands as below but save it to a floppy drive.
The command to save the MBR (including the partition table) is:
dd if=/dev/hda of=/some/location bs=512 count=1
Note: Substitute /dev/hda with the particular hard drive in your case. Also substitute /some/location to where you want to store the back up. The total size is 512 bytes, so it fits on a floppy disk.
To restore MBR:
dd if=/some/location of=/dev/hda bs=512 count=1
To restore primary partition table only (without overwriting entire MBR):
dd if=/some/location of=/dev/hda bs=1 count=64 skip=446 seek=446
It happens to all of us ... eventually. So, back it up before the next disaster strikes.