USB Flash reader under RELENG_6: force GEOM rescan

Zaphod Beeblebrox zbeeble at gmail.com
Fri Feb 10 00:00:18 PST 2006


On 2/9/06, Doug White <dwhite at gumbysoft.com> wrote:

How about 'fdisk da0'? :)


That's only bad when it actually decides to do something :).

I have a usb drive that takes a while to become ready after being
> inserted. It initially generates errors when attempting to access it.
> Yours may have a similar issue.
>

No... what he's talking about (and I have also commented on this issue) is
that many USB devices that talk to memory --- and we're not talking about
USB memory sticks per se, but more like 5-in-1 readers and whatnot --- "plug
in" to USB and show up as disks with '0' blocks.  Many of these devices show
up as many drives (different "luns" in the SCSI speak) all with 0 bytes.

A good example of the problem is my Dell flat panel.  It has a USB
connection to the computer and it provides a USB hub with 4 ports and a 4
slot multi-card reader.  It shows up thusly:

da0 at umass-sim0 bus 0 target 0 lun 0
da0: <SMSC 223 U HS-CF 3.60> Removable Direct Access SCSI-0 device
da0: 40.000MB/s transfers
da0: Attempt to query device size failed: NOT READY, Medium not present
da1 at umass-sim0 bus 0 target 0 lun 1
da1: <SMSC 223 U HS-MS 3.60> Removable Direct Access SCSI-0 device
da1: 40.000MB/s transfers
da1: Attempt to query device size failed: NOT READY, Medium not present
da2 at umass-sim0 bus 0 target 0 lun 2
da2: <SMSC 223 U HS-SM 3.60> Removable Direct Access SCSI-0 device
da2: 40.000MB/s transfers
da2: Attempt to query device size failed: NOT READY, Medium not present
da3 at umass-sim0 bus 0 target 0 lun 3
da3: <SMSC 223 U HS-SD/MMC 3.60> Removable Direct Access SCSI-0 device
da3: 40.000MB/s transfers
da3: Attempt to query device size failed: NOT READY, Medium not present

and a good summary:

[3:137:437]root at canoe:/usr/ports/astro/gpsd/work/gpsd-2.30> camcontrol
devlist
<SMSC 223 U HS-CF 3.60>            at scbus0 target 0 lun 0 (da0,pass0)
<SMSC 223 U HS-MS 3.60>            at scbus0 target 0 lun 1 (da1,pass1)
<SMSC 223 U HS-SM 3.60>            at scbus0 target 0 lun 2 (da2,pass2)
<SMSC 223 U HS-SD/MMC 3.60>        at scbus0 target 0 lun 3 (da3,pass3)

Obviously, one each for compact flash, memory stick, Smart media and SD/MMC.

Now... interestingly, if I put a card in, camcontrol rescan da3, it doesn't
realize that the media has changed, or that the media is anything but zero
blocks.

Several of the GEOM classes even panic if you ask them to attach to the
empty unit.  If the unit is full, attaching the null geom device works
somewhat like doing the "dd" trick from earlier in this thread.

But (just to show the sillyness of it) my current workaround to this problem
(most times) is to turn off my monitor (thus dumping the USB hub and all
it's attachments).

Nasty.

Need to be able to rescan these things.


More information about the freebsd-stable mailing list