Getting hard drive serial number from USB devices

Lennart Sorensen lsorense-1wCw9BSqJbv44Nm34jS7GywD8/FfD2ys at public.gmane.org
Mon Jan 16 21:44:58 UTC 2006


On Mon, Jan 16, 2006 at 04:25:13PM -0500, Madison Kelly wrote:
>   Currently I use the 'UUID' of a partition as assigned by 'blkid' and 
> that works fine with a few exceptions. Those exceptions are the cases I 
> am trying to work around. Specifically;
> 
> - The UUID of a permission changes if that partition is reformatted.
> - No UUID is assigned to some file systems (ie: NTFS).

Hmm, I thought NTFS also had a 32bit ID like FAT does.

> - On some file systems 'blkid' assigns a generic '0000-0000' UUID (ie: 
> 'vfat' on digital cameras).

Well what can you do on those cameras. :)  I suppose you could always
assign one to it whenever you see 0000-0000 since it was obviously
formated by a brain dead device and ought to be fixed.

I thought you were using it to identify backup targets, not backup
sources.

>   Being a backup program I want to, ideally, support all file systems. 
> This is why reading the serial number would be so ideal; I could create 
> a (slightly modified) MD5 hash of the drive's serial number + 
> partition/slice number to create a file system agnostic, portable ID.

But a drive with multiple partitions would still be a problem then.  The
drive serial number is not a solution either.

>   If I *can't* get the serial number over a USB interface (as seems to 
> be the case now), then I need to find another method to uniquely 
> identify a physical disk. The problem is, often people who use my 
> program will buy a bunch of disk drives at once, often only in a series 
> of serial numbers. So relying on things like the model number or date 
> code would also be troublesome.
> 
>   Gah!
> 
>   Why couldn't disk drive manufacturer's put a small sector or two 
> aside with the information always available and outside the view of the 
> rest of the disk space? That would be sooooo nice!

No one prevents anyone from doing that.  Try convincing existing users
to change their disk setup after the fact though. :)

Len Sorensen
--
The Toronto Linux Users Group.      Meetings: http://tlug.ss.org
TLUG requests: Linux topics, No HTML, wrap text below 80 columns
How to UNSUBSCRIBE: http://tlug.ss.org/subscribe.shtml





More information about the Legacy mailing list