1 (edited by stanislavskiy 2016-12-25 17:50:53)

Topic: [Solved] Restore cleared GPT table

Hello. Can you help? I accidentally cleared all gpt table and restored only one partition via testdisk (efi). Can't restore others. But i found a file from Windows that contains this information (it is correct):
Name (type)       Size       Start
EFi (fat32)       200Mb      1024Kb
Windows reserved  16Mb       201Mb
Windows (ntfs)    82Gb       217Mb
Linux swap        3906Mb     83Gb
Linux (ext4)      10Gb       87Gb
Mac (hfs+)        97Gb       97Gb
Mac reserved      620Mb      195Gb
Files (exFat)     269Gb      196Gb

Can i restore the others partitions? I really need only one named Files - the last one. This partition contains all my data. How i can restore it?

I now how to use Gparted but i'm not sure i can just enter this values on volume one after another and everything will be fine.


Re: [Solved] Restore cleared GPT table

Already fixed with Mike's help.


Re: [Solved] Restore cleared GPT table

To help others finding this solved post, the advice in IRC was:

mfleetwo wrote:

It depends on what you did to clear the GPT as to whether the data is
recoverable.  Assumptions: (1) you only used a tool to delete the
partition definitions and not otherwise overwrite any file system data,
(2) your disk used whole MiB aligned partitions.  Then try this:

1) Find the exact start of the "File (exFat)" partition

   hexdump -C /dev/sda | fgrep 'EXFAT   '     (3 spaces after EXFAT)
   Where /dev/sda is your hard drive.  Will take a *LONG* time (hours)
   as this will read your whole hard drive looking for the magic at the
   start of the exfat file system.  Output will look like this
    # hexdump -C /dev/sdb | fgrep 'EXFAT   '
    50000000  eb 76 90 45 58 46 41 54  20 20 20 00 00 00 00 00  |.v.EXFAT   .....|
    50001800  eb 76 90 45 58 46 41 54  20 20 20 00 00 00 00 00  |.v.EXFAT   .....|
   The "50000000" is the start of the exFat file system, but in HEX.
   Divide by 1 MiB (100000 in HEX below) and convert to DEC.
   My test exFat partition was 1280 MiB from the start of the drive.
   Your figure should be close to 200704 (196*1024).

2) Recreate partition for "File (exFat)"

   *ENSURE* that you use "Unformatted" file system in GParted as that
   only writes partition boundaries into the partition table and does
   not overwrite anything else on the drive.  Create the partition
   starting at the above found MiB figure to the end of the drive.