read usb serial code in bash using udevadm

ぐ巨炮叔叔 提交于 2020-02-25 06:51:11

问题


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


回答1:


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



来源:https://stackoverflow.com/questions/8653505/read-usb-serial-code-in-bash-using-udevadm

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!