Serial Number

Harald Becker ralda at gmx.de
Fri May 6 19:17:00 UTC 2011


 Hallo David!

> Thanks again for the continued help Harald.  When I was saying the
> serial number, I'm actually talking about the serial number for the
> drive/device itself.  This can be seen in /proc/scsi/usb-storage/*ID*
> file for USB devices (I have no idea how to obtain this information
> for internal SATA/IDE/SCSI drives) and is not the UUID of the drive (I
> can obtain that info via blkid).

Sorry I do not have a /proc/scsi entry on my system, so I can't verify
that type of number. Do you mean a number formatted like this ...

6a12a4d5-e9e6-4568-afcc-34c70b24a668

... which is called the UUID (not a serial number)? The blkid command
(which is correct, blockdev was my mistake) retrieves UUIDs of block
devices ... but I don't know much about that, as I don't use that
feature due to the overhead it adds for UUID calculation/detection and
the fact, that I normally do not need UUID detection for block devices
(I'm preferring more static configurations).


> The reason I'm trying to use serial numbers is because that
> information does NOT change between devices being plugged in and
> removed from computer.

That is true and this the main purpose of the UUID feature.


> It's a way to always reference a device file without fear of it
> changing (unlike /dev/sda1 for example).
Depends on the type of application you have.


> Unfortunately the lines above will not help either as those are not
> unique information to the drive and can change between devices being
> plugged in and removed.  Any other thoughts or methods to obtain
> serial numbers?

Don't call it serial numbers, that is completely misleading. It really
looks you are asking for the UUID feature (well known name for that
purpose).

Sorry that the script information doesn't help. it was for creation of
serial type of numbers not for UUID processing, which is a completely
different requirement. May be you can find more appropriate information
using "mdev" and "uuid" keywords on Google etc. (again use UUID not
serial number).

--
Harald



More information about the busybox mailing list