usb hdd and thumb drive not in /dev until hotplug

Asked by Gary W

Hi, I've been googling and fiddling around for a while looking for a solution to this one...

I have a 250 GB WD external usb 2.0 hdd and 8gb Memorex Traveldrive plugged into my do-all workstation (samba for the windows boxes, mt-daapd for anyone who wants a listen, MPD for mood music, webmin, CUPS, etc.. etc..) and on 8.04 and 8.10 the setup was pretty sweet. Most everything was set up without a hitch, and being a new convert to linux (about 8.04 time) I was amazed at how many server programs I could have running while playing UrbanTerror without dropping the framerate.

Anyway, being an official ubuntu nut, I took the plunge and installed 9.04 as soon as it went official.

Second order of business, get the samba shares up and running to keep the wifey happy. Now, for speeds sake I installed webmin as I like to rewrite the smb.conf on new installs. So I'm setting up the shares in webmin, and I notice that there is no entry in /media/ (or /mnt/) for the usb HDD, which is the overflow storage / info-that-needs-to-be-portable drive which i was trying to set up a samba share for. In 8.04 and 8.10, it was always automatically mounted. Also weird that there was no icon for it on the Gnome desktop. So, I check to see where it placed it in /dev/disk/by-id/ and there was no entry for the usb hdd or thumb drive that I had already (since boot) plugged in at the time.

Weird. It usually picks up on that. 8.04 and 8.10 did.

lsusb did however list the devices (WD and MEMOREX) on the controller.

So, I take the thumb drive out and plug it back in to see if it will at least give me a /dev/ block to use.

At the same time, I hear the usb hdd spin to life from the rest state and gnome pops up links on the desktop for the hdd and thumb drive. Also entries were automatically created in /meda/ for the hdd and thumb drive

Weird. Hot plugging the thumb drive must have triggered a rescan of the usb bus for storage devices.

Now, I must admit, were getting into territory I'm not too familiar with. I know exactly how to mount a drive by /dev/, yet I do not know how those /dev/ entries get there. Well, I do, kinda. udev does it, but I tried looking at the rules files, and wow. thats gonna take some time to digest.

So, what I'm trying to fix is the fact that it won't automatically detect usb storage peripherals in its initial state. And its a bit of an inconvenience that either me or my wife has to hotplug something to get access to a certain storage device. I'd like to just be able to push the power button and have it ready, serving files as soon as is all booted up. Just like before.

Now, i'm going to reboot to provide the standard dmesg, lsusb, /var/logs before and after I do the hotplug shuffle.

(a small aside: I realize this post is very long winded, and a bit meandering to the point. But you people volunteer your time and energy to help users solve their problems, so I might as well make this post interesting, and a decent read. Its the least I can do.)

Question information

English Edit question
Ubuntu Edit question
No assignee Edit question
Solved by:
Last query:
Last reply:
Revision history for this message
Gary W (wriggary) said :

output of dmesg before hotplug :
output of dmesg after :
output of sudo lsusb -vv before :
output of sudo lsusb -vv after :
output of cat /var/log/messages before :
output of cat /var/log/messages after :

please reply if any more information is needed.

Revision history for this message
Best actionparsnip (andrew-woodhead666) said :

Webmin is not advised to install packages with. For the rest its fine (word of warning there)

ok lets look at this stuff....

If the drives are always attatched you could always add an extra line in the last boot level to:

rmmod usb_storage; modprobe usb_storage

to see if it wakes it up. Its a bit hackish but if it makes it fly then I'd run with it.

Revision history for this message
Steve (stupendoussteve-deactivatedaccount) said :

From your "after" messages file:

Apr 26 01:32:13 br-desktop kernel: [ 319.700648] Initializing USB Mass Storage driver...

The usb_storage driver does not appear to be loaded automatically until you are unplugging and replugging (you could confirm with lsmod before and after doing so. My USB HD experiences this same problem, there is a bug open for it (bug 364933).

Please try adding usb_storage to /etc/modules, and see if that makes a difference after a reboot. If so, consider adding your experience and comment to that bug.

Revision history for this message
Gary W (wriggary) said :

Thanks actionparsnip, that solved my question.

Revision history for this message
Gary W (wriggary) said :

well, both of you actually solved the problem. rmmod and modprobing usb_storage did work, but adding it to /etc/modules seems a bit cleaner to do at boot.

Oh, and no more writing posts at 0100 anymore. I was writing the smb.conf file with webmin but as far as installing samba, i used aptitude. :)