Skip to contentSkip to conversation

yet another header reconstruction question

dm-crypt Florian Dotzer 2 participants 2 messages Feb 24, 2016 1 message not in the archive

lore
Share & tools
lore

A message that is not in the archive (sent off-list or not yet received): [email protected]

#1 lore raw

Quoted 9 lines · Florian Dotzer
Quoted 4 lines

I tried dd on files to replace the first 512 bytes of a file , but the target file was completely replaced with this command :

dd if=512_bytes_with_fixed_header of=file_with_first_64_MB_of_md0 bs=512 count=1

When the target is a file, you need to include "conv=notrunc" so that the file will not be truncated to zero length when it is opened. That is not an issue when the target is a block device, but there is no harm in using "conv=notrunc" there, too.

Thanks to Bob , Arno , Sven and all others. I was able to remount with the corrected LUKS Header .

Now I have a backup of the header and a backup of the key.

currently I am backing up all data

Please enjoy a virtual drink of your choice ;-))

Sorry lsblk command was not available so I cannot report any output of that.

best wishes to all , Florian

#2 lore raw

Excellent. Also, thank you for the feedback!

Regards,
Arno

Quoted 30 lines · Florian Dotzer

Quoted 9 lines · Florian Dotzer
Quoted 4 lines

I tried dd on files to replace the first 512 bytes of a file , but the target file was completely replaced with this command :

dd if=512_bytes_with_fixed_header of=file_with_first_64_MB_of_md0 bs=512 count=1

When the target is a file, you need to include "conv=notrunc" so that the file will not be truncated to zero length when it is opened. That is not an issue when the target is a block device, but there is no harm in using "conv=notrunc" there, too.

Thanks to Bob , Arno , Sven and all others. I was able to remount with the corrected LUKS Header .

Now I have a backup of the header and a backup of the key.

currently I am backing up all data

Please enjoy a virtual drink of your choice ;-))

Sorry lsblk command was not available so I cannot report any output of that.

best wishes to all , Florian
_______________________________________________
dm-crypt mailing list
[email protected]
http://www.saout.de/mailman/listinfo/dm-crypt

Signature · 7 lines
Arno Wagner,     Dr. sc. techn., Dipl. Inform.,    Email: [email protected]
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