smartctl - Can't run select span range
Ubence Quevedo (thatrat)
thatrat at gmail.com
Tue Jun 26 12:32:43 UTC 2018
Curses, I was really hoping to leverage that feature since a three and a half hour long test is not ideal [below test started at 5:22AM]:
Ubences-MacBook-Pro:ata uquevedo$ smartctl -t long /dev/disk2
smartctl 6.6 2017-11-05 r4594 [Darwin 17.6.0 x86_64] (local build)
Copyright (C) 2002-17, Bruce Allen, Christian Franke, www.smartmontools.org
=== START OF OFFLINE IMMEDIATE AND SELF-TEST SECTION ===
Sending command: "Execute SMART Extended self-test routine immediately in off-line mode".
Drive command "Execute SMART Extended self-test routine immediately in off-line mode" successful.
Testing has begun.
Please wait 206 minutes for test to complete.
Test will complete after Tue Jun 26 08:52:02 2018
Use smartctl -X to abort test.
There’s no way that will complete under my system’s sleep schedule [three hour timeout for sleep] which isn’t ideal anyways. With the selected span range, I think I can just tell it to do the next range after it is done with one so it’ll take far less time to successfully get through a part of the drive and then continue on to the next whenever that might be.
I’m assuming I’d have to convince Apple that this would be a feature worth exposing in their software to have this be made available?
-Ubence
> On Jun 25, 2018, at 8:18 PM, Richard L. Hamilton <rlhamil at smart.net> wrote:
>
> 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 <thatrat at gmail.com <mailto:thatrat at 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 <rlhamil at smart.net <mailto:rlhamil at 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) <thatrat at gmail.com <mailto:thatrat at 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 <thatrat at gmail.com <mailto:thatrat at 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 <jmr at macports.org <mailto:jmr at 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
>>>
>>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.macports.org/pipermail/macports-users/attachments/20180626/652fa266/attachment.html>
More information about the macports-users
mailing list