Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix a bug when sas disk in jbod mode #85

Open
wants to merge 6 commits into
base: develop
Choose a base branch
from

Conversation

jackeichen
Copy link

When connect the disk in JBOD mode, there will be no valid output to parse, fix it by check the output length.

When connect the disk in JBOD mode, there will be no valid output to parse, fix it by check the output length
@jackeichen
Copy link
Author

Here is configuration:

Broadcom RAID Card,SAS SSD in JBOD mode.

Issue is:

>>> from pySMART import Device
>>> sdd = Device("/dev/sdd")
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/home/py-SMART-master/pySMART/device.py", line 306, in __init__
    self.update()
  File "/home/py-SMART-master/pySMART/device.py", line 1003, in update
    elif self.dev_interface == 'nvme':
  File "/home/py-SMART-master/pySMART/device.py", line 332, in dev_interface
    fineType = self._classify()
  File "/home/py-SMART-master/pySMART/device.py", line 652, in _classify
    if returncode == 0 and 'SAS SSP' in raw[4]:
IndexError: list index out of range

The command outoput:

[root@localhost ~]# smartctl -d scsi -l sasphy  /dev/sdd
smartctl 7.1 2020-04-05 r5049 [x86_64-linux-4.18.0-372.9.1.el8.x86_64] (local build)
Copyright (C) 2002-19, Bruce Allen, Christian Franke, www.smartmontools.org

=== START OF READ SMART DATA SECTION ===
[root@localhost ~]# smartctl -d scsi -a  /dev/sdd
smartctl 7.1 2020-04-05 r5049 [x86_64-linux-4.18.0-372.9.1.el8.x86_64] (local build)
Copyright (C) 2002-19, Bruce Allen, Christian Franke, www.smartmontools.org

=== START OF INFORMATION SECTION ===
Vendor:               XXXXXXXXXXX
Product:              XXXXXXXXXXX
Revision:             CA00
Compliance:           SPC-5
User Capacity:        800,166,076,416 bytes [800 GB]
Logical block size:   512 bytes
Physical block size:  4096 bytes
LU is resource provisioned, LBPRZ=1
Rotation Rate:        Solid State Device
Form Factor:          2.5 inches
Logical Unit id:      0x50025380725029b0
Serial number:        XXXXXXXXXXXXXXXX
Device type:          disk
Transport protocol:   SAS (SPL-3)
Local Time is:        Tue Apr  9 08:02:36 2024 EDT
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

Percentage used endurance indicator: 0%
Current Drive Temperature:     42 C
Drive Trip Temperature:        65 C

Manufactured in week 07 of year 2022
Accumulated start-stop cycles:  135
Specified load-unload count over device lifetime:  0
Accumulated load-unload cycles:  0
Elements in grown defect list: 0

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:          0        0         0         0          0      27805.729           0
write:         0        0         0         0          0       9378.908           0
verify:        0        0         0         0          0          0.016           0

Non-medium error count:    84893

SMART Self-test log
Num  Test              Status                 segment  LifeTime  LBA_first_err [SK ASC ASQ]
     Description                              number   (hours)
# 1  Background short  Completed                   -     349                 - [-   -    -]

Long (extended) Self-test duration: 3600 seconds [60.0 minutes]

[root@localhost ~]#

@ralequi ralequi changed the base branch from master to develop April 19, 2024 13:46
@ralequi ralequi self-assigned this Apr 19, 2024
@ralequi
Copy link
Collaborator

ralequi commented Apr 19, 2024

Hi @jackeichen

Before I can merge it, I need you to check the file:

  • tests/dataset/singletests/megaraid_jbod_sas_hdd_0_issue_85/-d_scsi-l_sasphy__dev_sdd
  • tests/dataset/singletests/megaraid_jbod_sas_hdd_0_issue_85/_-d_test__dev_sdd

Please, run the corresponding commands for each one:

  • smartctl -d scsi -l l_background__dev_sdd /dev/sdd > tests/dataset/singletests/megaraid_jbod_sas_hdd_0_issue_85/_-d_scsi_-l_sasphy__dev_sdd
  • smartctl -d test /dev/sdd > tests/dataset/singletests/megaraid_jbod_sas_hdd_0_issue_85/_-d_test__dev_sdd

And verify the output is the same as the stored on the file. If not, please, update it.

Thank you

@jackeichen
Copy link
Author

Hi @jackeichen

Before I can merge it, I need you to check the file:

  • tests/dataset/singletests/megaraid_jbod_sas_hdd_0_issue_85/-d_scsi-l_sasphy__dev_sdd
  • tests/dataset/singletests/megaraid_jbod_sas_hdd_0_issue_85/_-d_test__dev_sdd

Please, run the corresponding commands for each one:

  • smartctl -d scsi -l l_background__dev_sdd /dev/sdd > tests/dataset/singletests/megaraid_jbod_sas_hdd_0_issue_85/_-d_scsi_-l_sasphy__dev_sdd
  • smartctl -d test /dev/sdd > tests/dataset/singletests/megaraid_jbod_sas_hdd_0_issue_85/_-d_test__dev_sdd

And verify the output is the same as the stored on the file. If not, please, update it.

Thank you

Confirmed. The output is the same as the stored on the file

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants