I just accidentally overwrote the LUKS metadata of my volume with a new LVM header. I have copy of the original LUKS header but can’t find it. Just in case, I made a dd image of the first 10MB of the now corrupt volume on a thumb drive.
My question is: is it still possible to recover the LUKS header? In particular, if I run ‘cryptsetup luksFormat’ with the same passphrase, key length, etc., will I see the old data? Is there any salting involved and can I specify the salt, too?
I guess if sizeof(lvm2 header) < position_of_salt_in_LUKS_header, I might be able to fix things. Could someone please point me to the relevant headers?
Did I totally bite it, or is there any slim chance…?
LUKS2 has a backup header, but LUKS1 (which you are probably using, as LUKS2 is quite new and few distros support it yet) does not. If you didn’t backup the header yourself, you are screwed. Go to your backups.
This work is licensed under a Creative Commons Attribution-ShareAlike 3.0 Unported License.