Re: rescue corrupted luks header?

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Arno Wagner wrote:
>> Ok, revised: Look at offset 104 in the header. It lists
>> where the bulk data starts (in sectors). Backup everything 
>> before.

Keyslot is not fixed size, I think it depends on cipher key length.

Anyway, backup of header is easy, there is unecrypted header
(always of the 592 bytes IIRC) and keyslot area,
starting at 4k offset).

run "crytpsetup luksDump <device>", 
remeber the "Payload offset" (in sectors).

then backup header with
dd if=<device> of=<backup_file> bs=512 count=NUM

where NUM is the payload offset above.

(note that anyone with this backup and knowledge
of any passphrase in backup header can decrypt data with
this, even if you change passphrase later on real disk.)

Restore - simple dd it backwards.

I think that this should work always, header and all
keyslots area should be there but not more.
(Restoring more data than LUKS header length can
rewrite filesystem data with some old content.)

Milan
--
mbroz@xxxxxxxxxx

---------------------------------------------------------------------
dm-crypt mailing list - http://www.saout.de/misc/dm-crypt/
To unsubscribe, e-mail: dm-crypt-unsubscribe@xxxxxxxx
For additional commands, e-mail: dm-crypt-help@xxxxxxxx


[Index of Archives]     [Device Mapper Devel]     [Fedora Desktop]     [ATA RAID]     [Fedora Marketing]     [Fedora Packaging]     [Fedora SELinux]     [Yosemite News]     [KDE Users]     [Fedora Tools]     [Fedora Docs]

  Powered by Linux