2009/11/24

Fixing Auto-mount Problems of a USB Device in Ubuntu

On one of my laptops with Ubuntu 9.10, USB memory sticks would only mount after several plug/unplug attempts. I investigated the problem and found a solution.

Diagnosis:

  • $ tail -f /var/log/messages (or call dmesg)
    ...
    Nov 24 21:33:41 michael-laptop2 kernel: [ 2592.748078] usb 2-1: new full speed USB device using uhci_hcd and address 2
    Nov 24 21:33:44 michael-laptop2 kernel: [ 2595.113326] usb 2-1: configuration #1 chosen from 1 choice

    → only after several attempts, the log would display "Initializing USB Mass Storage" and proceed with the auto-mount.

  • $ sudo lsusb
    Bus 002 Device 002: ID
    041e:200c Creative Technology, Ltd
    → in this case, the USB stick is an mp3 player

  • $ sudo lshal
    ...

    udi = '/org/freedesktop/Hal/devices/usb_device_
    41e_200c_4002FA76125D8F8A_if0'
    info.linux.driver = 'ndiswrapper'
    (string) info.parent = '/org/freedesktop/Hal/devices/usb_device_41e_200c_4002FA76125D8F8A'
    (string)
    info.product = 'USB Mass Storage Interface'
    (string)
    info.subsystem = 'usb' (string) ...
    → the "41e_200c" USB device has been wrongly associated to the ndiswrapper module.
Conclusion: my old experiments with ndiswrapper and the rtl8187b wifi device still left traces on my Ubuntu system I upgraded to 9.10.

Removing ndiswrapper was a bit tricky:

  • $ sudo ndiswrapper -l
    net8187b : driver installed
    device (0BDA:8189) present (alternate driver: rtl8187)
  • $ sudo ndiswrapper -r rtl8187
  • in synaptic: remove all the ndiswrapper-* packages
  • $ sudo rmmod ndiswrapper
  • $ sudo gedit /etc/modules
    → remove ndiswrapper line
  • $ sudo rm /lib/modules/$(uname -r)/kernel/ubuntu/ndiswrapper/ndiswrapper.ko

Now, usb sticks mount from the first time.
see also: https://help.ubuntu.com/community/WifiDocs/Driver/Ndiswrapper
update 25/11/2009: apparently, the ndiswrapper is part of the ubuntu distribution. After applying the latest security-fix, the ndiswrapper module re-appeared.
update 6/6/2010: the ndiswrapper bug still exists in Ubuntu 10.4.

No comments: