So yesterday I was installing a couple of distros in a new computer I got, when I was creating a Live USB through the command line with the DD command and I accidentally chose the incorrect device. (Pretty smart I know)
My hard drive is a WD Passport 4 TB which makes any recovery tool take quite some time to analyze.
I had 4 different partitions on this hard drive, 2 of them encrypted (I remember the password and all) a ext4 partition and a FAT32.
The only way that I know to recover files is using testdesk or photorec but they don't seem to be finding the encrypted part of the partition only the non encrypted one.
At the moment I'm trying to recover data with Gpart but it's been a few hours and nothing yet.
Anyone know an idea of how I could do this more efficiently ? (Recover the data from the encrypted partition)
Partition was encrypted with LUKS using the gnome disk utility.
Thank you everyone in advance.
If the partition you overwrote was encrypted with LUKS and you do not have a header backup of it somewhere, then the data is gone for good. Even knowing the password does not help in that case, since the actual data is encrypted with a master passphrase, and your password is only used to unlock that master passphrase. Actually, what you did is sometimes recommended to quickly and reliably wipe a LUKS partition.
If you do have a header backup, you could try copying that back to the beginning of the damaged partition. Since then you would probably still have overwritten the partition table of the filesystem of the encrypted partition, you could at that moment only try to run a recovery tool through the mapped / decrypted partition.
So in short: No header back -> data is lost.