Read USB serial code in bash using udevadm

I am trying to read a unique usb identifier in bash using the udevadm command. used command:

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

the output is correct when using regular usb storage,

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

But when I use an mp3 player, the output will be something odd:

 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 anything unique besides ID_SERIAL_SHORT for storing usb?

thanks

+1
source share
1 answer

No unique USB serial numbers. Each supplier chooses codes of their own free will. There are many devices without USB_SERIAL.

+1
source

Source: https://habr.com/ru/post/1501536/


All Articles