udev to obtain hard drive serial number

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



What's the most stable way in which to obtain a hard drive serial number
using recent Linux kernels and udev. Normal users may call udevadm like
this to get the serial number:

/sbin/udevadm info --query=property --name /dev/sda | grep ID_SERIAL_SHORT
| tr = " " | awk '{print $2}'

output looks like this:

E3834563JPSNTN

How stable/reliable is this approach compared to other tools such as
hdparm, etc. Is there a better way to do this with udev?

Thanks for any advice,

Brad





--
To unsubscribe from this list: send the line "unsubscribe linux-hotplug" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[Index of Archives]     [Linux Kernel]     [Linux DVB]     [Asterisk Internet PBX]     [DCCP]     [Netdev]     [X.org]     [Util Linux NG]     [Fedora Women]     [ALSA Devel]     [Linux USB]

  Powered by Linux