Map device serial number to device names

Requests go here. If you fill a request, give it a new thread in the appropriate category and then link to it in the request thread.
Post Reply
Message
Author
B.K. Johnson
Posts: 807
Joined: Mon 12 Oct 2009, 17:11

Map device serial number to device names

#1 Post by B.K. Johnson »

All 3 USB ports on my computer are in use all the time and 2 are so close that a slight jiggle, a touch of one means a new device assignment in ascending order. This can be catastrophic in the midst of a download. Communications software that allows downloads to be resumed and completed after disconnection is nullified because of the changed destination.

In Windows, I once knew how to obtain the device type and serial number for each connected device. Is there a way to obtain same from puppy/Linux? If so, I have an idea for a pet that may perk someone's interest. Let's say the pet would be called lockdrives. When called/run it would obtain the serial number of each mounted drive, the assigned device name it is mapped to and set a flag (DRIVELOCK). The existing routine that polls the ports and assigns a new device name would check DRIVELOCK and if set, check if the serial number of the newly plugged in drive matches that which was locked. If they match, then reassign the old device name to the drive.

The pet and DRIVELOCK flag may not be even necessary. Just add/modify the existing code to read, log and map serial numbers and device name at boot and when a port is populated. When a drive is added, compare its serial number with that of the last resident. If it matches, then reassign the same device name. If different, do what is done now - assign the next higher number for the device type and update the device table.

Any comments? Any takers?

Post Reply