Skip site navigation (1)Skip section navigation (2)
Date:      Sat, 24 Mar 2012 04:53:46 +0000
From:      "J.J. Day" <day1234@hotmail.com>
To:        <freebsd-usb@freebsd.org>
Subject:   RE: USB Flash drive problem with 9.0
Message-ID:  <COL112-W4603BEEE8F8E540061317AB7470@phx.gbl>
In-Reply-To: <201203230825.32954.hselasky@c2i.net>
References:  <COL112-W354F702F0F2A3DDF718D49B7460@phx.gbl>, <201203230825.32954.hselasky@c2i.net>

next in thread | previous in thread | raw e-mail | index | archive | help





> From: hselasky@c2i.net
> To: freebsd-usb@freebsd.org
> Subject: Re: USB Flash drive problem with 9.0
> Date: Fri=2C 23 Mar 2012 08:25:32 +0100
> CC: day1234@hotmail.com=3B freebsd-current@freebsd.org=3B mav@freebsd.org
>=20
> 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=2C after the OS upgrade was complete=2C=
 I
> > made a mistake and destroyed some of the server application.
> >=20
> > So=2C I set the
> > upgraded drive aside=2C copied the original source drive to a different
> > spare=2C and repeated the upgrade process taking care to verify the
> > functioning of the applications during the process. When I finished the
> > second time=2C everything worked properly except for mounting the flash
> > drive.
> >=20
> > 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.
> >=20
> >=20
> >=20
> > This is the output from the first upgrade (3/11/2012) when the drive is
> > inserted:
> >=20
> >=20
> >=20
> > 	ugen4.2: <HP> at usbus4
> > umass0: <HP v165w=2C class 0/0=2C rev 2.00/32.76=2C addr 2> on usbus4
> > umass0:  SCSI over Bulk-Only=3B quirks =3D 0x0100
> > umass0:2:0:-1: Attached to scbus2
> > da0 at umass-sim0 bus 0 scbus2 target 0 lun 0
> > da0: <hp v165w 3276> Removable Direct Access SCSI-4 device
> > da0: 40.000MB/s transfers
> > da0: 30960MB (63406080 512 byte sectors: 255H 63S/T 3946C)
> > And diskinfo output:
> >=20
> >=20
> >=20
> > 	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 i=
s
> > inserted:
> >=20
> >=20
> >=20
> > 	ugen4.2: <HP> at usbus4
> > umass0: <HP v165w=2C class 0/0=2C rev 2.00/32.76=2C addr 2> on usbus4
> > umass0:  SCSI over Bulk-Only=3B quirks =3D 0x0100
> > umass0:2:0:-1: Attached to scbus2
> > da0 at umass-sim0 bus 0 scbus2 target 0 lun 0
> > da0: <hp v165w 3276> Removable Direct Access SCSI-4 device
> > da0: 40.000MB/s transfers
> > da0: 17454747090944MB (71776119061217281 512 byte sectors: 64H 32S/T 0C=
)
> > And diskinfo shows:
> >=20
>=20
> Hi=2C
>=20
> >=20
> > 	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=2C 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=2C everything works correctl=
y.
> >=20
> > If there is any information that I can submit that can assist in solvin=
g
> > the problem please let me know.
> >=20
>=20
> This does not look like a USB problem. It is the SCSI/CAM layer which que=
ries=20
> over SCSI USB how big the disk is.
>=20
> BTW:
>=20
> dec2hex(17454747090944)
> ans =3D FE000000000
>=20
> So it looks like some additional bits have sneaked in there?
>=20
> dec2hex(32463912960)
> ans =3D 78F000000
>=20
>  0xFE000000000 / 0x78F000000
> ans =3D  537.67
>=20
> So it looks like the mediasize was multiplied by 512 when it shouldn't.
>=20
> --HPS

Kaho Toshikazu found a solution (a work-around) for the problem.

Since the drive mounted as: 	"ugen4.2: <HP> at usbus4"
The commands:
# usbconfig -d 4.2 add_quirk UQ_MSC_NO_INQUIRY
# usbconfig -d 4.2 reset

resets the attach and appears to bypass some of the SCSI/CAM process.

The /dev/da0s1 device is created and the drive functions normally
although the drive ident information is no longer available.

JJ

 		 	   		  =



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