1

I accidentally deleted the Partition table of my encrypted linux disk (ubuntu 22.04). I tried to recover the partition table with testdisk, but was unable boot into Linux after restarting the machine. So I tried to mount the encrypted drive using the method as described here while working from a livecd: Recover deleted LUKS partition

However, when I am trying to mount the LUKS partition I get the following error: Error as shown in terminal

I can see the LUKS partition in the disk manager, but I also get an error there when I am trying to mount the drive:

Thats how the partition looks in the disk manager Error in disk manager

The detailed outputs of the commands (as followed from the above link looked like this): Output of first command

I then chose the line: 0077bce0 4c 55 4b 53 ba be 00 53 4b 55 4c ba be 00 00 2c |LUKS...SKUL....,| as my start for the LUKS container leading to the following command

sudo losetup -o 0x0077bce0 -r -f /dev/sda followed by

losetup -a showing that loop11 is the one that needs to be mounted

So I tried to mount with: sudo cryptsetup luksOpen /dev/loop11 luksrecover and get the error: Unsupported LUKS version 83. Device /dev/loop11 is not a valid LUKS device.

Does somebody know how I can solve this and mount the disk? If so I would be very grateful about any help.

Kind regards Stefan

PS: I did use the encryption that came with the linux 22.04 installer. Then I was always asked for a password directly at bootup.

Stefan
  • 11
  • 2
  • You didn't find the correct place, but probably the content of a tool dealing with LUKS. Redo a search on the whole disk (or disk copy). For example with hexedit, (be sure to not be able to write with it) search for either 4c554b53babe0001 (LUKS v1) or 4c554b53babe0002 (LUKS v2) (probably this last). – A.B Apr 30 '23 at 20:08
  • For v2 there's also 534b554cbabe0002 (SKUL...) for the backup a bit after the normal. – A.B Apr 30 '23 at 20:22
  • 3
    See also: https://unix.stackexchange.com/questions/706070/restore-a-luks-partition-that-was-overwritten-by-pvcreate , https://unix.stackexchange.com/questions/741404/overwritten-luks-with-a-partition-table – A.B Apr 30 '23 at 22:43
  • You can create a small LUKS volume (same version!) on a different system in order to see what exactly you are looking for at that start of the volume. – Hauke Laging May 01 '23 at 03:54
  • 2
    Please [don't post pictures of text](https://unix.meta.stackexchange.com/q/4086/100397). They're hard to read and impossible to copy'n'paste the text content. – roaima May 01 '23 at 11:30
  • Do you have a backup of the LUKS header (an explicit backup or an implicit one i.e. as part of an image)? I use the same LUKS header on different volumes on different hosts so that I always have some "redundancy"... Maybe the LUKS header got (partially) damaged. Restoring it might solve your problem. – Hauke Laging May 02 '23 at 20:39

0 Answers0