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 - - - - -
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.