ashaduri / gsmartcontrol

GSmartControl - Hard disk drive and SSD health inspection tool

Home Page:https://gsmartcontrol.shaduri.dev

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Support NVMe storage

ashaduri opened this issue · comments

This is a feature request to track NVMe support.

To fully support NVMe, the following criteria have to be met:

  • Better-than-experimental NVMe support in smartctl.
  • Full NVMe JSON output support in smartctl.
  • JSON input support in GSmartControl.
  • NVMe support in GSmartControl GUI, as NVMe information differs significantly from (S)ATA.

Any help is appreciated.

yes please add nvme support I have to use a proprietary application otherwise

There is https://github.com/linux-nvme/nvme-cli and it works well for my Samsung 960 EVO 250GB. Perhaps it is worth adding it as a backend to GSmartControl?

There is https://github.com/linux-nvme/nvme-cli and it works well for my Samsung 960 EVO 250GB. Perhaps it is worth adding it as a backend to GSmartControl?

Hi,
Is there any added benefit of using nvme-cli instead of smartctl?
It would be a lot easier to support smartctl's NVME as GSmartControl is transitioning to JSON support for (S)ATA as well.

There is https://github.com/linux-nvme/nvme-cli and it works well for my Samsung 960 EVO 250GB. Perhaps it is worth adding it as a backend to GSmartControl?

Sorry, I had an old version of smartmontools installed and I was sure that it did not work with NVME. Of course, there is no point in adding nvme-cli, the latest version of smartmontools works well.

Oh yeah, I reported this last year. IIRC the issue is that smartctl outputs the information differently for NVME disks for some reason.

smartctl_output.txt

Attached is my nvme smartctl output for posterity.

I have a BC711 NVMe SK hynix 256GB (Dell 3511) and it shows as unknown model :-(

In smartctl?

Yes version 1.1.4

Hmm, do you mean the GUI, GSmartControl?

The smartctl on my Linux Mint 20.3 (Ubuntu 20.04 LTS) install says it's version 7.1, so 1.1.4 would be very very old.

It is known that GSmartControl doesn't support NVME yet (hence the bug), but if this is a bug in smartctl it might be quite interesting. Run "smartctl -a <your_device>" to see what smartctl thinks.

commented

Release 7.3 - https://github.com/smartmontools/smartmontools/releases

C:\Program Files\GSmartControl>smartctl.exe -j --all /dev/sda
{
  "json_format_version": [
    1,
    0
  ],
  "smartctl": {
    "version": [
      7,
      3
    ],
    "svn_revision": "5338",
    "platform_info": "x86_64-w64-mingw32-w11-b25247",
    "build_info": "(sf-7.3-1)",
    "argv": [
      "smartctl",
      "-j",
      "--all",
      "/dev/sda"
    ],
    "exit_status": 0
  },
  "local_time": {
    "time_t": 1669414621,
    "asctime": "Fri Nov 25 23:17:01 2022 SE"
  },
  "device": {
    "name": "/dev/sda",
    "info_name": "/dev/sda",
    "type": "nvme",
    "protocol": "NVMe"
  },
  "model_name": "Samsung SSD 970 PRO 512GB",
  "serial_number": "S463NF0MXXXXXXX",
  "firmware_version": "1B2QEXP7",
  "nvme_pci_vendor": {
    "id": 5197,
    "subsystem_id": 5197
  },
  "nvme_ieee_oui_identifier": 9528,
  "nvme_total_capacity": 512110190592,
  "nvme_unallocated_capacity": 0,
  "nvme_controller_id": 4,
  "nvme_version": {
    "string": "1.3",
    "value": 66304
  },
  "nvme_number_of_namespaces": 1,
  "nvme_namespaces": [
    {
      "id": 1,
      "size": {
        "blocks": 1000215216,
        "bytes": 512110190592
      },
      "capacity": {
        "blocks": 1000215216,
        "bytes": 512110190592
      },
      "utilization": {
        "blocks": 107557128,
        "bytes": 55069249536
      },
      "formatted_lba_size": 512,
      "eui64": {
        "oui": 9528,
        "ext_id": 384696446185
      }
    }
  ],
  "user_capacity": {
    "blocks": 1000215216,
    "bytes": 512110190592
  },
  "logical_block_size": 512,
  "smart_support": {
    "available": true,
    "enabled": true
  },
  "smart_status": {
    "passed": true,
    "nvme": {
      "value": 0
    }
  },
  "nvme_smart_health_information_log": {
    "critical_warning": 0,
    "temperature": 39,
    "available_spare": 100,
    "available_spare_threshold": 10,
    "percentage_used": 2,
    "data_units_read": 77788198,
    "data_units_written": 53882918,
    "host_reads": 1089040374,
    "host_writes": 751165311,
    "controller_busy_time": 3261,
    "power_cycles": 1502,
    "power_on_hours": 6373,
    "unsafe_shutdowns": 185,
    "media_errors": 0,
    "num_err_log_entries": 9712,
    "warning_temp_time": 0,
    "critical_comp_time": 0,
    "temperature_sensors": [
      39,
      43
    ]
  },
  "temperature": {
    "current": 39
  },
  "power_cycle_count": 1502,
  "power_on_time": {
    "hours": 6373
  }
}

C:\Program Files\GSmartControl>smartctl.exe -j --all /dev/sdb
{
  "json_format_version": [
    1,
    0
  ],
  "smartctl": {
    "version": [
      7,
      3
    ],
    "svn_revision": "5338",
    "platform_info": "x86_64-w64-mingw32-w11-b25247",
    "build_info": "(sf-7.3-1)",
    "argv": [
      "smartctl",
      "-j",
      "--all",
      "/dev/sdb"
    ],
    "exit_status": 0
  },
  "local_time": {
    "time_t": 1669414327,
    "asctime": "Fri Nov 25 23:12:07 2022 SE"
  },
  "device": {
    "name": "/dev/sdb",
    "info_name": "/dev/sdb",
    "type": "nvme",
    "protocol": "NVMe"
  },
  "model_name": "KINGSTON SEDC1000M3840G",
  "serial_number": "50026B728XXXX",
  "firmware_version": "S68F0120",
  "nvme_pci_vendor": {
    "id": 9798,
    "subsystem_id": 9798
  },
  "nvme_ieee_oui_identifier": 9911,
  "nvme_total_capacity": 3840755982336,
  "nvme_unallocated_capacity": 0,
  "nvme_controller_id": 1,
  "nvme_version": {
    "string": "1.3",
    "value": 66304
  },
  "nvme_number_of_namespaces": 1,
  "nvme_namespaces": [
    {
      "id": 1,
      "size": {
        "blocks": 7501476528,
        "bytes": 3840755982336
      },
      "capacity": {
        "blocks": 7501476528,
        "bytes": 3840755982336
      },
      "utilization": {
        "blocks": 7501476528,
        "bytes": 3840755982336
      },
      "formatted_lba_size": 512,
      "eui64": {
        "oui": 9911,
        "ext_id": 172439069653
      }
    }
  ],
  "user_capacity": {
    "blocks": 7501476528,
    "bytes": 3840755982336
  },
  "logical_block_size": 512,
  "smart_support": {
    "available": true,
    "enabled": true
  },
  "smart_status": {
    "passed": true,
    "nvme": {
      "value": 0
    }
  },
  "nvme_smart_health_information_log": {
    "critical_warning": 0,
    "temperature": 31,
    "available_spare": 100,
    "available_spare_threshold": 10,
    "percentage_used": 0,
    "data_units_read": 67103406,
    "data_units_written": 60312101,
    "host_reads": 237642019,
    "host_writes": 246983288,
    "controller_busy_time": 29727,
    "power_cycles": 622,
    "power_on_hours": 4342,
    "unsafe_shutdowns": 56,
    "media_errors": 0,
    "num_err_log_entries": 0,
    "warning_temp_time": 0,
    "critical_comp_time": 0
  },
  "temperature": {
    "current": 31
  },
  "power_cycle_count": 622,
  "power_on_time": {
    "hours": 4342
  }
}

On Windows, CrystalDiskInfo could show the information of my Samsung NVME like any other disks. Both GsmartControl and Gnome Disks could not read it. nvme-cli could show the same data as Crystal. Well, I could use the command, but that is not as convenient as using the GUI. If dealing with NVME is too much work, how about just install nvme-cli as a dependency and simply call it and parse its output?

Anyway, since all modern laptops and desktops now use NVME as the main, if not the only, storage, I think NVME support really is needed.

My new laptop only has a nvme drive.

Any chance to support this format?

Any chance to support this format?

Read the 1st post.
Support in smartctl is still experimental.
You're welcome to supply a patch if you don't want to wait.

Hi , I will try doing it as soon as I will get enough time. :)

Could you kindly provide building and debugging information?

Edit: I managed how to build ir (with a bit of hacking for configure_dev script).

Any chance to support this format?

Read the 1st post. Support in smartctl is still experimental. You're welcome to supply a patch if you don't want to wait.

looks like the latest smartctl (7.4) recently released has full support for NVME. I just tested updating the smartctl version on the gsmartcontrol folder, and it will still show unknown driver, but if you run smartctl via cmd, I can get all stats correctly on Windows. Surprisingly, this even works for external USB Nvme, which other solutions fail to achieve (e.g. CrystalDiskInfo). Looking forward to support on the GUI.

I've got a USB to NVME adapter with a RTL9210 chipset, supported by smartctl, but the drive shows as "unknown model" in gsmartcontrol.
Attaching verbose output of gsmartcontrol and 3 invocations of smartctl (the drive is well recognized and displays all the info in the CLI, even in json format).
I have technical and programmation knowledge and am willing to help.
gsmartcontrol.txt
smartctl.txt

I made a nvme version with statistics and error log based on antonio-petricca's version. Could it be worth considering? (you can find my repository here, branch nvme-support)

I have started working on JSON and NVMe support.

Meanwhile, please attach as many JSON outputs as you can to this issue.
I'm looking for anything:

  • smartctl --json=o -x /dev/... and
  • smartctl --json=o --info --health --capabilities /dev/...
    outputs for any kind of drive - (S)ATA, NVMe, SCSI, USB, CD/DVD/Bluray, flash drives, etc.

Here's output for my SSD disk. I hope, it helps. smartctl.txt

I'm looking forward to the NVME support 🙂 Here are some more JSON outputs to help:
NVME SSDs: 1-x/1-i *, 2-x/2-i *, 3-x/3-i *
SATA SSDs: 1-x/1-i *, 2-x/2-i, 3-x/3-i
SATA HDDs: 1-x/1-i *, 2-x/2-i *
USB Flash Drives: 1-x/1-i †, 2-x/2-i †, 3-x/3-i †, 4-x/4-i
CD/DVD Drive: 1-x/1-i
MicroSD (via USB adapter): 1-x/1-i
USB 3.25" Floppy Drive: 1-x/1-i
SATA HDDs (via USB adapter): 1-x/1-i, 2-x/2-i, 3-x/3-i, 4-x/4-i (failed drive), 5-x/5-i
BMC Virtual Drives: 1-x/1-i (floppy) †, 2-x/2-i (HDD) †

* Serial number, WWN, and EUI64 have been redacted in these outputs
† Required adding the -d scsi argument to the command. Without this, the output looks like this: x/i

Thanks everyone for providing the outputs!

GSmartControl now fully supports NVMe drives (yay!), including self-tests.
There are minor things missing still (like attribute warnings), but I feel confident I can close this issue. Please open new issues if you find major problems.

Smartmontools 7.4 is required. Please note that NVMe support is still marked "experimental" in it.

Meanwhile, please help me test the "main" branch. There have been major changes in it (including defaulting to JSON parser for all drives).

help me test the "main" branch

A bit off-topic here, but I can't build it in my Arch Linux installation (tried GCC 13.2.1 and 14.1.1), it fails with the same error as GitHub Actions https://github.com/ashaduri/gsmartcontrol/actions/runs/9079753013/job/24949631989#step:5:38

A bit off-topic here, but I can't build it in my Arch Linux installation (tried GCC 13.2.1 and 14.1.1), it fails with the same error as GitHub Actions https://github.com/ashaduri/gsmartcontrol/actions/runs/9079753013/job/24949631989#step:5:38

Thanks, should be fixed now.