Re: dd / netcat / md5sums: hashes do not match

From: Casper H.S. Dik (Casper.Dik_at_Sun.COM)
Date: 09/20/03

  • Next message: Casper H.S. ***: "Re: dd / netcat / md5sums: hashes do not match"
    Date: 20 Sep 2003 10:49:59 GMT
    
    

    bugs@pu.net (Mark Hittinger) writes:

    >Casper H.S. *** <Casper.***@Sun.COM> writes:
    >>>B# nc -l -p 6789 | dd of=./hda1.img bs=512 conv=noerror,sync
    >>>A# dd if=/dev/hda1 bs=512 conv=noerror,sync | nc <B's IP> 6789

    >>I wouldn't use "sync" because sync causes blocks to be
    >>padded with NULLs; this is certain to corrupt
    >>the file.

    >If his hard drive has a bad spot you need sync to fill the bad read with
    >nulls. If you don't do this then the blocks on the output side will be
    >mis-aligned after the bad spot.

    But you should *NEVER* use sync on pipes; the above usage is just wrong
    (that is, the writing with "sync" is wrong as you read from a pipe; reading
    the "disk" with sync is fine)

    >Now that we know he's doing this on a live file system I guess the mystery
    >is solved.

    Indeed. He should just run fsck afterwards.

    Casper


  • Next message: Casper H.S. ***: "Re: dd / netcat / md5sums: hashes do not match"
  • Quantcast