USB Drives with Slackware and Hotplug
Posted by Jason Mon, 20 Mar 2006 17:41:00 GMT
I finally found a workable solution to my biggest Slackware annoyance. And since it was one of those things that wasn’t immediately available on Google, I figured it would be a service to others to blog about it.
My problem was with USB storage. I could plug in my flash drive or external hard drive in and it would all work; the device would get assigned to /dev/sdX. But it wouldn’t work if I unplugged the device and plugged it back in later. I had to reboot to get that USB device to work again. After rebooting, it was the same One And Done situation.
When first plugging in the device, I would get something like this in /var/log/messages:
Mar 20 22:01:29 crane kernel: hub.c: new USB device 00:10.4-1, assigned address 3
Mar 20 22:01:29 crane kernel: scsi2 : SCSI emulation for USB Mass Storage devices
Mar 20 22:01:29 crane kernel: sdb: sdb1
After unplugging the device and plugging it back in, the relevant entries in the messages file would look like this:
Mar 20 21:57:07 crane kernel: hub.c: new USB device 00:10.4-1, assigned address 4
The device would show up as you’d expect in the output of lsusb in both cases, but the SCSI emulation system doesn’t to pick up the drive when it gets plugged in for the second time.
The workaround turned out to be pretty simple. Every time I need to plug in one of my USB drives, I run this command as root:
/etc/rc.d/rc.hotplug restart
Then everything’s good to go.
Since you need root/sudo access to do this, it’s not really a great solution. But it’s good enough for me. The real solution likely requires kernel updates, and I don’t have the same desire to upgrade my kernel like I did back in the day :)
