I have a GPT partitioned HDD which isn't recoqnized by windows. The disk management shows the entire disk as unallocated.

I am 100% sure that the partitions and their file systems are undamaged.

TestDisk shows me this:

enter image description here

It finds the 128MB reserved space and the 2nd partition (it doesnt have a standard file system, thats why it shows "Basic data partition")

is there any tool (Windows or Linux) that i can use to repair the GPT so that windows recoqnizes it again?


Solution 1:

Ramhound is confusing you. There's no partition to fix, here. It is the partition table that needs fixing.

Your master copy of the EFI partition table, stored in blocks #1 et seq. of your disc has, as the utility says, an invalid signature. The utility is therefore using the backup copy of the EFI partition table, that is (for optimal results) stored at the end of the disc, in its highest-numbered blocks.

The utility is reporting that the backup copy has two entries. One has the type "Microsoft Reserved" and the other has the type "Basic data". Neither of these mean "does not have a standard filesystem". Partition types don't imply filesystem types. (They control visibility to operating systems.) As the utility is telling you, the signatures that do imply filesystem types, variously stored in "superblock"s and "BIOS Parameter Blocks" within the partitions, are missing from both of those partitions.

For repairing:

  • The gpart command in FreeBSD has a recover subcommand that can copy the backup copy over to the main copy (or vice versa).
  • TestDisk can build an EFI partition table from scratch, using information such as in the screenshot, and rewrite it to disc.
  • gdisk, as mentioned in Milind R's answer, can repair the case of a corrupted main copy and a valid backup copy, as here.

Further reading

  • gpart(8). FreeBSD manual pages.
  • Rod Smith (2011-06-26). Repairing GPT discs. Rod's Books.
  • Jonathan de Boyne Pollard (2006). How to determine the filesystem type of a volume. Frequently Given Answers.

Solution 2:

Use gdisk. It's rigorous and thorough about all the integrity checks. Allow it to detect bad GPT, and let it fix it. That might just do the job.