Hi, I need to write a script to gather Linux hardware device information, such as disk drives, Lan card, etc. For the hot-pluggable USB mass storage devices, I want to report them with their vendor, model, capacities and device files information when they are plugged in.
For normal SCSI devices I can run cat /proc/scsi/scsi coupled with cat /proc/partitions to get the information I want. However, it doesn't work for USB hotpluggable storage devices because when I unplug the USB devices, cat /proc/scsi/scsi and cat /proc/partitions still have their information. Sometimes, /proc/partitions even gives wrong capacity after I unplug the device. I noticed that the USB device information is removed from /proc/bus/usb/devices file after unplugging USB devices. However, if I have two USB disks with the same vendor and model, it is so hard to tell which one is unplugged (sdb or sdc?). Anyone knows how to accurately report USB storage device information? How can I tell if a device file associated a USB storage device is unusable when the device is unplugged? Is the USB storage devices always show up in cat /proc/scsi/scsi Vendor section as USB? Thank you very much for your help! Xiaoqin Qiu ------------------------------------------------------- This SF.net email is sponsored by: SF.net Giveback Program. Does SourceForge.net help you be more productive? Does it help you create better code? SHARE THE LOVE, and help us help YOU! Click Here: http://sourceforge.net/donate/ _______________________________________________ [EMAIL PROTECTED] To unsubscribe, use the last form field at: https://lists.sourceforge.net/lists/listinfo/linux-usb-users
