[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

[debian-knoppix] Question about USB device deallocation (Memorysticks and similar)



Hello list,

When plugging in an USB multislot cardreader, the slots appear
as logical Units in /proc/scsi/scsi, and each of them allocates
a /dev/sd[a-z] device, which is fine and will be used to create Desktop
icons and /etc/fstab on-the-fly in the upcoming next release of KNOPPIX
(as you may have guessed, I'm already working for a while on that one
now).

When removing the cardreader (or any usb-storage device), the
/proc/scsi/scsi entries remain unchanged, and also the entries in
/proc/scsi/usb-storage-* directories remain. If you plug the cardreader
in again, new devices and SCSI hosts are allocated. I'm using the newest
version of hotplug from debian-unstable (plus a wrapper that will create
the desktop icons later, but it does not affect the handling of USB
devices at all).

Questions:

1.) How can I reliably identify the /dev/sd? device allocated by an
individual USB device when it is being plugged in? Neither
/proc/bus/usb/* nor /proc/scsi/* reveal any information about this, just
dmesg gives out some information, which is not easy to parse.

2.) How can I remove the scsi hostadapter allocation when the device is
removed, plus the entries in /proc/bus/usb/* and
/proc/scsi/usb-storage-*? Simply doing an echo
"scsi-remove-single-device 1 0 0 1" >/proc/scsi/scsi ff. only removes
the entries from /proc/scsi/scsi, but does not really deallocate the
devices. /sbin/hotplug basically does a NOP on removal, since there are
no removal scripts.

Can anybody point me in the right direction?

Regards
-Klaus Knopper
--
Klaus Knopper                           Technical Solutions & Finances
knopper@linuxtag.org                          http://www.linuxtag.org/
Phone +49-(0)631-3109371                        Fax +49-(0)631-3109372
LinuxTag 2003 - Europes largest Linux Expo       Where .com meets .org
_______________________________________________
debian-knoppix mailing list
debian-knoppix@linuxtag.org
http://mailman.linuxtag.org/mailman/listinfo/debian-knoppix


Reply to: