1

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?

2
  • 2
    Can you tag the question with your Ubuntu version?
    – moo
    Commented Mar 23 at 16:33
  • Why are you mounting the device as a loop device first instead of trying to open /dev/sda1 directly? Have you tried a cryptsetup luksDump on the device to see if the header is intact?
    – Sebastian
    Commented May 2 at 8:32

0

You must log in to answer this question.

Browse other questions tagged .