I had a problem where my ubuntu installer would not recognize my windows partition, so i looked it up, and someone suggested 'zapping' GPT from my hdd with sudo gdisc /dev/sdb followed by x, z, y, n. (expert mode, zap gpt, yes to remove gpt, no to wipe MBR).

This, it was explained would fix my problem, but saying no to wiping MBR would mean my windows partition wasn't lost. Which then turned out not to be the case, so I'm not finding my OS anymore, and being a retard i didn't do any backups or anything like that. Is all hope lost for me? Or is there some way to restore the GP tables ?

I've never personally use the zap command in gdisc but it should be possible to rebuild your main gpt table using the backup gpt table stored at the end of disk but that's only if the command didn't also wipe the backup table.
–
FlintDec 16 '13 at 1:07

@Flint, zap gets rid of both copies, otherwise it wouldn't be very useful.
–
psusiDec 16 '13 at 2:09

If you also did not erase MBR and did convert all partitions to MBR, then you should be able to use gdisk to convert back to gpt. If you erased MBR also then testdisk may find old partitions. UEFI Windows only boots from gpt partitioned drives.
–
oldfredDec 16 '13 at 5:32

1 Answer
1

Your best bet is to run TestDisk on your system. It searches for filesystem information and can create fresh partition table entries for any filesystem(s) it finds. This is most likely to work easily if the disk hasn't been significantly repartitioned, though -- if you've repeatedly resized, moved, or created new partitions, leftover fragments of old partitions may confuse TestDisk. Even if you've done this, though, it's worth trying. I believe that TestDisk is available in the Ubuntu testdisk package, so you should be able to install and use it from an Ubuntu live CD.

Thanks, I did try this, and I believe it IS the best bet - unfortunately, I think I'd been trying too invasive stuff at that point, and ended up redoing the computer. Is flagging your comment as an accepted answer appropriate?
–
Kasper HJJan 12 '14 at 15:02