smartctl - Can't run select span range

Ryan Schmidt ryandesign at macports.org
Fri Jun 29 08:03:02 UTC 2018


On Jun 28, 2018, at 19:43, Ubence Quevedo wrote:

> On Tue, Jun 26, 2018 at 9:31 PM Ryan Schmidt wrote:
> 
>> On Jun 26, 2018, at 07:32, Ubence Quevedo wrote:
>> 
>> > 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.
>> 
>> So tell the system not to sleep while the test is running.
>> 
>> caffeinate -i smartctl -t long /dev/disk2
>> 
>> For more info:
>> 
>> man caffeinate

> 
> I gave caffeinate a try, and set my system sleep time to a more reasonable timeout [30 minutes], but since smartctl isn't an interactive process [a tsr?], the system never stays awake long enough to finish a whole test.  I even added the -m option to prevent the disk from idle sleeping but that didn't help.

Oh, right. As I recall, smartctl exits immediately, and the test occurs on the disk in the background, and you later run smartctl again to get the result.

In that case, you can run smartctl normally, and then caffeinate a sleep command that takes at least as long as the test. For example, if the test will take 206 minutes, you could sleep for 207 minutes (12,420 seconds):

caffeinate -i sleep 12420

("sleep" in this context means "wait this many seconds").



More information about the macports-users mailing list