Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 19 Nov 2010 20:51:38 +0200
From:      Alexander Motin <mav@FreeBSD.org>
To:        Matthias Apitz <guru@unixarea.de>, freebsd-usb@freebsd.org
Subject:   Re: copying /dev/da0 with dd(1) to file: output differs
Message-ID:  <4CE6C73A.4070208@FreeBSD.org>
In-Reply-To: <mailpost.1290191957.493865.17097.mailing.freebsd.usb@FreeBSD.cs.nctu.edu.tw>
References:  <201011191916.53655.hselasky@c2i.net> <mailpost.1290191957.493865.17097.mailing.freebsd.usb@FreeBSD.cs.nctu.edu.tw>

next in thread | previous in thread | raw e-mail | index | archive | help
On 19.11.2010 20:39, Matthias Apitz wrote:
> El día Friday, November 19, 2010 a las 07:16:53PM +0100, Hans Petter Selasky escribió:
>
>>> I was thinking in a tool just reading each file block by block,
>>> comparing the blocks and noting the 1st diff with block offset number.
>>> (some 10 lines of C code :-))
>>>
>>> 	matthias
>>
>> Maybe you need to write a small C-program to do that.
>>
>> You can use bcmp() to compare two buffers.
>
> Will do that tomorrow.
>
> Just an idea: The USB key in question was new and I only created the
> file system on it the usual way (fdisk, bsdlabel, newfs). Then I
> restored the dump on it (which took 26 hours for 3.1 GByte dump file).
> The USB key boots fine, btw.
>
> 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.

-- 
Alexander Motin



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?4CE6C73A.4070208>