[TriLUG] A question about using dd to restore a corrupt disk image

Maarten Lippmann m.w.lippmann at gmail.com
Thu Apr 12 19:09:41 EDT 2012


Hey All,

I'm forwarding this question from some completely random person
 who asked me below question over e-mail.
(due to some information on my website related to dd he e-mailed me,
seemed like e-mailing me was a hail Mary pass)

There are some impressive data recovery guru's on this list that may
be able to answer it.

Keep in mind that this involves encrypted data so his motivations may
not be kosher, I truly don't
know who this guy is, but his question looked interesting.

He has, on Mac OSX, a sparseimage archive with a corrupt header that
makes it un-openable. He mentioned it's an "old" style sparseimage with
the header information at the end, rather than the beginning of the
file. he has an older version of the image that is not corrupt. He's
tried to copy the old (good) header into the new (corrupt) file and
vice versa using
dd, but has not been able to get the syntax right.

He was wondering if there was any way of copying the contents of the
corrupt copy - everything _except_ the corrupt header into the working
copy or the
other way round.

Simple visualization:
Corrupt file:
data1_data2_data3_Corruptheader

Good older file:
data4_data5_data6_Goodheader

He asks:

What I'm wondering is if there a way to take "data1_data2_data3"
ignore the header, and shove it into the good file. It doesn't matter
if data4_data5_data6 get overwritten as long as the header stays
intact. If I understand it right, because the header of the good file
has the same password, the encryption should be the same, and I should
then be able to get into the good file with data1_data2_data3 inside
it.

Let me know if you have any ideas for him.

Maarten



More information about the TriLUG mailing list