I cloned this drive about 6 months ago using dd. Today the partition tables got corrupted. What can I do to restore them using the old drive? I'm currently scanning for lost partitions using testdisk to see if it can fix it without bringing out the other one. It's just one partition, but it currently thinks it's EFI GPT or something. I don't know how to mark that it's ext4.
PLEASE BACK UP BEFORE YOU TRY THIS - I have not tried it, and it could make things worse.
To backup the MBR which contains the partition table (and is easy to do)
dd if=/dev/sourcedisk of=target.file bs=512 count=1
Similarly to restore
dd if=target file of=/dev/targetdisk bs=512 count=1
This will copy the first 512 bytes onto the new disk - which provides includes inter-alia the partition table.
bs=block size, so take the first 512 bytes. count=1 take 1 block only, ie the first one.
There is an interesting post here with more in depth and alternatives to be more selective of what you back up and restore.