Hi, is just that i developed a few programs and scripts to mount/dismount USB mass storage devices (USB pendrives) to a Pandaboard running Android ICS, and it works fine, but when i unplug the USB pendriver without dismounting it, the /dev/block/sdX starts to increase, something like /dev/block/sda1 in the first plug, and if i unplug without dismounting it i get /dev/block/sdb1 in the nex plug and if i unplug it again without dismounting it i get /dev/block/sdc1 in the next plug and so on and on. i mount the device to a folder with the name of MOUNTED, and when i unplug it without dismounting it, the folder where it was mounted gets a filesystem failure, when i make df to check that folder it says I/O error.

So i'm wondering if there is a way to avoid this, to refresh the name of the device when it is not plugged, where is that name assigned from? from the driver? of from an specific program?, i really need to solve this problem, please help. Thanks in advanced.