I have a USB card reader with two SD card interfaces and two USB ports (so it can also act as a USB hub) all on the same device. I am running an embedded Linux device that is unsupervised in its use and intend to use 2 SD cards in the reader for storing data collected over several hours of operation. Each card is meant to hold specific data and the two data types cannot be mixed.
Using mdev's ability to fire off a script when a USB SCSI device (either an SD card or a USB flash disk) is mounted, I can note the physical location of the USB device so that I can identify which disk is which, but there is one exception to this. The card reader reports that both of the SD cards in the reader are physically located on port 1 of the reader. This means that I'm unable to (with my current knowledge) identify in my custom-written programs the physical card that data is being written to.
I can't bring the user into the loop to tell the system which card is which (the user simply plugs 2 fresh cards in, turns the device on, and walks away). How can I determine which filesystem belongs to which physical disk by using tools compatible with Busybox?
Thank you.
/sys
—if the kernel knows, its probably there. – derobert Nov 28 '11 at 14:30