2

When I plug in my Motorola Triumph to my fedora 17 linux box USB port, I get an endless series of errors on the linux box as it desperately attempts to mount the phone as a USB drive. Stuff like this:

Jun 23 10:26:00 zooty kernel: [528926.714884] end_request: critical target error, dev sdg, sector 4
Jun 23 10:26:00 zooty kernel: [528926.715865] sd 16:0:0:1: [sdg]  Result: hostbyte=DID_OK driverbyte=DRIVER_SENSE
Jun 23 10:26:00 zooty kernel: [528926.715869] sd 16:0:0:1: [sdg]  Sense Key : Illegal Request [current] 
Jun 23 10:26:00 zooty kernel: [528926.715872] sd 16:0:0:1: [sdg]  Add. Sense: Invalid field in cdb
Jun 23 10:26:00 zooty kernel: [528926.715876] sd 16:0:0:1: [sdg] CDB: Read(10): 28 20 00 00 00 00 00 00 04 00

If I go ahead and tell the phone to allow linux to mount the USB storage, the messages stop, and I get a mounted drive, but if all I want to do is use the debug bridge, my log on linux will continue to fill with this junk. Is there some udev magic I can do to make the system ignore this particular device as far as usb storage goes?

I just noticed that if I tell the phone to enable USB storage, let linux recognize the new disk, then tell the phone to disable USB storage again, I get one additional log message about capacity changing to zero, but the endless spew of messages stops, so I guess one work around is to enable and disable USB right away.

1
  • You can tell you phone to "just charge" rather than mount as a disk as a default action. Well at least my HTC allows me to.
    – dotty
    Jun 23, 2012 at 15:03

1 Answer 1

0

You can tell the usb-storage module to ignore a VID/PID combination

Make a file such as /etc/modprobe.d/android.conf having contents of the form

options usb-storage quirks=vid##:pid##:i

Where the vid/pid are given in hex without prefix

A serious limitation of this technique is that some installations will load the usb-storage driver during the initread stage before /etc is present and honored, so it may get loaded without the ignore quirk. To work around that you can modify the inittread archive, or you can unload and reload the usb-storage module (if nothing else in your system is using it).

Another downside is that if you decide you want to mount it, you'd have to reload the driver without the quirk (for example using insmod).

Perhaps someone has a better way?

1
  • I love it! It works perfectly. I went ahead and re-ran dracut to rebuild the initramfs image and rebooted after making the modeprobe.d file, and the log is no longer spewing messages, yet I can still connect the debug bridge. Exactly what I was looking for! Jun 23, 2012 at 20:06

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .