Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Programmatically get hard drive info on macOS

I need a way to get complete hard drive info on OS X, meaning all hard drive model names, SATA/ATA controllers, volumes, disk identifiers, etc. I checked out diskutil, but it doesn't contain SATA controller info, system_profiler has all the information I need but its XML output is not necessarily organized as well as I'd like. Is there any low level Carbon/C API that would let me do this?

like image 285
indragie Avatar asked Oct 14 '10 23:10

indragie


1 Answers

Look into IOKit. There's also this question on Stack Overflow: How to get serial number from Mac hard disks?

like image 81
Joshua Nozzi Avatar answered Oct 03 '22 19:10

Joshua Nozzi