#1741 closed defect (fixed)
nvme self test commands fail when specifying a namespace
Reported by: | Matthew Eaton | Owned by: | Christian Franke |
---|---|---|---|
Priority: | minor | Milestone: | Release 7.5 |
Component: | smartctl | Version: | 7.4 |
Keywords: | nvme | Cc: |
Description
The nvme self test commands in smartctl fail with a non-zero retval when specifying a namespace (e.g. /dev/nvme0n1). These commands work when specifying the character device (e.g. /dev/nvme0). This issue also affects other smartctl functionality that implies -l selftest.
# smartctl -t short /dev/nvme0n1 smartctl 7.4 2023-08-01 r5530 [x86_64-linux-5.15.0-79-generic] (local build) Copyright (C) 2002-23, Bruce Allen, Christian Franke, www.smartmontools.org Read Self-test Log failed: Invalid Field in Command (0x002)
# smartctl -t short /dev/nvme0 smartctl 7.4 2023-08-01 r5530 [x86_64-linux-5.15.0-79-generic] (local build) Copyright (C) 2002-23, Bruce Allen, Christian Franke, www.smartmontools.org Self-test has begun Use smartctl -X to abort test
# smartctl -l selftest /dev/nvme0n1 smartctl 7.4 2023-08-01 r5530 [x86_64-linux-5.15.0-79-generic] (local build) Copyright (C) 2002-23, Bruce Allen, Christian Franke, www.smartmontools.org === START OF SMART DATA SECTION === Read Self-test Log failed: Invalid Field in Command (0x002)
# smartctl -l selftest /dev/nvme0 smartctl 7.4 2023-08-01 r5530 [x86_64-linux-5.15.0-79-generic] (local build) Copyright (C) 2002-23, Bruce Allen, Christian Franke, www.smartmontools.org === START OF SMART DATA SECTION === Self-test Log (NVMe Log 0x06) Self-test status: Short self-test in progress (31% completed) Num Test_Description Status Power_on_Hours Failing_LBA NSID Seg SCT Code 0 Short Completed without error 962 - - - - - 1 Short Completed without error 962 - - - - - 2 Short Completed without error 962 - - - - -
Attachments (2)
Change History (17)
comment:1 by , 15 months ago
Milestone: | → undecided |
---|
by , 15 months ago
Attachment: | smartctl-x-nvme0.txt added |
---|
by , 15 months ago
Attachment: | smartctl-x-nvme0n1.txt added |
---|
comment:3 by , 14 months ago
I believe the proper name is 'nvme0'. Rationale: 'nvme0n1' is the first namespace, however 'nvme0' is the first registered device controller. If you use 'nvme0n1' I suspect there is no Self-test Log Data for this namespace, however the device controller does have the requested data. I suspect the invalid command is genuine and the function should not be changed.
comment:5 by , 8 months ago
Milestone: | undecided → Release 7.5 |
---|---|
Owner: | set to |
Status: | new → accepted |
comment:8 by , 8 months ago
If possible, please test a recent CI build from https://builds.smartmontools.org/
comment:13 by , 4 weeks ago
r5627 reverts parts of r5603 because my original assumption was possibly wrong. The broadcast NSID is needed to read the self-test log. Starting a test with NSID=1 should also work with single namespace devices. This matches with NVMe specs.
If possible, please re-test -t short
and -l selftest
with smartctl r5627 or later. Feel free to reopen this ticket if this does no longer work.
See https://builds.smartmontools.org/ for various binaries.
comment:14 by , 4 weeks ago
I re-tested on r5629 and confirmed this issue is still fixed. Thanks!
# smartctl -t short /dev/nvme0n1 ; echo $? smartctl pre-7.5 2024-10-23 r5629 [x86_64-linux-6.8.0-45-generic] (local build) Copyright (C) 2002-24, Bruce Allen, Christian Franke, www.smartmontools.org Self-test has begun (NSID 0x1) Use smartctl -X to abort test 0
# smartctl -l selftest /dev/nvme0n1 ; echo $? smartctl pre-7.5 2024-10-23 r5629 [x86_64-linux-6.8.0-45-generic] (local build) Copyright (C) 2002-24, Bruce Allen, Christian Franke, www.smartmontools.org === START OF SMART DATA SECTION === Self-test Log (NVMe Log 0x06, NSID 0xffffffff) Self-test status: Short self-test in progress (63% completed) Num Test_Description Status Power_on_Hours Failing_LBA NSID Seg SCT Code 0 Short Completed without error 277 - - - - - 0
# smartctl -l selftest /dev/nvme0n1 ; echo $? smartctl pre-7.5 2024-10-23 r5629 [x86_64-linux-6.8.0-45-generic] (local build) Copyright (C) 2002-24, Bruce Allen, Christian Franke, www.smartmontools.org === START OF SMART DATA SECTION === Self-test Log (NVMe Log 0x06, NSID 0xffffffff) Self-test status: No self-test in progress Num Test_Description Status Power_on_Hours Failing_LBA NSID Seg SCT Code 0 Short Completed without error 277 - - - - - 1 Short Completed without error 277 - - - - - 0
Please provide a full
smartctl -x
output for this device.NVMe specs allow NSID 0 (controller only, not yet supported by smartctl), broadcast NSID and individual NSIDs for the Device Self-test command. This firmware does not support the latter.