While I'm not absolutely certain, looking at one of the OS headers
        
/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/System/Library/Frameworks/IOKit.framework/Versions/A/Headers/storage/ata/ATASMARTLib.h
I don't think macOS supports any immediate offline tests other than short and 
long (in particular, not selective ranges), so I think smartmontools on macOS 
is simply recognizing that - it runs on a lot of platforms, and not all of them 
necessarily support every feature.  macOS AFAIK doesn't support SMART at all on 
USB or Firewire; and at least one other OS doesn't seem to fully support SMART 
for ATA, for example.

> On Jun 25, 2018, at 21:40, Ubence Quevedo <that...@gmail.com> wrote:
> 
> Thanks for pointing this out.  I’m disappointed this feature seems to be 
> disabled in macOS.  Looks like I’ll have to ask the smartmontools developers 
> why this was left out of macOS.
> 
> -Ubence
> 
> On Mon, Jun 25, 2018 at 7:16 AM Richard L. Hamilton <rlha...@smart.net 
> <mailto:rlha...@smart.net>> wrote:
> Looks to me like the code purposely and intentionally disallows that on a 
> Mac.  No idea why - maybe the OS won't do it or doesn't like it.
> 
> In os_darwin.cpp:
> 483       case ATA_SMART_IMMEDIATE_OFFLINE:
> 484         select = in.in_regs.lba_low;
> 485         if (select != SHORT_SELF_TEST && select != EXTEND_SELF_TEST)
> 486         {
> 487           errno = EINVAL;
> 488           return set_err(ENOSYS, "Unsupported SMART self-test mode");
> 489         }
> 490         err = smartIf->SMARTExecuteOffLineImmediate (ifp,
> 491           select == EXTEND_SELF_TEST);
> 492         break;
> 
> In other words, on a Mac, I think only -t long and -t short would work, not 
> any other -t options.
> 
> 
>> On Jun 25, 2018, at 09:13, Ubence Quevedo (thatrat) <that...@gmail.com 
>> <mailto:that...@gmail.com>> wrote:
>> 
>> Hi All,
>> 
>> I tried compiling the latest snapshot of smartmontools, and the problem is 
>> still occurring:
>> Ubences-MacBook-Pro:smartmontools-6.7 uquevedo$ ./smartctl -t select,0-10 
>> /dev/disk0
>> smartctl 6.7 2018-06-21 r4735 [Darwin 17.6.0 x86_64] (local build)
>> Copyright (C) 2002-18, Bruce Allen, Christian Franke, www.smartmontools.org 
>> <http://www.smartmontools.org/>
>> 
>> === START OF OFFLINE IMMEDIATE AND SELF-TEST SECTION ===
>> Sending command: "Execute SMART Selective self-test routine immediately in 
>> off-line mode".
>> SPAN         STARTING_LBA           ENDING_LBA
>>    0                    0                   10
>> Command "Execute SMART Selective self-test routine immediately in off-line 
>> mode" failed: Unsupported SMART self-test mode
>> 
>> This seems more a problem for smartmontools…?  Might this be a problem 
>> similar to not being able to scan external drives for smart information in 
>> macOS?
>> 
>> I’m still curious if anyone has gotten the selective span scan to work in 
>> macOS...?
>> 
>> -Ubence
>> 
>>> On Jun 24, 2018, at 3:35 PM, Ubence Quevedo <that...@gmail.com 
>>> <mailto:that...@gmail.com>> wrote:
>>> 
>>> Thanks for pointing this out, but the selective scan range for smartctl has 
>>> never worked in previous versions available through macports from the last 
>>> few years, I’m just now finally posting something about this.  I had worked 
>>> around this by setting the sleep timeout on my Mac to a much longer timeout 
>>> [three hours] so the whole drive [1TB] could be scanned on a long test.  
>>> From what I understand of the selective scan range, the range will be 
>>> scanned, and when the next scan occurs, it’s scan the next range.
>>> 
>>> I’d really love for this feature to work so I don’t have to keep my system 
>>> online all the time for scanning.
>>> 
>>> Any suggestions on how to look into this further?Perhaps build 
>>> smartmontools from source and test?  Has anyone gotten the selective range 
>>> to work for scanning from installing smartmontools from macports?
>>> 
>>> -Ubence
>>> 
>>> On Sun, Jun 24, 2018 at 3:15 PM Joshua Root <j...@macports.org 
>>> <mailto:j...@macports.org>> wrote:
>>> Ubence Quevedo wrote:
>>> > However, when I boot the same system off of Ubuntu 18.04 Live USB with the
>>> > same version of smartmontools [6.6], this command works properly:
>>> 
>>> Just a note that Ubuntu does not actually have the same version as
>>> MacPorts. As your output shows:
>>> 
>>> MacPorts:
>>> > smartctl 6.6 2017-11-05 r4594 [Darwin 17.6.0 x86_64] (local build)
>>> 
>>> Ubuntu:
>>> > smartctl 6.6 2016-05-31 r4324 [x86_64-linux-4.15.0-20-generic] (local 
>>> > build)
>>> 
>>> MacPorts has the 6.6 release, corresponding to svn r4594. Ubuntu has an
>>> svn snapshot from sometime after 6.5 but before 6.6, r4324. This is
>>> confirmed by the listed Ubuntu package version:
>>> 
>>> <https://packages.ubuntu.com/bionic/smartmontools 
>>> <https://packages.ubuntu.com/bionic/smartmontools>>
>>> 
>>> - Josh
>> 
> 

Attachment: signature.asc
Description: Message signed with OpenPGP

Reply via email to