[dm-crypt] Recovery of LUKS partition

Arno Wagner arno at wagner.name
Wed Jan 7 13:07:21 CET 2015

Well, lets see:
1. Make a backup of the header
2. Make a binary backup of the whole disk
3. And now it gets tricky (hence 1.. and 2.):
   Delete sdb2 and enough partitions after it to 
   have enough space for the original size of it.
4. Create a new partition with exactly the same start as 
   sdb2 with enough space.

If all went well, you should have your original LUKS container
back, possibly with one or more partition-table sized holes 
somewhere in there.


On Wed, Jan 07, 2015 at 06:18:04 CET, Thomas Ziminski wrote:
> I accidentally partitioned my hard drive through the gnome-disk-utility
> with the options of "Don't overwrite existing data" and a GPT partition
> table. I have found the LUKS partition with TestDisk, but unfortunately it
> is only a measly 2.1MB, which is really only the header.
> Using hexdump on the partition, I have confirmed that the header is still
> there and fully intact.
> When I use:
> cryptsetup luksOpen
> It returns the error:
> Command failed with code 22: Requested offset is beyond real size of device
> /dev/sdb2.
> I am unsure of how to proceed and have been scouring the internet for help
> but to no avail, any guidance or help would be greatly appreciated.
> Thanks

> _______________________________________________
> dm-crypt mailing list
> dm-crypt at saout.de
> http://www.saout.de/mailman/listinfo/dm-crypt

Arno Wagner,     Dr. sc. techn., Dipl. Inform.,    Email: arno at wagner.name
GnuPG: ID: CB5D9718  FP: 12D6 C03B 1B30 33BB 13CF  B774 E35C 5FA1 CB5D 9718
A good decision is based on knowledge and not on numbers. -- Plato

If it's in the news, don't worry about it.  The very definition of 
"news" is "something that hardly ever happens." -- Bruce Schneier

More information about the dm-crypt mailing list