I am trying to read usb unique id in bash using using udevadm command. used command is:

udevadm info --query=all --name=/dev/sdc1

output is proper while using a regular usb storage,

E: ID_SERIAL=JetFlash_Transcend_2GB_7FYD0N04-0:0
E: ID_SERIAL_SHORT=7FYD0N04

But when i use a mp3 player, output is something odd like:

E: ID_SERIAL=10d6_USB_2.0_FS__FLASH_DISK_USB_2.0_FS__FLASH_DISK
E: ID_SERIAL_SHORT=USB_2.0_FS__FLASH_DISK

Is there some thing unique other than ID_SERIAL_SHORT for a usb storage?

Thanks

有帮助吗?

解决方案

There are no unique USB serial numbers. Each vendor selects codes at his own will. There are many devices without USB_SERIAL at all.

许可以下: CC-BY-SA归因
不隶属于 StackOverflow
scroll top