If you're not against using a LiveCD, download a copy of Ubuntu, either burn it to a disc or to a USB, then boot the computer from the CD or USB.
Once booted into the environment, you may then plug in the USB drive. Find out which device it is that you want to fix the MBR of by running lsblk
. (Look here for more tips)
Install lilo (sudo apt-get install lilo
), and you can fix the MBR by running sudo lilo -M /dev/sdx mbr
. (sdx
here is the drive you found after running lsblk
above)
(Note, all of the commands are run from Terminal
in Linux.)
Earlier I could see my data through Linux and now I can see nothing
It's not a good idea to write new stuff on a drive before extracting what you can extract. Stop writing stuff on the drive and clone it first. To clone a drive to an image file you can use several utilities like dd
or those more advanced like dcfldd
or ddrescue
if the drive is physically damaged.
Here's an example, assuming the drive is /dev/sda
and you mounted a large external USB drive to /media/usb/
(adapt it to your needs):
sudo ddrescue /dev/sda /media/usb/backup.img /media/usb/backup.log
You can see the progress shown by the program while it is copying. You can interrupt it by pressing Ctrl+C and you can resume it later because you are saving a log file called backup.log
.
After that let's get back to recovery.
one of these two system partitions should be the original MBR
I don't understand what you are trying to say here. A MBR is a sector containing the partition table, it is not a partition nor a file system. What you want to do with TestDisk is to detect NTFS partitions and access them to copy the files.
Let me quote this answer of mine on Unix & Linux StackExchange:
The essential steps are:
- scanning the drive
- selecting the partition
- pressing P to show the files
- copying the files with C
In the last step you could just copy your account directory under Users
so you can sort it out later.
If TestDisk cannot browse the partitions, maybe because there is no NTFS signature on the PBR or the MFT is broken then you have a way bigger problem than simply a corrupted MBR.
In that case you might want to use the open source RecuperaBit as suggested in this answer.
Disclaimer: I am the developer of RecuperaBit.
Best Answer
If you have an image of the MBR of this machine and a way to push the image to it then I'm sure you could push it back to it but I normally just rebuilt the MBR or delete it and then rebuild it.
I typically ensure I have a full disk image already or at least all my data backed up from the drive which I need to push images to so you should backup your data beforehand as well.
Otherwise, if you're able to do a MBR delete and then rebuild, hop on over to the Fix the MBR – Guide for Windows XP, Vista, 7, 8, 8.1, 10 and follow the instruction for your OS accordingly.