On Sun, Aug 14, 2005 at 09:32:57AM +0200, DervishD wrote:> Hi Pete :)> > * Pete Zaitcev <zaitcev@redhat.com> dixit:> > > A global unique ID won't work out to make all USB mass storage devices> > > appear under a common mountpoint, especially if it is recreated while> > > "formating" it.> > That is correct, but not what Dervish wanted. He wanted to mount them> > on separate pre-assigned mount points. If you want all of them to mount> > on the same place, just use /dev/sda1!> > That's not possible. sd_mod will assign different devices for> different USB gadgets, and that's my problem in the first case!. If I> plug my USB-whatever, it gets assigned /dev/sda1 (for the first> partition, I mean). If I unplug it and, after that, I plug any other> USB device, it gets assigned /dev/sdb1, etc. Don't know if the> culprit is usb-storage or sd_mod :? The problem is that I cannot know> about which device was assigned (at least in 2.4.x) so I can modify> fstab or even mount it.

I've been suffering from the same problem for a long time until I founda patch from Erik Andersen which automatically unregisters the sd deviceonce you unplug the USB device. It has changed my life :-)

Here it is for 2.4. I even wonder why we would not put this into mainline,since having orphan devices brings nothing but confusion.

Regards,Willy

----

This patch has been in use locally for quite some time now andmakes working with USB and 1394 mass-storage devices in 2.4.x amuch less painful experience. When devices are plugged in, theyare automagically connected up to the scsi subsystem without theneed to rescan all scsi busses or echo things into/proc/scsi/scsi. When devices are unplugged, they areautomagically removed from the scsi subsystem, instead of hangingaround registered but with no media actually present.