Storage Device being Detected as Printer
Solution 1:
Note (edit): It turned out my original answer (below) doesn't solve the OP's problem, it only narrows it down. Having struggled whether to delete the answer or not, I'm letting it stay for educational purposes.
Your USB seems to report 5a07
instead of 5307
(?). Compare usb.ids. 5a07
isn't there but maybe some printer driver matches this somehow. The mechanism is described in this answer (which seems overly pessimistic in subject of manually attaching a driver).
I don't know what exactly happened. Actually usb-storage 3-3:1.0
from your syslog
makes me suspect that usb-storage
(which is the right module for a thumbdrive) was loaded, then hpmud
(?) kicked in; I'm not sure.
But let's assume:
- the wrongly reported
idProduct
is the only problem (i.e. in every other aspect your USB drive works fine), - there is indeed some wrong driver attached
- and all you need is detaching it and attaching the right one.
See this other answer, it points to this LWN article and it looks like a good lead (there's also this answer pointing to this article). The generic example is:
In order to unbind a device from a driver, simply write the bus id of the device to the unbind file:
echo -n "1-1:1.0" > /sys/bus/usb/drivers/usb/unbind
[…]
To bind a device to a driver, the device must first not be controlled by any other driver.
[…]
Then, simply write the bus id of the device you wish to bind, into the bind file for that driver:
echo -n "1-1:1.0" > /sys/bus/usb/drivers/usb-storage/bind
In your case the bus id is 3-3:1.0
. Note it depends on USB port you used, so it will be different if you insert the thumbdrive into another socket. In a moment we will need root access and because of redirections (>
) it's easier to start a separate shell (sudo -s
).
At first check the currently attached driver:
cd "/sys/bus/usb/devices/3-3:1.0/"
readlink ./driver
If you're right, it will be something else than usb-storage
.
Detach the driver, whatever it is:
echo -n "3-3:1.0" > ./driver/unbind
Load the right driver in case it's not loaded yet:
modprobe usb-storage
Attach it to the device:
echo -n "3-3:1.0" > /sys/bus/usb/drivers/usb-storage/bind
And confirm:
readlink ./driver
lsblk
Don't forget to exit
the root shell.
The solution is not permanent. For now I don't know how to tell Linux to always load the desired driver (I could write a script to automate the above, but it doesn't feel like the right way). Nevertheless, the thumbdrive presumably changed its idProduct
after a bad eject, so I wouldn't trust it in a long run. Once it worked with forced usb-storage
driver, I would run ddrescue
to secure all data from it.