Bug 1907729

Summary: smartctl doesn't return all the attributes for SCSI hard drive
Product: [Fedora] Fedora Reporter: Roger <caemail4fun_123>
Component: smartmontoolsAssignee: Michal Hlavinka <mhlavink>
Status: CLOSED EOL QA Contact: Fedora Extras Quality Assurance <extras-qa>
Severity: medium Docs Contact:
Priority: unspecified    
Version: 33CC: christian.franke, dwlegg, mhlavink, tsmetana
Target Milestone: ---   
Target Release: ---   
Hardware: x86_64   
OS: Linux   
Whiteboard:
Fixed In Version: Doc Type: ---
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2021-11-30 16:12:35 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:

Description Roger 2020-12-15 04:19:40 UTC
Description of problem:
smartctl doesn't return all the attributes from SCSI hard drive. The SCSI card is a PCIe LSI20320IE. Older version (7.0-7.fc31) of smartctl works. 

Version-Release number of selected component (if applicable):
7.1-9

How reproducible:
run 'smartctl -a /dev/sdb'

Steps to Reproduce:
1. run 'smartctl -a /dev/sdb'
2.
3.

Actual results:
[root@localhost Downloads]# smartctl -a /dev/sdb
smartctl 7.1 2019-12-30 r5022 [x86_64-linux-5.9.13-200.fc33.x86_64] (local build)
Copyright (C) 2002-19, Bruce Allen, Christian Franke, www.smartmontools.org

=== START OF INFORMATION SECTION ===
Vendor:               SEAGATE
Product:              ST373307LC
Revision:             DS09
User Capacity:        73,407,820,800 bytes [73.4 GB]
Logical block size:   512 bytes
Rotation Rate:        10033 rpm
Serial number:        3HZ73KA8
Device type:          disk
Transport protocol:   Parallel SCSI (SPI-4)
Local Time is:        Mon Dec 14 23:13:06 2020 EST
SMART support is:     Available - device has SMART capability.
SMART support is:     Enabled
Temperature Warning:  Enabled

=== START OF READ SMART DATA SECTION ===
SMART Health Status: OK
Current Drive Temperature:     0 C
Drive Trip Temperature:        0 C

Elements in grown defect list: 0

Error Counter logging not supported


[GLTSD (Global Logging Target Save Disable) set. Enable Save with '-S on']
Device does not support Self Test logging


Expected results:
Output from 7.0-7.fc31:

[root@localhost Downloads]# smartctl -a /dev/sdb
smartctl 7.0 2019-03-31 r4903 [x86_64-linux-5.9.13-200.fc33.x86_64] (local build)
Copyright (C) 2002-18, Bruce Allen, Christian Franke, www.smartmontools.org

=== START OF INFORMATION SECTION ===
Vendor:               SEAGATE
Product:              ST373307LC
Revision:             DS09
User Capacity:        73,407,820,800 bytes [73.4 GB]
Logical block size:   512 bytes
Rotation Rate:        10033 rpm
Serial number:        3HZ73KA8
Device type:          disk
Transport protocol:   Parallel SCSI (SPI-4)
Local Time is:        Mon Dec 14 23:18:21 2020 EST
SMART support is:     Available - device has SMART capability.
SMART support is:     Enabled
Temperature Warning:  Enabled

=== START OF READ SMART DATA SECTION ===
SMART Health Status: OK

Current Drive Temperature:     43 C
Drive Trip Temperature:        68 C

Elements in grown defect list: 0

Vendor (Seagate Cache) information
  Blocks sent to initiator = 2867686798
  Blocks received from initiator = 2924193379
  Blocks read from cache and sent to initiator = 296548049
  Number of read and write commands whose size <= segment size = 505567008
  Number of read and write commands whose size > segment size = 7935168

Vendor (Seagate/Hitachi) factory information
  number of hours powered up = 22963.98
  number of minutes until next internal SMART test = 74

Error counter log:
           Errors Corrected by           Total   Correction     Gigabytes    Total
               ECC          rereads/    errors   algorithm      processed    uncorrected
           fast | delayed   rewrites  corrected  invocations   [10^9 bytes]  errors
read:     783058        0         0    783058     783192       5071.875           0
write:         0        0         0         0          0       5708.846           0

Non-medium error count:     3886


[GLTSD (Global Logging Target Save Disable) set. Enable Save with '-S on']
No Self-tests have been logged


Additional info:

Comment 1 Christian Franke 2021-01-01 11:07:56 UTC
Please retry with smartmontools 7.2. It includes fixes related to SCSI log subpages.

Comment 2 David W. Legg 2021-09-28 15:21:14 UTC
This is not *exactly* what christian.franke asked for, but with a USB 3.0 Seagate 4TB hard disk and using smartmontools-1:7.2-7.fc34.aarch64, I get this:

# smartctl -a /dev/sda -d scsi
smartctl 7.2 2020-12-30 r5155 [aarch64-linux-5.13.13-200.fc34.aarch64] (local build)
Copyright (C) 2002-20, Bruce Allen, Christian Franke, www.smartmontools.org

=== START OF INFORMATION SECTION ===
Vendor:               Seagate
Product:              Portable
Revision:             9300
Compliance:           SPC-4
User Capacity:        4,000,787,029,504 bytes [4.00 TB]
Logical block size:   512 bytes
Physical block size:  4096 bytes
Logical Unit id:      0x5000000000000001
Serial number:        NAAHCAYA
Device type:          disk
Local Time is:        Tue Sep 28 16:15:04 2021 BST
SMART support is:     Available - device has SMART capability.
SMART support is:     Disabled
Temperature Warning:  Disabled or Not Supported

=== START OF READ SMART DATA SECTION ===
SMART Health Status: OK
Current Drive Temperature:     0 C
Drive Trip Temperature:        0 C

Error Counter logging not supported

Device does not support Self Test logging
[root@localhost ~]#

Comment 3 Ben Cotton 2021-11-04 13:41:43 UTC
This message is a reminder that Fedora 33 is nearing its end of life.
Fedora will stop maintaining and issuing updates for Fedora 33 on 2021-11-30.
It is Fedora's policy to close all bug reports from releases that are no longer
maintained. At that time this bug will be closed as EOL if it remains open with a
Fedora 'version' of '33'.

Package Maintainer: If you wish for this bug to remain open because you
plan to fix it in a currently maintained version, simply change the 'version' 
to a later Fedora version.

Thank you for reporting this issue and we are sorry that we were not 
able to fix it before Fedora 33 is end of life. If you would still like 
to see this bug fixed and are able to reproduce it against a later version 
of Fedora, you are encouraged  change the 'version' to a later Fedora 
version prior this bug is closed as described in the policy above.

Although we aim to fix as many bugs as possible during every release's 
lifetime, sometimes those efforts are overtaken by events. Often a 
more recent Fedora release includes newer upstream software that fixes 
bugs or makes them obsolete.

Comment 4 Ben Cotton 2021-11-04 14:11:17 UTC
This message is a reminder that Fedora 33 is nearing its end of life.
Fedora will stop maintaining and issuing updates for Fedora 33 on 2021-11-30.
It is Fedora's policy to close all bug reports from releases that are no longer
maintained. At that time this bug will be closed as EOL if it remains open with a
Fedora 'version' of '33'.

Package Maintainer: If you wish for this bug to remain open because you
plan to fix it in a currently maintained version, simply change the 'version' 
to a later Fedora version.

Thank you for reporting this issue and we are sorry that we were not 
able to fix it before Fedora 33 is end of life. If you would still like 
to see this bug fixed and are able to reproduce it against a later version 
of Fedora, you are encouraged  change the 'version' to a later Fedora 
version prior this bug is closed as described in the policy above.

Although we aim to fix as many bugs as possible during every release's 
lifetime, sometimes those efforts are overtaken by events. Often a 
more recent Fedora release includes newer upstream software that fixes 
bugs or makes them obsolete.

Comment 5 Ben Cotton 2021-11-04 15:08:47 UTC
This message is a reminder that Fedora 33 is nearing its end of life.
Fedora will stop maintaining and issuing updates for Fedora 33 on 2021-11-30.
It is Fedora's policy to close all bug reports from releases that are no longer
maintained. At that time this bug will be closed as EOL if it remains open with a
Fedora 'version' of '33'.

Package Maintainer: If you wish for this bug to remain open because you
plan to fix it in a currently maintained version, simply change the 'version' 
to a later Fedora version.

Thank you for reporting this issue and we are sorry that we were not 
able to fix it before Fedora 33 is end of life. If you would still like 
to see this bug fixed and are able to reproduce it against a later version 
of Fedora, you are encouraged  change the 'version' to a later Fedora 
version prior this bug is closed as described in the policy above.

Although we aim to fix as many bugs as possible during every release's 
lifetime, sometimes those efforts are overtaken by events. Often a 
more recent Fedora release includes newer upstream software that fixes 
bugs or makes them obsolete.

Comment 6 David W. Legg 2021-11-05 10:22:23 UTC
As far as I know, the symptoms I descirbed above are still there in FC35.
Could some-one change the version from 33 to 35, please?
Ta.

Comment 7 Ben Cotton 2021-11-30 16:12:35 UTC
Fedora 33 changed to end-of-life (EOL) status on 2021-11-30. Fedora 33 is
no longer maintained, which means that it will not receive any further
security or bug fix updates. As a result we are closing this bug.

If you can reproduce this bug against a currently maintained version of
Fedora please feel free to reopen this bug against that version. If you
are unable to reopen this bug, please file a new report against the
current release. If you experience problems, please add a comment to this
bug.

Thank you for reporting this bug and we are sorry it could not be fixed.

Comment 8 Roger 2021-12-01 03:42:51 UTC
Tested with F35. The original issue with SCSI Hard drive is fixed. 

David, your hard drive has SMART disabled:

-
SMART support is:     Disabled
-

I am not sure the command would work.

Comment 9 David W. Legg 2021-12-02 10:47:09 UTC
Thanks for noticing that, @Roger.
I guess it must have been disabled automatically, because I didn't disable it.
Presumably it got disabled because of lack of kernel support?

Comment 10 Roger 2021-12-04 17:36:03 UTC
SMART is independent from kernel. It is running in the hard drive.
smartctl has option to enable it. Run 'smartctl -h' for detail.
You can give it a try. You may want to back up your data first.

Comment 11 David W. Legg 2021-12-06 10:41:32 UTC
Thanks @Roger.

I still get this (below). Perhaps I need an FC35 kernel?

smartctl -a /dev/sda -d scsi
smartctl 7.2 2020-12-30 r5155 [aarch64-linux-5.13.13-200.fc34.aarch64] (local build)
Copyright (C) 2002-20, Bruce Allen, Christian Franke, www.smartmontools.org

=== START OF INFORMATION SECTION ===
Vendor:               Seagate
Product:              Portable
Revision:             9300
Compliance:           SPC-4
User Capacity:        4,000,787,029,504 bytes [4.00 TB]
Logical block size:   512 bytes
Physical block size:  4096 bytes
Logical Unit id:      0x5000000000000001
Serial number:        NAAHCAYA
Device type:          disk
Local Time is:        Mon Dec  6 10:37:41 2021 GMT
SMART support is:     Available - device has SMART capability.
SMART support is:     Disabled

...


# uname -a
Linux localhost.localdomain 5.13.13-200.fc34.aarch64 #1 SMP Thu Aug 26 16:51:14 UTC 2021 aarch64 aarch64 aarch64 GNU/Linux

Comment 12 David W. Legg 2022-01-29 11:25:25 UTC
So, now I have a Fedora 35 kernel:
# uname -a
Linux nas3 5.14.10-300.fc35.aarch64 #1 SMP Thu Oct 7 20:32:40 UTC 2021 aarch64 aarch64 aarch64 GNU/Linux

But still have no SMART on my USB/SATA disk:

# smartctl -a --smart=on -d scsi -T permissive /dev/sda
smartctl 7.2 2020-12-30 r5155 [aarch64-linux-5.14.10-300.fc35.aarch64] (local build)
Copyright (C) 2002-20, Bruce Allen, Christian Franke, www.smartmontools.org

=== START OF INFORMATION SECTION ===
Vendor:               Seagate
Product:              Portable
Revision:             0710
Compliance:           SPC-4
User Capacity:        5,000,981,077,504 bytes [5.00 TB]
Logical block size:   512 bytes
Physical block size:  4096 bytes
LU is fully provisioned
Logical Unit id:      0x3e41434141414e4d
Serial number:        NACAAANM
Device type:          disk
Local Time is:        Sat Jan 29 11:20:10 2022 GMT
SMART support is:     Unavailable - device lacks SMART capability.

=== START OF ENABLE/DISABLE COMMANDS SECTION ===
unable to fetch IEC (SMART) mode page [unsupported field in scsi command]

The disk is a brand new Seagate 5TB with known SMART capability.

Comment 13 David W. Legg 2022-01-29 11:30:08 UTC
BTW: Could somebody re-open this bug, please?

Comment 14 David W. Legg 2022-01-29 12:24:16 UTC
OK, so I found a most helpful solution here:

https://forum.openmediavault.org/index.php?thread/26601-how-to-get-smart-on-external-drives/

It may only be a temporary solution, but here it is, and I quote:

'You need to UAS blacklist your individual Seagate USB3 disks since otherwise SMART will always fail.'

Do an lsusb to find the USB id of your Seagate disk, 0bc2:2343 in my case, then:

echo "options usb-storage quirks=0bc2:2343:u" >> /etc/modprobe.d/usb-storage-quirks.conf

and re-boot.

Then, this command works:

smartctl -d sat /dev/sdb -a

NB. Specify 'sat' instead of 'scsi' in the above command. No '--smart=on' flag is needed.

Hopefully this will help some-one until the problem is fixed in a later kernel (I assume).