使用 udevadm 在 bash 中读取 USB 串行代码
我正在尝试使用 udevadm 命令读取 bash 中的 USB 唯一 ID。 使用的命令是:
udevadm info --query=all --name=/dev/sdc1
使用常规 USB 存储时输出是正确的,
E: ID_SERIAL=JetFlash_Transcend_2GB_7FYD0N04-0:0
E: ID_SERIAL_SHORT=7FYD0N04
但是当我使用 mp3 播放器时,输出有点奇怪,例如:
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
USB 存储除了 ID_SERIAL_SHORT 之外还有什么独特的东西吗?
谢谢
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
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
没有唯一的 USB 序列号。每个供应商根据自己的意愿选择代码。有许多设备根本没有 USB_SERIAL。
There are no unique USB serial numbers. Each vendor selects codes at his own will. There are many devices without USB_SERIAL at all.