Opened 37 hours ago

Last modified 19 hours ago

#1914 new defect

Inconsistency between human-readable and json output for SMART Support

Reported by: Yurii Kondrakov Owned by:
Priority: minor Milestone: undecided
Component: smartctl Version: 7.4
Keywords: json Cc: Yurii Kondrakov

Description (last modified by Yurii Kondrakov)

Querying the info for a physical device using:

$ smartctl --info /dev/bus/0 -d megaraid,7
# OR
$ smartctl --info /dev/bus/0 -d megaraid,7 --json

yields different results - specifically, the JSON output lacks the following object:

  "smart_support": {
    "available": true,
    "enabled": true
  }

even though the human-readable output reports the support is available:

$ smartctl --info /dev/bus/0 -d megaraid,7

smartctl 7.2 2020-12-30 r5155 [x86_64-linux-5.15.0-130-generic] (local build)
Copyright (C) 2002-20, Bruce Allen, Christian Franke, www.smartmontools.org

=== START OF INFORMATION SECTION ===
Model Family:     Samsung based SSDs
Device Model:     SAMSUNG MZ7KM960HAHP-000FU
Serial Number:    S2TLNX0H700401
LU WWN Device Id: 5 002538 c40374a84
Firmware Version: CSLB
User Capacity:    960,197,124,096 bytes [960 GB]
Sector Size:      512 bytes logical/physical
Rotation Rate:    Solid State Device
Form Factor:      2.5 inches
TRIM Command:     Available, deterministic, zeroed
Device is:        In smartctl database [for details use: -P show]
ATA Version is:   ACS-2, ATA8-ACS T13/1699-D revision 4c
SATA Version is:  SATA 3.1, 6.0 Gb/s (current: 6.0 Gb/s)
Local Time is:    Fri Dec 20 03:00:18 2024 UTC
SMART support is: Available - device has SMART capability.
SMART support is: Enabled

Might be due to the following error produced by using --log=error flag:

"local_time": {
    "time_t": 1734663658,
    "asctime": "Fri Dec 20 03:00:58 2024 UTC"
  },
  "ata_smart_error_log": {
    "summary": {
      "revision": 1,
      "count": 0
    }
  }

Additionally, there is an inconsistency the other way around:

$ sudo smartctl /dev/nvme0 --info

smartctl 7.4 2023-08-01 r5530 [x86_64-linux-6.11.0-12-generic] (local build)
Copyright (C) 2002-23, Bruce Allen, Christian Franke, www.smartmontools.org

=== START OF INFORMATION SECTION ===
... [no SMART availability lines]


$ sudo smartctl /dev/nvme0 --info -j
{
  ...
  "smart_support": {
    "available": true,
    "enabled": true
  }
}

Change History (5)

comment:1 by Yurii Kondrakov, 37 hours ago

Description: modified (diff)

in reply to:  description comment:2 by Christian Franke, 24 hours ago

Keywords: json added

... yields different results - specifically, the JSON output lacks the following object:
...

Could not reproduce this. Please provide output of:
smartctl --json=o -i -d megaraid,7 /dev/bus/0
as an attachment.

Might be due to the following error produced by using --log=error flag:
...

Which error is produced there?

Additionally, there is an inconsistency the other way around:
...

This is as expected and will not be changed. NVMe does not provide a "SMART support" which is optional or could be disabled. The additional JSON output is for consistence with ATA and SCSI JSON output and always returns true.

In general, (S)ATA, SCSI/SAS and NVMe diagnostics differ considerably and so do smartctl outputs.

PS: Please do not set a milestone in future submissions.

comment:3 by Yurii Kondrakov, 23 hours ago

Thanks for the reply.

$ smartctl --json=o -i -d megaraid,7 /dev/bus/0

{
  "json_format_version": [
    1,
    0
  ],
  "smartctl": {
    "version": [
      7,
      2
    ],
    "svn_revision": "5155",
    "platform_info": "x86_64-linux-5.15.0-130-generic",
    "build_info": "(local build)",
    "argv": [
      "smartctl",
      "--json=o",
      "-i",
      "-d",
      "megaraid,7",
      "/dev/bus/0"
    ],
    "output": [
      "smartctl 7.2 2020-12-30 r5155 [x86_64-linux-5.15.0-130-generic] (local build)",
      "Copyright (C) 2002-20, Bruce Allen, Christian Franke, www.smartmontools.org",
      "",
      "Smartctl open device: /dev/bus/0 [megaraid_disk_07] failed: cannot open /dev/megaraid_sas_ioctl_node or /dev/megadev0"
    ],
    "messages": [
      {
        "string": "Smartctl open device: /dev/bus/0 [megaraid_disk_07] failed: cannot open /dev/megaraid_sas_ioctl_node or /dev/megadev0",
        "severity": "error"
      }
    ],
    "exit_status": 2
  }
}

As for NVME, what does not make sense is JSON says that smart support is available, but human readable output - not

comment:4 by Yurii Kondrakov, 23 hours ago

Milestone: undecided

comment:5 by Christian Franke, 19 hours ago

Milestone: undecided

Smartctl open device: /dev/bus/0 [megaraid_disk_07] failed: cannot open /dev/megaraid_sas_ioctl_node or /dev/megadev0

This output does not help because this time the access fails for some unknown reason. Please provide a complete JSON output of a successful device access.

Note: See TracTickets for help on using tickets.