How to Repair a Damaged Partition Table or MBR

If all of a sudden your computer does not boot and you see messages like “operating system not found”, “missing operating system” or “invalid partition table”, you know there is something really wrong with the Master Boot Record (MBR). In this article I will describe how to fix it with a free and open source utility called TestDisk.

TestDisk is a powerful  data recovery utility, mainly designed to recover lost partition tables. It can run in various operating systems, including Windows, Linux, Apple, etc. and recover partitions from their filesystems as well. I have tried many other programs in the past with mixed results, however, none come close, not even the utilities that come with the Microsoft CD, like fixmbr or fixboot. If any program can find your lost partition, it will be TestDisk.


Finding your lost partition table

To find you lost partition table, do the following:

1) Download TestDisk and install it *** Don’t get scared because it is text based; it runs from inside Windows just like any other program. Same goes for all other operating systems; it is very easy to use.***

2) Start scan disk (if you are using Ubuntu Linux, make sure you start testdisk with the sudo command in front, otherwise it will not find your disks).

3) In the initial screen it will ask you whether you would like to create a log or not. This is useful when you want to send information to a data recovery specialist, otherwise it is unimportant; choose whatever you prefer. If you are using a Live CD like Ubuntu Rescue Remix, choose “No” since you can’t write to a CD anyways.

4) Choose the partition type. TestDisk usually autodetects what you have; then click [Proceed].

5) Next click on [Analize] to start looking for your partition table.

6) Next, TestDisk will give you a preliminary list of all the partitions it found on the drive; click [Quick Search].

7) Next TestDisk will let you choose what partition you want to explore, and at the bottom of the screen it displays the condition of its structure. This screen also has some tools. Press P to list your files and make sure TestDisk can list them correctly. If it does, this is s good sign they can be recovered as well. Click q (quit) go back to the previous screen and click enter to continue.

8 ) Once it finds  click on [Write] and you are done, you can exit the program.

You should be able to access your files now. If your partition is Windows based and you are unable to boot the computer you might need to set your partition as “active”. For this you have to use a Windows computer.

5 comments:

  1. Emile, 5. November 2011, 14:07

    It works fine upto rebooting.
    All is still the same, second paretition is still out of reach for XP.
    It shows everywere like in Partition magic etc., even in windows disk manager.
    But cannot access any file

     
  2. Jim, 31. August 2011, 17:35

    I have a drive out of a WD Netcenter, the program sees it but cannot find any partitions. It autodetected to EFI GPT (step 4 above). Any suggestions?

    From someone that worked on Univac and Westinghouse computers with “beer keg” looking storage drums, I love the don’t be scared comment above!

     
  3. Pablo Garcia, 20. July 2011, 20:45

    Hi Vicky:
    If TestDisk does not work, next programs to try are #1 Recuva #2 Photorec (it recovers anything, not just photos). They won’t fix your filesystem but at least you will be able to get your files back. Good Luck.

     
  4. Vicky, 20. July 2011, 20:36

    What do i do if testdisk cannot find my disk?

    I got the error “operating system not found” on my laptop. So i tried running a Linux cd but still couldnt mount the drive. I took the drive out and put it into an external enclosure. On my Windows 7 machine its not showing up in device manager, disk manager or testdisk and im not sure what to do next. Its a sata drive, around 2 years old. The drive sounds normal, there is no clicking and it sounds like its spinning.

     
  5. iloveopensource, 17. March 2011, 6:14

    thanks for this, it saved me when nothing else would work.
    I have a 1TB WD drive which would not show files i think i messed the MBR/PARTITION table
    by removing it from an older version of XP which did not have quick removal supported.
    removed the drive and put it into the sata port on my tower pc and used this and it fixed it

     

Write a comment:


You will receive an email when your comment is answered


seven × 4 =

.