Getting hard drive serial number from USB devices

Madison Kelly linux-5ZoueyuiTZhBDgjK7y7TUQ at public.gmane.org
Sat Jan 14 18:35:58 UTC 2006


Hi all,

   I am trying to figure out a way to query a *hard drive's* serial 
number that is connected over a USB/Firewire device.

   I've been able to piece together a script from stuff I found Googling 
that let's me get the serial number from IDE disks but apparently I 
can't use the same method for "SCSI" disks (as the USB disks show up as).

   I am looking for the serial number to make a more reliable "device 
id" number for my backup program. Currently I use the 'UUID' created by 
'blkid' but it doesn't generate UUIDs for all partitions and if a given 
partition is reformatted the UUID changes and my backup program sees it 
as an entirely new device.

   If I can find a way reliably get each hard drive's serial number then 
I can easily generate my own device ID that will survive reformats and 
which I can generate for partitions that 'blkid' doesn't help with.

   If possible, I'd prefer to do this in Perl but I am not adverse to 
using C/C++ if it does a better job and/or is needed to do more 
low-level queries.

   Thanks!

Madison

-- 
-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
           Madison Kelly (Digimer)
    TLE-BU; The Linux Experience, Back Up
Main Project Page:  http://tle-bu.org
Community Forum:    http://forum.tle-bu.org
-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
--
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