[dm-crypt] unlock luks volume using valid keyslot

Milan Broz gmazyland at gmail.com
Tue Jun 28 12:11:05 CEST 2016

On 06/28/2016 07:47 AM, Oko Hid wrote:
> Dear dm-crypt members,
> Please teach me how to unlock the luks partition using valid keyslot.


> # Invalid offset 3012998038 in keyslot 4 (beyond data area offset 4096).
> LUKS keyslot 4 is invalid.

> The output message shows the addresses of keyslots, and
> of keyslot 4 may be invalid.
> (However, 0 seems ok ... I wish.)
> So, how can I do for this situation?
> Is it possible to access the partition and data using Keyslot 0 ?

Backup you header manually (just dd 4MB of the device).
dd if=<device> of=backupfile.img bs=1M count=4
(Do not skip this step, really :)

Then run "cryptsetup repair <device>". It should fix slot offsets
and you should be able to access it again.


More information about the dm-crypt mailing list