From owner-freebsd-current@FreeBSD.ORG Sat Mar 24 02:36:28 2012 Return-Path: Delivered-To: freebsd-current@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id C9D2A106564A; Sat, 24 Mar 2012 02:36:28 +0000 (UTC) (envelope-from kaho@ed.niigata-u.ac.jp) Received: from caav01.cais.niigata-u.ac.jp (caav01.cais.niigata-u.ac.jp [133.35.17.133]) by mx1.freebsd.org (Postfix) with ESMTP id 64D148FC0A; Sat, 24 Mar 2012 02:36:28 +0000 (UTC) Received: from caav01.cais.niigata-u.ac.jp (localhost [127.0.0.1]) by localhost (Postfix) with ESMTP id F40A4A2638; Sat, 24 Mar 2012 11:18:02 +0900 (JST) Received: from pf2.ed.niigata-u.ac.jp (pf2.ed.niigata-u.ac.jp [133.35.172.22]) by caav01.cais.niigata-u.ac.jp (Postfix) with ESMTPS id D0020A261A; Sat, 24 Mar 2012 11:18:02 +0900 (JST) Received: from pf2.ed.niigata-u.ac.jp (localhost [127.0.0.1]) by pf2.ed.niigata-u.ac.jp (8.14.5/8.14.5) with ESMTP id q2O2HnWk017629; Sat, 24 Mar 2012 11:18:02 +0900 (JST) (envelope-from kaho@pf2.ed.niigata-u.ac.jp) To: freebsd-current@freebsd.org From: Kaho Toshikazu X-Mailer: MH-E 8.2; MH 6.8.4.JP-3.05; GNU Emacs 23.4.1 References: <201203230825.32954.hselasky@c2i.net> User-Agent: EMH/1.14.1 SEMI/1.14.6 (Maruoka) FLIM/1.14.9 (=?ISO-2022-JP-2?B?R29qGyQoRCtXGyhC?=) APEL/10.8 Emacs/23.4 (amd64-portbld-freebsd10.0) MULE/6.0 (HANACHIRUSATO) MIME-Version: 1.0 (generated by SEMI 1.14.6 - "Maruoka") Content-Type: text/plain; charset=US-ASCII Date: Sat, 24 Mar 2012 11:17:49 +0900 Message-ID: <17628.1332555469@pf2.ed.niigata-u.ac.jp> Sender: kaho@ed.niigata-u.ac.jp X-Mailman-Approved-At: Sat, 24 Mar 2012 02:51:35 +0000 Cc: , freebsd-usb@freebsd.org Subject: Re: USB Flash drive problem with 9.0 X-BeenThere: freebsd-current@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Discussions about the use of FreeBSD-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 24 Mar 2012 02:36:28 -0000 Hello, I have a similar problem with Transcend 16GB USB flash. When the flash is plugged, FreeBSD attache it, but reports very big capacity and can not read/write it. UQ_MSC_NO_INQUIRY makes jobs in my machines. 10-current and 8-stable have same problem, and 9-stable is not tested. -- Kaho Toshikazu -- To: freebsd-usb@freebsd.org Subject: Re: USB Flash drive problem with 9.0 From: Hans Petter Selasky Date: Fri, 23 Mar 2012 08:25:32 +0100 Cc: Alexander Motin , freebsd-current@freebsd.org, "J.J. Day" On Friday 23 March 2012 06:14:08 J.J. Day wrote: > I am upgrading a FreeBSD server and have encountered a problem with > mounting a USB flash drive. The system was on 6.3 and I upgraded to 9.0 > using CVS repositories. The flash drive worked properly at all steps > throughout the upgrade. However, after the OS upgrade was complete, I > made a mistake and destroyed some of the server application. > > So, I set the > upgraded drive aside, copied the original source drive to a different > spare, and repeated the upgrade process taking care to verify the > functioning of the applications during the process. When I finished the > second time, everything worked properly except for mounting the flash > drive. > > it appears that something changed with the OS code that reads the drive > firmware between the first time I ran cvsup on (about) the 9th and the > second time I ran it about the 18th. > > > > This is the output from the first upgrade (3/11/2012) when the drive is > inserted: > > > > ugen4.2: at usbus4 > umass0: on usbus4 > umass0: SCSI over Bulk-Only; quirks = 0x0100 > umass0:2:0:-1: Attached to scbus2 > da0 at umass-sim0 bus 0 scbus2 target 0 lun 0 > da0: Removable Direct Access SCSI-4 device > da0: 40.000MB/s transfers > da0: 30960MB (63406080 512 byte sectors: 255H 63S/T 3946C) > And diskinfo output: > > > > da0 > 512 # sectorsize > 32463912960 # mediasize in bytes (30G) > 63406080 # mediasize in sectors > 0 # stripesize > 0 # stripeoffset > 3946 # Cylinders according to firmware. > 255 # Heads according to firmware. > 63 # Sectors according to firmware. > AA22064F00000035 # Disk ident. > This is the output from the second upgrade (3/18/2012) when the drive is > inserted: > > > > ugen4.2: at usbus4 > umass0: on usbus4 > umass0: SCSI over Bulk-Only; quirks = 0x0100 > umass0:2:0:-1: Attached to scbus2 > da0 at umass-sim0 bus 0 scbus2 target 0 lun 0 > da0: Removable Direct Access SCSI-4 device > da0: 40.000MB/s transfers > da0: 17454747090944MB (71776119061217281 512 byte sectors: 64H 32S/T 0C) > And diskinfo shows: > Hi, > > da0 > 512 # sectorsize > -144115188075855360 # mediasize in bytes () > -281474976710655 # mediasize in sectors > 0 # stripesize > 0 # stripeoffset > -137438953471 # Cylinders according to firmware. > 64 # Heads according to firmware. > 32 # Sectors according to firmware. > AA22064F00000035 # Disk ident. > Since the size information is incorrect, the /dev/da0s1 device is not > created and the drive cannot be mounted. The problem only happens with a > large drive. When I use a 4GB or 8GB drive, everything works correctly. > > If there is any information that I can submit that can assist in solving > the problem please let me know. > This does not look like a USB problem. It is the SCSI/CAM layer which queries over SCSI USB how big the disk is. BTW: dec2hex(17454747090944) ans = FE000000000 So it looks like some additional bits have sneaked in there? dec2hex(32463912960) ans = 78F000000 0xFE000000000 / 0x78F000000 ans = 537.67 So it looks like the mediasize was multiplied by 512 when it shouldn't. --HPS