From owner-freebsd-usb@FreeBSD.ORG Sat Nov 20 15:17:00 2010 Return-Path: Delivered-To: freebsd-usb@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 6D0BD106566C; Sat, 20 Nov 2010 15:17:00 +0000 (UTC) (envelope-from guru@unixarea.de) Received: from ms16-1.1blu.de (ms16-1.1blu.de [89.202.0.34]) by mx1.freebsd.org (Postfix) with ESMTP id CEB488FC08; Sat, 20 Nov 2010 15:16:59 +0000 (UTC) Received: from [93.104.73.12] (helo=current.Sisis.de) by ms16-1.1blu.de with esmtpsa (TLS-1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.69) (envelope-from ) id 1PJpBS-00075g-7D; Sat, 20 Nov 2010 16:16:58 +0100 Received: from current.Sisis.de (current [127.0.0.1]) by current.Sisis.de (8.14.3/8.14.3) with ESMTP id oAKFGuVK004043; Sat, 20 Nov 2010 16:16:56 +0100 (CET) (envelope-from guru@unixarea.de) Received: (from guru@localhost) by current.Sisis.de (8.14.3/8.14.3/Submit) id oAKFGtCB004042; Sat, 20 Nov 2010 16:16:55 +0100 (CET) (envelope-from guru@unixarea.de) X-Authentication-Warning: current.Sisis.de: guru set sender to guru@unixarea.de using -f Date: Sat, 20 Nov 2010 16:16:55 +0100 From: Matthias Apitz To: Alexander Motin Message-ID: <20101120151655.GA4010@current.Sisis.de> References: <201011191916.53655.hselasky@c2i.net> <4CE6C73A.4070208@FreeBSD.org> MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <4CE6C73A.4070208@FreeBSD.org> X-Operating-System: FreeBSD 8.0-CURRENT (i386) User-Agent: Mutt/1.5.19 (2009-01-05) X-Con-Id: 51246 X-Originating-IP: 93.104.73.12 Cc: freebsd-usb@freebsd.org Subject: Re: copying /dev/da0 with dd(1) to file: output differs X-BeenThere: freebsd-usb@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list Reply-To: Matthias Apitz List-Id: FreeBSD support for USB List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 20 Nov 2010 15:17:00 -0000 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 196971833 134 34 196971845 134 34 196971849 134 34 196971875 134 34 196971901 134 34 196971945 134 34 196971955 134 34 196972210 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: $ sed 's/ */ /g' diff | cut -d' ' -f2,3 | sort -u 0 10 0 104 0 110 0 200 0 204 0 214 0 220 0 234 0 260 0 4 10 0 100 0 110 0 134 0 134 14 134 34 134 4 14 0 200 260 204 234 204 4 214 234 220 260 304 204 34 0 4 0 4 104 4 234 44 0 44 4 (the numbers are in octal). What does this mean? Does not look like errors, in case of random error it whould be more caotic, or? matthias -- Matthias Apitz t +49-89-61308 351 - f +49-89-61308 399 - m +49-170-4527211 e - w http://www.unixarea.de/