S.M.A.R.T. status of drive from CLI?

Hello,

Appearently disk utility app can report the S.M.A.R.T. status of your hard drive. I've also heard of other 3rd party software that can do the same. On another forum it was suggested that maybe system_profiler might be able to list this info. After a quick check, I didn't find anything. Now I'm thinking maybe SNMP, but I think that defaults to off on non-server macs (or does it?).

Any ideas? I would love to have a script monitor this and report if it detects trouble on the horizon.

--
Cole



15 PB Mac OS X (10.3.4)

Posted on Nov 30, 2006 7:29 AM

Reply
16 replies

Nov 30, 2006 4:43 PM in response to Cole Tierney

Cole

I guess it wasn't present in 10.3? It even works (in 10.4) if you just give '/' instead of the device id (I'll omit the 'grep' so you can see it all):
<pre>

ibook:~ michaelc$ diskutil info /
Device Node: /dev/disk0s10
Device Identifier: disk0s10
Mount Point: /
Volume Name: OSX_4
File System: Journaled HFS+
Journal size 8192 k at offset 0x1d9000
Owners: Enabled
Partition Type: Apple_HFS
Bootable: Is bootable
Media Type: Generic
Protocol: ATA
SMART Status: Verified
UUID: C6503605-C7ED-3742-952F-D10EF098F3C5
Total Size: 16.5 GB
Free Space: 4.5 GB
Read Only: No
Ejectable: No

</pre>I originally thought it would need the device name, but you can see it isn't necessary. What other things are missing in 10.3?

Are you sure the drive you are looking at supports S.M.A.R.T. reporting? Not all do.

Nov 30, 2006 4:57 PM in response to Michael Conniff

My Disk Utility app shows S.M.A.R.T. status : verified. Maybe diskutil in 10.3 isn't that SMART. 🙂 Here's my diskutil output:
Device Node: /dev/disk0s3
Device Identifier: disk0s3
Mount Point: /
Volume Name: Macintosh HD

File System: Journaled HFS+
Journal size 8192 k at offset 0x8601000
Permissions: Enabled
Partition Type: Apple_HFS
Bootable: Is bootable
Media Type: Generic
Protocol: ATA

Total Size: 55.8 GB
Free Space: 3.6 GB

Read Only: No
Ejectable: No


Maybe it's time to get with the program and upgrade to 10.4.

--
Cole



15 PB Mac OS X (10.3.4)

Nov 30, 2006 7:24 PM in response to Cole Tierney

This doesn't add much, but the SMART stuff is in

%nm /System/Library/PrivateFrameworks/DiskManagement.framework/Versions/Current/Dis kManagement | grep -i smart
94c70433 t -[DMDisk _getSMARTData:]
94c702f9 t -[DMDisk _getSMARTDevice:]
94c6b399 t -[DMDisk smartStatus]
94c69637 t -[DMDisk(Mutable) setSmartStatus:]
a4c669ac S _DMSmartStatusFailing
a4c669a8 S _DMSmartStatusNotSupported
a4c669b0 S _DMSmartStatusVerified


Andy

Dec 1, 2006 1:22 AM in response to Cole Tierney

FWIW from my machine and the statement below the data is from an email of Marcel Bresnik(Temperature Monitor) in regards to a question I asked him.

doug-pennington-s-Computer:~ pennington$ diskutil info /dev/disk0 | grep SMART
SMART Status: Verified
doug-pennington-s-Computer:~ pennington$ u
doug-pennington-s-Computer:~ pennington$ %nm /System/Library/PrivateFrameworks/DiskManagement.framework/Versions/Current/Dis kManagement | grep -i smart
-bash: %nm: command not found
doug-pennington-s-Computer:~ pennington$ nm /System/Library/PrivateFrameworks/DiskManagement.framework/Versions/Current/Dis kManagement | grep -i smart
90c39a58 t -[DMDisk _getSMARTData:]
90c39964 t -[DMDisk _getSMARTDevice:]
90c3742c t -[DMDisk smartStatus]
90c3671c t -[DMDisk(Mutable) setSmartStatus:]


Most hard drives contain a diagnostic processor which is computing
the S.M.A.R.T. verification status and which is keeping an internal
attribute table with detail status data, including the current
temperature.
You can get this data by sending S.M.A.R.T. requests to the drive.
The way to interpret this data can be different for each drive model.

Dec 1, 2006 6:44 AM in response to Cole Tierney

Cole,

Have you seen this? I stumbled across it this morning.

Sending SCSI or ATA commands to storage devices

here's a paragraph from the above article.

"The same design applies to the ATA family as well: sending commands directly to ATA and Serial ATA (SATA) devices is unsupported. However, the ATA family does provide a device interface that allows applications to read SMART (Self-Monitoring, Analysis, and Reporting Technology) data from ATA and SATA devices that implement the SMART feature set."


Andy

Message was edited by: Nils C. Anderson

Dec 1, 2006 8:14 AM in response to Cole Tierney

Andy,

I read that article and it seemed to imply that ioreg might be able to read smart attributes. This is what I've found regarding my hard drive and there are references to SMART. But I'm unfamilliar with ioreg. Given the following info, could ioreg dig a little deeper?

<pre style="text-align:left;color:#000000; background-color:#f7f7f7; border:solid black 1px; padding:0.5em 1em 0.5em 1em; overflow:auto;font-size:small; font-family:monospace; ">IOATABlockStorageDevice <class IOATABlockStorageDevice, registered, matched, active, busy 0, retain count 5>
{
"IOCFPlugInTypes" = {"24514B7A-2804-11D6-8A02-003065704866"="IOATAFamily.kext/Contents/PlugIns/IOAT ABlockStorage.kext/Contents/PlugIns/ATASMARTLib.plugin"}
"IOUserClientClass" = "ATASMARTUserClient"
"device-type" = "Generic"
"Device Characteristics" = {"Product Revision Level"="8122 ","ATA Features"=55,"Product Name"="FUJITSU MHT2060AT "}
"Protocol Characteristics" = {"Physical Interconnect"="ATA","Physical Interconnect Location"="Internal"}
}
</pre>
--
Cole


15 PB Mac OS X (10.3.4)

Dec 1, 2006 9:55 AM in response to Cole Tierney

Cole--

I read that article and it seemed to imply that ioreg
might be able to read smart attributes. This is what
I've found regarding my hard drive and there are
references to SMART. But I'm unfamilliar with ioreg.
Given the following info, could ioreg dig a little
deeper?


I don't think ioreg will give you much more information than that. Interstingly, on my PowerBook, just one block below the one you posted, is the block storage driver entry, which includes statistics:

<pre class="command">ioreg -w0 -n IOBlockStorageDriver | grep IOBlockStorageDriver -A6</pre>So there's a little bit of useful information there.

But if you really want comprehensive information on your drive's S.M.A.R.T. status, you really want smartmontools. You'll need to have the Xcode tools installed to build it, but I've built and used it with PowerBooks running 10.3 and 10.4. You can even use it to run surface scans on your internal drive.

charlie

Dec 1, 2006 10:33 AM in response to Cole Tierney

Cole--

I was hoping for an out of the box solution that I
could deploy to a couple dozen other macs we have
without having to install xcode on each. Looks like I
can do that for machines running 10.4, though.


Well, if you're trying to deploy across a number of machines, you could try compiling on one machine and copy the binaries across to another machine. The binaries are installed in /usr/local/sbin/ by default, I think.

The only problem I've had with it so far is that it won't work on my 24" iMac with a Western Digital drive, though it works on a G5 iMac with a different WD drive. So your mileage may vary.

Also, in looking around, I found a project called maxwell at Sourceforge. It's similar to smartmontools. It also compiled (with one error) and ran on my PowerBook. It compiles on the Intel iMac, with the same error, but won't read any information from the drive's firmware.

charlie

This thread has been closed by the system or the community team. You may vote for any posts you find helpful, or search the Community for additional answers.

S.M.A.R.T. status of drive from CLI?

Welcome to Apple Support Community
A forum where Apple customers help each other with their products. Get started with your Apple Account.