From owner-freebsd-scsi@FreeBSD.ORG Wed Apr 26 19:58:44 2006 Return-Path: X-Original-To: freebsd-scsi@freebsd.org Delivered-To: freebsd-scsi@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id DB7D616A400 for ; Wed, 26 Apr 2006 19:58:44 +0000 (UTC) (envelope-from jhs@flat.berklix.net) Received: from thin.berklix.org (thin.berklix.org [194.246.123.68]) by mx1.FreeBSD.org (Postfix) with ESMTP id 12BD243D45 for ; Wed, 26 Apr 2006 19:58:43 +0000 (GMT) (envelope-from jhs@flat.berklix.net) Received: from js.berklix.net (p549A6615.dip.t-dialin.net [84.154.102.21]) (authenticated bits=128) by thin.berklix.org (8.12.11/8.12.11) with ESMTP id k3QJweEo081990 for ; Wed, 26 Apr 2006 21:58:41 +0200 (CEST) (envelope-from jhs@flat.berklix.net) Received: from fire.jhs.private (fire.jhs.private [192.168.91.41]) by js.berklix.net (8.12.11/8.12.11) with ESMTP id k3QJwd5e072617 for ; Wed, 26 Apr 2006 21:58:40 +0200 (CEST) (envelope-from jhs@flat.berklix.net) Received: from fire.jhs.private (localhost.jhs.private [127.0.0.1]) by fire.jhs.private (8.13.1/8.13.1) with ESMTP id k3QJxuO0072830 for ; Wed, 26 Apr 2006 21:59:56 +0200 (CEST) (envelope-from jhs@fire.jhs.private) Message-Id: <200604261959.k3QJxuO0072830@fire.jhs.private> To: freebsd-scsi@freebsd.org In-Reply-To: Message from Oliver Fromme of "Mon, 24 Apr 2006 15:02:38 +0200." <200604241302.k3OD2c6k029841@lurza.secnetix.de> Date: Wed, 26 Apr 2006 21:59:56 +0200 From: "Julian H. Stacey" Subject: Re: USB Ram Stick X-BeenThere: freebsd-scsi@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SCSI subsystem List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 26 Apr 2006 19:58:44 -0000 Oliver Fromme wrote: > Julian H. Stacey wrote: > > Hi Oliver, cc list. > > There's no need to send me a copy, I'm reading the list. > I would prefer that you simply reply back to the list. > Thanks. OK. I like a copy - so many threads & lists to skim. > > Oliver Fromme wrote: > > > Julian Stacey wrote: > > > > I wrote the image back to my identical stick (with dd), it wouldn't continue > > > > writing after a while, (cant remember exact message). > > > > > > The exact message would be very useful to know. > > > > Lost, I was travelling at the time; either I saved it & then lost > > it after travel, or it was unsaved as boringly common, eg as in a > > message I just got: > > dd: /dev/da0: Input/output error > > Hmm ... yes, most likely it was an "Input/output error", too. > > > I've sized several sticks of mine now you mention this, & they all > > come up short of nominal capacity. (I'd wrongly expected a more > > conservative architecture, with extra blocks to be patched in as > > needed to retain nominal capacity). > > Extra blocks cost extra money, I guess. :-) > > Given that prices have fallen considerably, the market on > USB memory sticks is probably pretty tough, like the DRAM > market. Yes. > > > Did you try to clean it before? i.e. > > > dd if=/dev/zero of=/dev/da0 count=100 > > > (See the example in the bsdlabel(8) manpage.) > > > > Yes, pretty sure I did, but did it again: > > dd: /dev/da0: Input/output error > > 1+0 records in 0+0 records out 0 bytes transferred > > same for dd if=/dev/zero of=/dev/da0 count=1 > > Not good. Looks like a low-level problem (you also get a > bunch of kernel error messages, I assume). Yes, on insertion: kernel: umass0: Generic Flash Disk, rev 2.00/1.00, addr 3 kernel: da0 at umass-sim0 bus 0 target 0 lun 0 kernel: da0: Removable Direct Access SCSI-2 device kernel: da0: 1.000MB/s transfers kernel: da0: 2038MB (4173824 512 byte sectors: 255H 63S/T 259C) ( BTW 2136997888 = 4173824 x 512, & source stick I copied from was 2138177536 so your guess of slightly smaller target stick correct). Then 4 of: { Then 4 of: { kernel: (da0:umass-sim0:0:0:0): READ(10). CDB: 28 0 0 0 0 1 0 0 1 0 kernel: (da0:umass-sim0:0:0:0): CAM Status: SCSI Status Error kernel: (da0:umass-sim0:0:0:0): SCSI Status: Check Condition kernel: (da0:umass-sim0:0:0:0): MEDIUM ERROR asc:30,2 kernel: (da0:umass-sim0:0:0:0): Cannot read medium - incompatible format kernel: (da0:umass-sim0:0:0:0): Retrying Command (per Sense Data) } Then 1 of { kernel: (da0:umass-sim0:0:0:0): READ(10). CDB: 28 0 0 0 0 1 0 0 1 0 kernel: (da0:umass-sim0:0:0:0): CAM Status: SCSI Status Error kernel: (da0:umass-sim0:0:0:0): SCSI Status: Check Condition kernel: (da0:umass-sim0:0:0:0): MEDIUM ERROR asc:30,2 kernel: (da0:umass-sim0:0:0:0): Cannot read medium - incompatible format kernel: (da0:umass-sim0:0:0:0): Retries Exhausted } } > In such cases I usually try to add quirks for the device > to /sys/cam/scsi/scsi_da.c. According to my experience > there's a good chance the device will work with a quirk. Not sure this is [now] just a FreeBSD driver problems. The slightly larger 2G stick read to hard disc no problem. Problem came on or after writing back to the slightly smaller stick. I'm wondering if eg somehow the proprietary control page got scrambled so badly it now thinks its doing 1024 or 256 byte sectors or something equally weird - or maybe the RAM part just died & only the USB IC is answering. ( I tried reading the stick with Win-XP too, but no good: Win-XP is too clueless of course: half the clicks think there's no problem, & the other half give no clue what's wrong, doesnt report a device read error, let alone report an MBR unavailable, nor did XP offer to re MBR it, & DOS window with fdisk /mbr found no fdisk. I loathe XP, but checked what I was doing with XP worked on a normal stick (to confirm it wasn't me failing with XP). ) Either this stick died of its own accord, or possibly FreeBSD did something radical to it (though if so, & how is a mystery). Thanks for the pointer to the quirk table. I used it in desperation to turn on all of DA_Q_NO_SYNC_CACHE | DA_Q_NO_6_BYTE | DA_Q_NO_PREVENT It didn't help make the stick useable though. Still I get loads of (da0:umass-sim0:0:0:0): READ(10). CDB: 28 0 0 0 0 0 0 0 1 0 (da0:umass-sim0:0:0:0): CAM Status: SCSI Status Error (da0:umass-sim0:0:0:0): SCSI Status: Check Condition (da0:umass-sim0:0:0:0): MEDIUM ERROR asc:30,2 (da0:umass-sim0:0:0:0): Cannot read medium - incompatible format (da0:umass-sim0:0:0:0): Retrying Command (per Sense Data) That Sony 2G stick is going back to vendor ! It cost 55 pounds = 79 Euro. I learnt the quirk table though, detected a quirk in another stick & submiting via send-pr (from my notes here: http://berklix.com/~jhs/src/bsd/fixes/FreeBSD/src/gen/sys/cam/scsi/ http://berklix.com/~jhs/src/bsd/fixes/FreeBSD/src/jhs/sys/cam/scsi/ So something useful came from the work, thanks for your help Oliver :-) -- Julian Stacey. Consultant Unix Net & Sys. Eng., Munich. http://berklix.com Mail in Ascii, HTML=spam. Ihr Rauch = mein allergischer Kopfschmerz.