I have created a LUKS encrypted pen drive with the gnome-disks tool, but a time ago I have accidentally formatted the disk, losing the partition.
I tried to recuperate the partition stored on sda1 with:
$ sudo hexdump -C /dev/sda1 | grep LUKS
the command returned it:
90aa9ee0 4c 55 4b 53 f3 9b 59 86 5c 21 d4 80 34 40 19 19 |LUKS..Y.\!..4@..|
1301d5940 00 63 72 79 70 74 6f 5f 4c 55 4b 53 00 44 45 56 |.crypto_LUKS.DEV|
19b9a7940 00 63 72 79 70 74 6f 5f 4c 55 4b 53 00 44 45 56 |.crypto_LUKS.DEV|
Then I tried to mount the partition with:
$ losetup -a | grep sda1
/dev/loop14: []: (/dev/sda1), position 2427100896
$ sudo cryptsetup luksOpen /dev/loop14 luksrecover
The device /dev/loop14 it is not a valid LUKS device.
As showed, it's saying that the device mounted can't be recognized and decrypted as a LUKS device. Thus, the question is: If it's possible,how can I repair the deleted partition and get my data back?
/dev/sda1
directly? Have you tried acryptsetup luksDump
on the device to see if the header is intact?