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

Joseph Mack NA3T jmack at wm7d.net
Thu Apr 12 20:50:18 EDT 2012


On Thu, 12 Apr 2012, Maarten Lippmann wrote:

> Simple visualization:
> Corrupt file:
> data1_data2_data3_Corruptheader
>
> Good older file:
> data4_data5_data6_Goodheader

is this what you're after?

tpx60:/src/temp# cat AB
AAAAAAAAAAAAAAAABBBBBBBBBBBBBBBB
tpx60:/src/temp# cat CD
CCCCCCCCCCCCCCCCDDDDDDDDDDDDDDDD

tpx60:/src/temp# dd ibs=1 obs=1 if=AB count=16 of=A
16+0 records in
16+0 records out
16 bytes (16 B) copied, 0.000182498 s, 87.7 kB/s
tpx60:/src/temp# cat A
AAAAAAAAAAAAAAAAtpx60:/src/temp#

tpx60:/src/temp# dd ibs=1 obs=1 if=CD skip=16 of=D
17+0 records in
17+0 records out
17 bytes (17 B) copied, 0.000125437 s, 136 kB/s
tpx60:/src/temp# cat D
DDDDDDDDDDDDDDDD

tpx60:/src/temp# cat A > AD
tpx60:/src/temp# cat D >> AD
tpx60:/src/temp# cat AD
AAAAAAAAAAAAAAAADDDDDDDDDDDDDDDD

Joe

-- 
Joseph Mack NA3T EME(B,D), FM05lw North Carolina
jmack (at) wm7d (dot) net - azimuthal equidistant map
generator at http://www.wm7d.net/azproj.shtml
Homepage http://www.austintek.com/ It's GNU/Linux!



More information about the TriLUG mailing list