Determine USB HDD Serial Number (NOT Volume Serial!)

C

Connah

Hi all! I'm sure many of you rolled your eyes at the subject trying to
recall how many times youv'e heard this question. :) But bear with
because I THINK my question is at least slightly different from the
typical post.

I would like to obtain the manufactuer's embedded serial number (NOT
the volume serial that changes with each format) of USB drives. I
found some very handy code to obtain a regular SMART-enabled IDE
drive's information in VB6 here:

http://vbnet.mvps.org/index.html?code/disk/smartide.htm

However, when I run that code, it does not give me any information
about, say, a flash drive that is connected to my USB port. Do all USB
drives (both external hard drives with movable parts as well as flash
memory drives) have an embedded serial number that can be accessed? If
so, how can I obtain that information in Visual Basic 6? In not VB6,
how about any other language?

My ultimate goal is to be able to give out some USB thumb drives or
external hard drives and be able to uniquely track them. ANY thoughts
towards my goal would be greatly appreciated. Thank you!

Matthew
 
A

Arno Wagner

Previously Connah said:
Hi all! I'm sure many of you rolled your eyes at the subject trying to
recall how many times youv'e heard this question. :) But bear with
because I THINK my question is at least slightly different from the
typical post.
I would like to obtain the manufactuer's embedded serial number (NOT
the volume serial that changes with each format) of USB drives. I
found some very handy code to obtain a regular SMART-enabled IDE
drive's information in VB6 here:

However, when I run that code, it does not give me any information
about, say, a flash drive that is connected to my USB port. Do all USB
drives (both external hard drives with movable parts as well as flash
memory drives) have an embedded serial number that can be accessed? If
so, how can I obtain that information in Visual Basic 6? In not VB6,
how about any other language?

The drive is just a regular drive. But SMART cannot work over USB,
since there is no command set extension for it. Except some vendor
specific solutions that are non-portable.
My ultimate goal is to be able to give out some USB thumb drives or
external hard drives and be able to uniquely track them. ANY thoughts
towards my goal would be greatly appreciated. Thank you!

Well, the smartmontools (Linux, win-port available)do not give
you the disk ID even for USB disks.

Example:
---
gate:/home/wagner# smartctl -i /dev/sdc
smartctl version 5.36 [i686-pc-linux-gnu] Copyright (C) 2002-6 Bruce Allen
Home page is http://smartmontools.sourceforge.net/

Device: ST316002 1A Version: 3.06
---

The detailed USB bus info also does not list the disk serial number.
I would say it is possible that USB also does not support serial
number querying for the USB storage class. I also have no idea whether
USB flash-drives have serial numbers at all...

Arno
 
L

Lynn McGuire

I would like to obtain the manufactuer's embedded serial number (NOT
the volume serial that changes with each format) of USB drives. I
found some very handy code to obtain a regular SMART-enabled IDE
drive's information in VB6 here:

http://vbnet.mvps.org/index.html?code/disk/smartide.htm

However, when I run that code, it does not give me any information
about, say, a flash drive that is connected to my USB port. Do all USB
drives (both external hard drives with movable parts as well as flash
memory drives) have an embedded serial number that can be accessed? If
so, how can I obtain that information in Visual Basic 6? In not VB6,
how about any other language?

My DiskID32 tool http://www.winsim.com/diskid32/diskid32.html does
not work with USB drives either. The published interface from MS
( http://msdn2.microsoft.com/en-us/library/aa363411.aspx ) does not
appear to work either.

Does the Belarc advisor http://www.belarc.com/free_download.html
work ?

Lynn
 
T

Thein Myint Win

Previously Connah said:
Hi all! I'm sure many of you rolled your eyes at the subject trying to
recall how many times youv'e heard this question. :) But bear with
because I THINK my question is at least slightly different from the
typical post.
I would like to obtain the manufactuer's embedded serial number (NOT
the volume serial that changes with each format) of USB drives. I
found some very handy code to obtain a regular SMART-enabled IDE
drive's information in VB6 here:
http://vbnet.mvps.org/index.html?code/disk/smartide.htm
However, when I run that code, it does not give me any information
about, say, a flash drive that is connected to my USB port. Do all USB
drives (both external hard drives with movable parts as well as flash
memory drives) have an embedded serial number that can be accessed? If
so, how can I obtain that information in Visual Basic 6? In not VB6,
how about any other language?

The drive is just a regular drive. But SMART cannot work over USB,
since there is no command set extension for it. Except some vendor
specific solutions that are non-portable.
My ultimate goal is to be able to give out some USB thumb drives or
external hard drives and be able to uniquely track them. ANY thoughts
towards my goal would be greatly appreciated. Thank you!

Well, the smartmontools (Linux, win-port available)do not give
you the disk ID even for USB disks.

Example:
---
gate:/home/wagner# smartctl -i /dev/sdc
smartctl version 5.36 [i686-pc-linux-gnu] Copyright (C) 2002-6 Bruce Allen
Home page ishttp://smartmontools.sourceforge.net/

Device: ST316002 1A Version: 3.06
---

The detailed USB bus info also does not list the disk serial number.
I would say it is possible that USB also does not support serial
number querying for the USB storage class. I also have no idea whether
USB flash-drives have serial numbers at all...

Arno- Hide quoted text -

- Show quoted text -


The USB org clearly states that there should be a unique serial number
to all devices.

I found many devices, mouse, keyboard and flash drives without a
unique serial no. But they did have a serial no, but the problem is
all their devices have the same serial no. Most of them (nearly all of
them) are made in China especially the cheap products. I think they
simply duplicate the Serial Number. I call them bad devices.

But the world brend devices like Kingston, iOmega, ect... do have a
unique serial no among their devices. It means that the serial numbers
of two of the completely identical devices attached are not the same
while the vendor ID is shown the same. I call them good devices.

If you dig deep enough in the Windows Registry, you could find many
unique serial with vendor ID of every device or disks which have been
attached to your computer. For bad devices, there is only one entry
for multiple devices which have been attached.

Once, I have studied some API codes working around the USB interface.
It is right that USB does not support SMART and again SMART is not for
SCSI and SATA. For USB, there are possible ways in the API. But the
programming is very complex to driver level. Knowledge about USB
pipes, USB device classification and many other big deals. I have
studied some codes written by a German programmer which is pretty good
but I just could not understand. The coding is like a pile of alian
language for me. But they have a group, mostly east Europens, working
hard on it using VB6. But I could not remember their links.

Other than writing codes, there are many company providing thumbs for
anti-piracy purpose. They also give information and frameworks for
developers. But I have tried none.

But I am sure that a USB device even a mouse which is genuine could
give a unique embadded serial number.

If there is anyone interested in using USB device for anti-piracy
purpose, I am very glad to know that we have the same idea.
 
J

JW

If you dig deep enough in the Windows Registry, you could find many
unique serial with vendor ID of every device or disks which have been
attached to your computer. For bad devices, there is only one entry
for multiple devices which have been attached.

You can also execute this script from the command line, which will launch
the device manager:

set devmgr_show_nonpresent_devices=1
%windir%\system32\devmgmt.msc

The above can be copied into a .cmd file.

Execute it, then select (v)iew, show hidden devices.

All the USB drives (and everything else that no longer exists) that have
ever been connected can now be seen, albeit without their individual
serial numbers.
 
A

Arno Wagner

Previously Thein Myint Win said:
Previously Connah said:
Hi all! I'm sure many of you rolled your eyes at the subject trying to
recall how many times youv'e heard this question. :) But bear with
because I THINK my question is at least slightly different from the
typical post.
I would like to obtain the manufactuer's embedded serial number (NOT
the volume serial that changes with each format) of USB drives. I
found some very handy code to obtain a regular SMART-enabled IDE
drive's information in VB6 here:
http://vbnet.mvps.org/index.html?code/disk/smartide.htm
However, when I run that code, it does not give me any information
about, say, a flash drive that is connected to my USB port. Do all USB
drives (both external hard drives with movable parts as well as flash
memory drives) have an embedded serial number that can be accessed? If
so, how can I obtain that information in Visual Basic 6? In not VB6,
how about any other language?

The drive is just a regular drive. But SMART cannot work over USB,
since there is no command set extension for it. Except some vendor
specific solutions that are non-portable.
My ultimate goal is to be able to give out some USB thumb drives or
external hard drives and be able to uniquely track them. ANY thoughts
towards my goal would be greatly appreciated. Thank you!

Well, the smartmontools (Linux, win-port available)do not give
you the disk ID even for USB disks.

Example:
---
gate:/home/wagner# smartctl -i /dev/sdc
smartctl version 5.36 [i686-pc-linux-gnu] Copyright (C) 2002-6 Bruce Allen
Home page ishttp://smartmontools.sourceforge.net/

Device: ST316002 1A Version: 3.06
---

The detailed USB bus info also does not list the disk serial number.
I would say it is possible that USB also does not support serial
number querying for the USB storage class. I also have no idea whether
USB flash-drives have serial numbers at all...

Arno- Hide quoted text -

- Show quoted text -

The USB org clearly states that there should be a unique serial number
to all devices.
I found many devices, mouse, keyboard and flash drives without a
unique serial no. But they did have a serial no, but the problem is
all their devices have the same serial no. Most of them (nearly all of
them) are made in China especially the cheap products. I think they
simply duplicate the Serial Number. I call them bad devices.
Agreed.

But the world brend devices like Kingston, iOmega, ect... do have a
unique serial no among their devices. It means that the serial numbers
of two of the completely identical devices attached are not the same
while the vendor ID is shown the same. I call them good devices.
If you dig deep enough in the Windows Registry, you could find many
unique serial with vendor ID of every device or disks which have been
attached to your computer. For bad devices, there is only one entry
for multiple devices which have been attached.

However take note that for an USB HDD, this wil likely not be the disk's
ID, but that opf the controller chip doung the (S)ATA to USB translation.
Might be acceptable, depending on the application.
Once, I have studied some API codes working around the USB interface.
It is right that USB does not support SMART and again SMART is not for
SCSI and SATA.

SMART is for ATA and also for SATA.
For USB, there are possible ways in the API. But the
programming is very complex to driver level. Knowledge about USB
pipes, USB device classification and many other big deals. I have
studied some codes written by a German programmer which is pretty good
but I just could not understand. The coding is like a pile of alian
language for me. But they have a group, mostly east Europens, working
hard on it using VB6. But I could not remember their links.
Other than writing codes, there are many company providing thumbs for
anti-piracy purpose. They also give information and frameworks for
developers. But I have tried none.
But I am sure that a USB device even a mouse which is genuine could
give a unique embadded serial number.
If there is anyone interested in using USB device for anti-piracy
purpose, I am very glad to know that we have the same idea.

I think that using USB for anti-piracy is a bad idea,
just like any other token-based approach. You either need to
provide good support or have your customers convinced enough
of product quality to pay. Everything else is likely to fail.

Arno
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top