When you are able to reboot Linux, you can save the MBR on your disk or disks if you use different disks for each OS:
As root, create a subdirectory to hold the MBRs on your Linux disk, and if this kind of thing happens in the future, you would be wise to either download and burn a Linux Live CD to fix the problem as I will show you how I did it in the past.
Let's assume you create, /root/MBRs as a subdirectory in your Linux root home account, and that you use different disks for Windows vs Linux - if you only have one, it will be obvious what to do as there will only be one MBR. That said, let's save some MBRs, after first identifying the two disks with MBRs. Note: if you only have one disk with both OSes, then do it anyway to identify the disk device name for the commands that follow:
# fdisk -l
assume it identifies /dev/sda and /dev/sdb (SATA drives) with Windows on /dev/sda and Linux on /dev/sdb, and that we are booted into the Linux OS.
To copy the MBR on the Linux disk and save it on the Linux disk:
# dd if=/dev/sdb of=/root/MBRs/sdbmbr bs=512 count=1
To copy the MBR on the Windows disk and save it on the Linux disk:
# dd if=/dev/sda of=/root/MBRs/sdambr bs=512 count=1
To restore the Windows MBR from the Linux OS (if you can boot from it and not Windows):
# dd if=/root/MBRs/sdambr of=/dev/sda bs=512 count=1
When using a Live CD environment (assuming 1GB RAM) it will build a faux filesystem in RAM for / and all of its normal subdirectories. Most likely the Windows disk which is the first in disk order (usually) is the MBR which has been trashed - but, how do you really tell?
Create a directory in which to save the current MBRs in the Live CD file system again as root:
Note: this is not on the Linux disk, but in RAM
# mkdir /root/MBRs
Now, Save the current (probably trashed) Window's MBR in /root/MBRs
# dd if=/dev/sda of=/root/MBRs/sdambr bs=512 count=1
Compare it with the already saved sdbmbr on the Linux disk:
# mkdir /mnt/sdb
# mount -t ext3 /dev/sdb /mnt/sdb
# diff /mnt/sdb/root/MBRs/sdambr /root/MBRs/sdambr
If they have no difference, you are ok there, however, if there is a difference you must replace the Windows MBR with it's original to get back the OS choice menu, as follows:
# dd if=/mnt/sdb/root/MBRs/sdambr of=/dev/sda bs=512 count=1
Most often it is the Windows MBR which becomes trashed, not the Linux MBR (if there is one).
Alternatively, it is advisable to save the MBRs off on another medium, like a floppy diskette or a CD if you have such device drives. Note, however, that floppy disk drives are usually less reliable than CD drives.
-- Tom