Page 1 of 1

GPT Overwritten

Posted: 17 Apr 2023, 20:52
by Glassmenagerie
I accidentally over wrote my GPT using DD. My 1TB HD (/dev/sda) was showing signs of failure so I bought a 500G Samsung thinking I could clone the larger HD to the smaller SSD (/dev/sdb). Well, I mixed up the commands in an attempt to copy the HD GPT table over to the SSD. You can imagine the result. Basically a blank GPT on my HD.

I did an analysis using testdisk. Everything seems okay except for the Windows 10 reserve partition, sda2.

I didn't create a backup. Is there a way to get the GPT back?

Regards,
RDL

Re: GPT Overwritten

Posted: 19 Apr 2023, 06:48
by cgrenier
If you run TestDisk, Analyze, Quick Search (and maybe Deeper Search) and get the correct partitions, choose Write, confirm, Quit.
But honestly I don't see how after overwriting half your disk, you will be able to recover your data.
You may be able to recover your data only if the cloning failed and few data have been overwritten.

If too much data have been overwritten for TestDisk to recover your partition, it still possible to use PhotoRec to recover data but
recovered files will not have their original filenames.

Re: GPT Overwritten

Posted: 19 Apr 2023, 19:10
by Glassmenagerie
Mr Grenier,

Thanks for responding! I used this command: sgdisk /dev/sdb -R /dev/sda

I intended to copy GPT of the failing disc, sda, to the new disc, sdb. Just the GPT. As you see above, I got them mixed up. This command copies just the GPT isn't that correct?

Regards,
RDL

Re: GPT Overwritten

Posted: 19 Apr 2023, 19:29
by Glassmenagerie
Would that copy command above also overwrite the secondary GPT at the end of the disc?

RDL

Re: GPT Overwritten

Posted: 20 Apr 2023, 10:26
by cgrenier
Yes, sgdisk has overwritten both the main GPT table and its backup.
As only the GPT tables has been overwritten, TestDisk 7.2-WIP should be able to rewrite a valid partition table.

Re: GPT Overwritten

Posted: 20 Apr 2023, 16:35
by Glassmenagerie
Great! I'll give it a try then.

RDL