dhenderson at digital-pipe.com
Fri May 6 20:12:34 UTC 2011
On 05/06/2011 03:17 PM, Harald Becker wrote:
> 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 ...
> ... 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
> 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).
> busybox mailing list
> busybox at busybox.net
Hey Harald. I'm familiar with UUID's, but that's not what I'm looking
for. Serial numbers are strings of characters that manufacturers use to
identify an exact, specific part or product (unlike a model number, for
example, which gives an ID to a group of products). For instance, Dell
uses a serial number for each computer they sell (although they call it
a "Service Tag") and it's usually a 5-7 character string. Another
example would be if you were to remove a hard drive from a computer and
look on the face of it, you'll see a line that says "S/N" indicating a
serial number. These are unique to every single piece of equipment so
no two products of the same model or manufacturer will have the same
one. This string is available under /proc in various locations (as I've
found out) and can be "encrypted" at times. hdparm can acquire this
information as well, but it only seems to work under certain conditions,
so I can't use that reliably. Other distro's use the serial number in
their naming conventions (Debian based distro's use /dev/disk/by-id/...)
so I know it's possible, I'm just at a loss of how to get this
information with mdev. I would have figured that mdev would pass this
as a variable value since it does so for Vendor, Model, etc.
While UUID's are unique, there are a few problems with them. First, you
can't create a UUID for a drive, only a partition. Second, UUID's are
only good while the partition stays intact. Any modification to that
partition, and the UUID is no longer applicable. Serial numbers are for
the drive itself and can't be changed, ever.
Also, if you're interested in seeing a serial number, plug in a newer
USB hard drive and look at its corresponding file under
/proc/scsi/usb-storage. Depending on the drive caddy used, this value
may or may not show up (which is why I was going to default to another
set of info in its absence). The contents of the /proc/scsi/scsi (not
/proc/scsi) contain various bits of info as well, but I've never seen it
contain a serial number.
Does anyone know if there was a reason why the serial number wasn't
included as part of the environment passed by mdev?
More information about the busybox