Opened 6 months ago

Last modified 4 months ago

#1741 new defect

nvme self test commands fail when specifying a namespace

Reported by: Matthew Eaton Owned by:
Priority: minor Milestone: undecided
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)

smartctl-x-nvme0.txt (3.6 KB ) - added by Matthew Eaton 6 months ago.
smartctl-x-nvme0n1.txt (3.0 KB ) - added by Matthew Eaton 6 months ago.

Download all attachments as: .zip

Change History (6)

comment:1 by Christian Franke, 6 months ago

Milestone: undecided

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.

by Matthew Eaton, 6 months ago

Attachment: smartctl-x-nvme0.txt added

by Matthew Eaton, 6 months ago

Attachment: smartctl-x-nvme0n1.txt added

comment:2 by Matthew Eaton, 6 months ago

Attached smartctl -x output for /dev/nvme0 and /dev/nvme0n1.

comment:3 by Mark Thompson, 5 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:4 by Christian Franke, 4 months ago

Related or duplicate: GH issues/217.

Note: See TracTickets for help on using tickets.