This is for :

Lost partitions, partition error, corrupt partitions, no operating system found and many other errors related to partition table.

TestDisk is powerful free data recovery software! It was primarily designed to help recover lost partitions and/or make non-booting disks bootable again when these symptoms are caused by faulty software, certain types of viruses or human error (such as accidentally deleting a Partition Table). Partition table recovery using TestDisk is really easy.

TestDisk can
  • Fix partition table, recover deleted partition
  • Recover FAT32 boot sector from its backup
  • Rebuild FAT12/FAT16/FAT32 boot sector
  • Fix FAT tables
  • Rebuild NTFS boot sector
  • Recover NTFS boot sector from its backup
  • Fix MFT using MFT mirror
  • Locate ext2/ext3/ext4 Backup SuperBlock
  • Undelete files from FAT, exFAT, NTFS and ext2 filesystem
  • Copy files from deleted FAT, exFAT, NTFS and ext2/ext3/ext4 partitions.
TestDisk has features for both novices and experts. For those who know little or nothing about data recovery techniques, TestDisk can be used to collect detailed information about a non-booting drive which can then be sent to a tech for further analysis. Those more familiar with such procedures should find TestDisk a handy tool in performing onsite recovery.

How to use TestDisk:

1. Download TestDisk specific to your OS.

2. TestDisk runs only on terminal with full screen mode.
3. Run terminal as super user in Linux/mac and as Administrator in Windows.
4.Navigate to the appropirate folder and run the test disk,
(Appropirate folders- Mac-darwin, Windows-DOS, Linux-linux).

5. Run the test disk- ./testdisk (in windows testdisk.exe). 
6.Select your Hard disk which needs the fix, Select Proceed.

7.Select the partitiotypen table 
(mostly intel for PC/Hackintosh/Linux,for Macintosh select Mac).

8.Select Analyse to read partition table

(or to write new MBR select MBR Code).

9.Select Quick search,If you want to search for Vista partitions select yes.

10.If the shown partition table is correct

(if wrong then jump to step 11) then use the right-left direction keys to mark the partition as P-primary, L-Logical, D- deleted. Proceed by giving the return key.

11. If the shown partition table is wrong then hit return and select deeper search and follow the step 10.

12.Select write and hit return key to write the partition table.

13. Select quit and reboot the PC for the changes to take place.

Using Test Disk we can fix a wide range of Hard disk problems, use the other features of test disk when the necessity arises.