• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: Retrieving hard disk serial number
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Retrieving hard disk serial number


  • Subject: Re: Retrieving hard disk serial number
  • From: Chris Zubrzycki <email@hidden>
  • Date: Thu, 15 Jun 2006 11:33:33 -0400

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1


On Jun 15, 2006, at 11:10 AM, Dirk Stegemann wrote:

Hello,

(originally posted at carbon-dev)

I'd like to retrieve the system volume's hard disk serial number.
For drives which indeed support such a serial number it can be read using the ioreg tool.


Although I'd prefer to read the hard disk serial number using an API (e.g. IOKit) instead of using a dedicated tool, I'm more concerned about the different paths I seem to have to go through the dictionaries to get different drives' serial numbers when the drives are attached by different busses (see ioreg output below).

Also, the *keys* used to query the dictionary for the S/N differ, e.g. "device serial" vs. "Serial Number".

Apple's System Profiler gets them all, but maybe it also uses different code to read the S/N from different devices?

Is there a recommended / unified way to retrieve a hard drive's serial number?
At least, are there known pitfalls?


Thanks for pointers, links, sample code snippets, comments, or whatever you might consider useful!

Try looking at smartmontools for some examples on how to query different drives.


- -chris zubrzycki
- - --
PGP public key: http://homepage.mac.com/beren/publickey.txt
ID: 0xA2ABC070
Fingerprint: 26B0 BA6B A409 FA83 42B3  1688 FBF9 8232 A2AB C070
========================================================

Unix _IS_ user friendly... It's just selective about who its friends are.


-----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.3 (Darwin) Comment: Please sign reply-http://www.gnupg.org

iEYEARECAAYFAkSRfdAACgkQ+/mCMqKrwHAWmACeNZFpnjcAjkLMTbYtjxh6V6F3
ZMoAoLMMJa5gqDscFVZR87v8GDs6lzYj
=M1Cq
-----END PGP SIGNATURE-----
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Darwin-dev mailing list      (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden


References: 
 >Retrieving hard disk serial number (From: Dirk Stegemann <email@hidden>)

  • Prev by Date: Retrieving hard disk serial number
  • Next by Date: Re: cpufrequency
  • Previous by thread: Retrieving hard disk serial number
  • Next by thread: ATAIdentify: was Re: Darwin-dev Digest, Vol 3, Issue 158
  • Index(es):
    • Date
    • Thread