copying /dev/da0 with dd(1) to file: output differs

perryh at pluto.rain.com perryh at pluto.rain.com
Sun Nov 21 00:24:35 UTC 2010


Matthias Apitz <guru at unixarea.de> wrote:
> El d?a Friday, November 19, 2010 a las 08:51:38PM +0200,
> Alexander Motin escribi?:
> > > Could it be that unwritten/unformatted blocks are read as
> > > random data from that USB key? Should I overwrite the full
> > > USB key from /dev/zero?
> > 
> > It is allowed behavior for SATA SSDs with TRIM command support.
> > Deleted blocks can be not guarantied to return any predictable
> > or even repeatable value. May be this logic could be extended to
> > USB devices.
>
> A cmp(1) with -l gives a file like this:
>
> $ head -10 diff
> 196971771 134  34
> 196971797 134  34
...
> of 2385059 lines, i.e. of 2385059 bytes which differ in the 3.8
> GByte copy; there are only a few patterns of diffs which are
> repeating:
...
> What does this mean? Does not look like errors, in case of random
> error it whould be more caotic, or?

Good question.

To help sort out whether it matters, what happens if you read the
stick using dump(8) instead of dd (or mount it read-only and read it
with tar)?  Either of those methods will read only the parts that
are in use.


More information about the freebsd-usb mailing list