[smartmontools-support] nvme drive partial support

Christian Franke Christian.Franke at t-online.de
Fri Nov 13 08:34:40 CET 2020


Kwon-Young Choi wrote:
>> ... smartctl ... /dev/nvme0n1 ..
>> ... nvme ....... /dev/nvme0 ....
>>
>> Please retry both with device names swapped.
> Sorry for the confusion. Here is the output of `smartctl` with `/dev/nvme0`:
>
> ```
> $ sudo LANG= /usr/sbin/smartctl -l error /dev/nvme0 -r ioctl
> [sudo] Mot de passe de kwon-young :
> smartctl 7.1 2019-12-30 r5022 [x86_64-linux-5.9.3-1-MANJARO] (local build)
> Copyright (C) 2002-19, Bruce Allen, Christian Franke, www.smartmontools.org
>
>   [NVMe call: opcode=0x06, size=0x1000, nsid=0x00000000, cdw10=0x00000001]
>    [Duration: 0.002s]
>   [NVMe call succeeded: result=0x00000000]
> === START OF SMART DATA SECTION ===
>   [NVMe call: opcode=0x02, size=0x3fc0, nsid=0xffffffff, cdw10=0x0fef0001]
>    [Duration: 121.692s]
>   [NVMe call failed: NVME_IOCTL_ADMIN_CMD: Interrupted system call]
> Read Error Information Log failed: NVME_IOCTL_ADMIN_CMD: Interrupted
> system call
> ```
>
> and the output of `nvme` with `/dev/nvme0n1`:
>
> ```
> $ sudo nvme get-log /dev/nvme0n1 --log-id=1 --log-len=1024
> Device:nvme0n1 log-id:1 namespace-id:0xffffffff
>         0  1  2  3  4  5  6  7  8  9  a  b  c  d  e  f
> 0000: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 "................"
> ...
> 03f0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 "................"
> ```


There is actually a bug in smartctl.

The difference in the commands above is the size read from the log. In 
the early days of smartctl NVMe support (2016), I decided to always read 
the full log regardless of the desired print size - and unfortunately 
introduced a bug: smartctl reads too many (64) bytes from the log. Most 
drives behave polite and return extra 64 null bytes.

I will fix this soon.

If the above assumption is true, the following should fail:

$ sudo nvme get-log /dev/nvme0 --log-id=1 --log-len=16320

but the following should work - and produce a long hexdump with all 
zeroes, please don't paste it to the list :-)

$ sudo nvme get-log /dev/nvme0 --log-id=1 --log-len=16256


Thanks,
Christian



More information about the Smartmontools-support mailing list