Opened 12 years ago

Closed 11 years ago

Last modified 11 years ago

#228 closed enhancement (wontfix)

Powermode does not seem to work on Mac OS X (Darwin)

Reported by: drfrogsplat Owned by: somebody
Priority: minor Milestone:
Component: all Version: 5.42
Keywords: macosx needinfo Cc:

Description

When attempting to use the '-n' argument for smartctl on Mac OS X, it seems to always think the device is in SLEEP mode, at least for the drives I have available for testing.

Actual behaviour:

# smartctl -i -n standby /dev/disk0
smartctl 5.42 2011-10-20 r3458 [x86_64-apple-darwin11.3.0] (local build)
Copyright (C) 2002-11 by Bruce Allen, http://smartmontools.sourceforge.net

Device is in SLEEP mode, exit(2)

This occurs even when actively using the disks (e.g. dd if=/dev/disk0...).

Also, the Power mode is displayed as SLEEP by specifying -n never:

# smartctl -i -n never /dev/disk1
...
=== START OF INFORMATION SECTION ===
Device Model:     INTEL SSDSC2CT120A3
Serial Number:    <removed>
LU WWN Device Id: <removed>
Firmware Version: 300i
User Capacity:    120,034,123,776 bytes [120 GB]
Sector Size:      512 bytes logical/physical
Device is:        Not in smartctl database [for details use: -P showall]
ATA Version is:   8
ATA Standard is:  ACS-2 revision 3
Local Time is:    Fri Jun  1 11:47:52 2012 EST
SMART support is: Available - device has SMART capability.
SMART support is: Enabled
Power mode was:   SLEEP
...

Expected behaviour:
Should detect and report the correct power mode.

System Info:

Have tried this with the following drives, with the same problem occurring:

  • Hitachi HTS725050A9A362
  • INTEL SSDSC2CT120A3

On a MacBook Pro (mid-2010), Intel 5 Series Chipset, Mac OS X 10.7.4.

Running smartmontools v5.42-1 from MacPorts:

# port echo installed | grep smartmontools
smartmontools                  @5.42_1+attributelog+savestates 

Change History (6)

comment:1 by drfrogsplat, 12 years ago

As a further test I just installed the OS-X-SAT-SMART-Driver https://github.com/kasbert/OS-X-SAT-SMART-Driver

Same results as before, but now via USB instead of through the on-board SATA.

# smartctl -i -n never /dev/disk2

=== START OF INFORMATION SECTION ===
Model Family:     Western Digital Caviar Green
Device Model:     WDC WD10EADS-00M2B0
Serial Number:    <removed>
LU WWN Device Id: <removed>
Firmware Version: 01.00A01
User Capacity:    1,000,204,886,016 bytes [1.00 TB]
Sector Size:      512 bytes logical/physical
Device is:        In smartctl database [for details use: -P show]
ATA Version is:   8
ATA Standard is:  Exact ATA specification draft version not indicated
Local Time is:    Fri Jun  1 12:08:52 2012 EST
SMART support is: Available - device has SMART capability.
SMART support is: Enabled
Power mode was:   SLEEP

And with -n standby, it just exits immediately.

Device is in SLEEP mode, exit(2)

Again, the drive was in-use, and clearly not actually in SLEEP mode.

comment:2 by Christian Franke, 12 years ago

Component: smartctlall
Keywords: macosx added; powermode removed

Reporting SLEEP mode is actually a bug, smartctl should print:

CHECK POWER MODE not implemented, ignoring -n option

I will fix this in ataprint.cpp soon.

Mac OS X apparently does not provide any real ATA or SCSI pass-through support. ATA support is limited to basic SMART commands. An implementation of a power mode check may be possible if someone could answer the question in os_darwin.cpp.

comment:3 by Christian Franke, 12 years ago

Keywords: needinfo added
Priority: majorminor
Type: defectenhancement

False output should be fixed with r3554.

For actual power mode support see previous comment.

comment:4 by Christian Franke, 11 years ago

Resolution: wontfix
Status: newclosed

ATA Powermode check requires full ATA pass-through support. This is not available on Mac OS X.

According to a comment in os_darwin.cpp there might be another method. Please reopen this ticket if you could provide further info.

The bogus SLEEP mode message should no longer appear with smartmontools 6.0.

comment:5 by drfrogsplat, 11 years ago

Thanks for clarifying.

FWIW the author of that comment was geoffk1, so if still available may know more about what its referring to.

comment:6 by geoffk1, 11 years ago

I do remember---at least, I have notes. The idea is that you don't really want to know if the drive is powered off, since if it is powered off, it may not be able to tell you. What you want to know is whether the OS thinks the drive is powered off. What you can do is that, starting with the IORegistry entry for the block storage driver for the drive (that you already have), you find the power manager for the drive, then you look at its internal settings (which might be available in the registry) to determine the drive's power state. There's no nice API way to do this so you'd probably have to look at the ATA driver's internals.

Note: See TracTickets for help on using tickets.