#1427 closed patch (fixed)
Add support for SCT Error Recovery Timer features added in ACS-4
Reported by: | Jeremy Bauer | Owned by: | Christian Franke |
---|---|---|---|
Priority: | minor | Milestone: | Release 7.3 |
Component: | smartctl | Version: | |
Keywords: | ata | Cc: |
Description
ATA command set version 4 (ACS-4) and later support new capabilities for the SMART Command Transport (SCT) Error Recovery Control (ERT) function. Specifically, function codes 0003h-0005h were added. These functions are very useful for saving and retrieving persistent-over-power-cycle timer values and for resetting the drive to the manufacturer defaults. The patch provided enables the ability to use these new function codes by extending the functionality of the scterc.
The attached patch was generated from the git repo. Let me know if a svn patch is preferred.
Usage update:
-l TYPE, --log=TYPE
Show device log. TYPE: error, selftest, selective, directory[,g|s],
xerror[,N][,error], xselftest[,N][,selftest], background,
sasphy[,reset], sataphy[,reset], scttemp[sts,hist],
scttempint,N[,p], scterc[,N,M][,p|r], devstat[,N], defects[,N], ssd,
gplog,N[,RANGE], smartlog,N[,RANGE], nvmelog,N,SIZE
Man page update:
scterc[,READTIME,WRITETIME][,p|r] - [ATA only] prints values and descriptions of the SCT Error Recovery
Control settings. These are equivalent to TLER (as used by Western Digital), CCTL (as used by Samsung
and Hitachi/HGST) and ERC (as used by Seagate). READTIME and WRITETIME arguments (deciseconds) set the
specified values. Values of 0 disable the feature, other values less than 65 are probably not sup\u2010
ported. For RAID configurations, this is typically set to 70,70 deciseconds. If ',p' is specified
with read and write time values, these time values will be persistent over a power-on reset. If ',p'
is specified without read and write time values, the persistent over power-on values will be returned.
If ',r' is specified, all SCT timer settings are restored to the manufacturer's default value. The
',p' and ',r' options require the device to support ACS-4 or higher.
Usage Examples:
1) Print persistent power-on values
jrbauer@zeus:~$ sudo smartctl -l scterc,p /dev/sdb
smartctl 7.2 (build date Jan 11 2021) [x86_64-linux-5.4.0-60-generic] (local build)
Copyright (C) 2002-21, Bruce Allen, Christian Franke, www.smartmontools.org
SCT Error Recovery Control:
Power-on Read: Disabled
Power-on Write: Disabled
2) Set power-on values
jrbauer@zeus:~$ sudo smartctl -l scterc,80,82,p /dev/sdb
smartctl 7.2 (build date Jan 11 2021) [x86_64-linux-5.4.0-60-generic] (local build)
Copyright (C) 2002-21, Bruce Allen, Christian Franke, www.smartmontools.org
SCT Error Recovery Control set to:
Power-on Read: 80 (8.0 seconds)
Power-on Write: 82 (8.2 seconds)
3) Reset power-on and current values to the device default
jrbauer@zeus:~$ sudo smartctl -l scterc,r /dev/sdb
smartctl 7.2 (build date Jan 11 2021) [x86_64-linux-5.4.0-60-generic] (local build)
Copyright (C) 2002-21, Bruce Allen, Christian Franke, www.smartmontools.org
SCT Error Recovery Control set to: default values.
Attachments (1)
Change History (5)
by , 4 years ago
Attachment: | acs4_sct_ert_enhancements_v0.patch added |
---|
comment:1 by , 4 years ago
Component: | all → smartctl |
---|---|
Keywords: | ata added |
Milestone: | → Release 7.3 |
Owner: | set to |
Status: | new → accepted |
Type: | enhancement → patch |
Patch looks good, thanks.
comment:2 by , 4 years ago
Resolution: | → fixed |
---|---|
Status: | accepted → closed |
Patch applied in r5166, thanks.
comment:3 by , 4 years ago
Related changes: r5167, r5172, r5173.
If possible, please test a recent build. See https://builds.smartmontools.org for source tarball and various binaries.
BTW: Which drives do already support this feature ?
comment:4 by , 4 years ago
Christian -
Any device with full ACS-4 support should support this feature. Some WD ACS-3 drives also support it with recent firmware updates.
Verified on:
WD Ultrastar DC HC550
WD Ultrastar DC HC310, HC320, and HC330 with the latest firmware.
The changes look good on the r5173 build:
jrbauer@zeus:~/code/smart/r5173/usr/local/sbin$ sudo ./smartctl -l scterc,90,91,p /dev/sdb
smartctl 7.3 2021-01-20 r5173 [x86_64-linux-5.4.0-60-generic] (CircleCI)
Copyright (C) 2002-21, Bruce Allen, Christian Franke, www.smartmontools.org
SCT Error Recovery Control set to:
Power-on Read: 90 (9.0 seconds)
Power-on Write: 91 (9.1 seconds)
jrbauer@zeus:~/code/smart/r5173/usr/local/sbin$ sudo ./smartctl -l scterc,p /dev/sdb
smartctl 7.3 2021-01-20 r5173 [x86_64-linux-5.4.0-60-generic] (CircleCI)
Copyright (C) 2002-21, Bruce Allen, Christian Franke, www.smartmontools.org
SCT Error Recovery Control:
Power-on Read: 90 (9.0 seconds)
Power-on Write: 91 (9.1 seconds)
jrbauer@zeus:~/code/smart/r5173/usr/local/sbin$ sudo ./smartctl -l scterc,reset /dev/sdb
smartctl 7.3 2021-01-20 r5173 [x86_64-linux-5.4.0-60-generic] (CircleCI)
Copyright (C) 2002-21, Bruce Allen, Christian Franke, www.smartmontools.org
SCT Error Recovery Control set to: default values.
Thank you for including these changes in the tools.
Git patch file for ACS-4 scterc improvements