Opened 3 years ago

Last modified 2 years ago

#1215 closed defect

smartctl selects the wrong NVMe device — at Version 1

Reported by: bendreth Owned by:
Priority: major Milestone:
Component: all Version:
Keywords: nvme linux Cc:

Description (last modified by Christian Franke)

In the currently nightly, smartctl, when used on /dev/nvmeX rathern than /dev/nvmeXn1, selects the wrong device when two identical nvme modules are installed. Example:

# ls -l nvme-Samsung_SSD_970_EVO_2TB_S464NB0M200088N | cut -c40-
nvme-Samsung_SSD_970_EVO_2TB_S464NB0M200088N -> ../../nvme0n1
# ls -l nvme-Samsung_SSD_970_EVO_2TB_S464NB0M200161Y | cut -c40-
nvme-Samsung_SSD_970_EVO_2TB_S464NB0M200161Y -> ../../nvme1n1

# ./smartctl -a /dev/nvme0n1 | sed -n '1p;5,7p'
smartctl 7.1 2019-07-01 r4934 [x86_64-linux-4.18.0-24-generic] (local build)
Model Number:                       Samsung SSD 970 EVO 2TB
Serial Number:                      S464NB0M200088N
Firmware Version:                   2B2QEXE7
# ./smartctl -a /dev/nvme1n1 | sed -n '1p;5,7p'
smartctl 7.1 2019-07-01 r4934 [x86_64-linux-4.18.0-24-generic] (local build)
Model Number:                       Samsung SSD 970 EVO 2TB
Serial Number:                      S464NB0M200161Y
Firmware Version:                   2B2QEXE7

# ./smartctl -a /dev/nvme0 | sed -n '1p;5,7p'
smartctl 7.1 2019-07-01 r4934 [x86_64-linux-4.18.0-24-generic] (local build)
Model Number:                       Samsung SSD 970 EVO 2TB
Serial Number:                      S464NB0M200161Y
Firmware Version:                   2B2QEXE7
# ./smartctl -a /dev/nvme1 | sed -n '1p;5,7p'
smartctl 7.1 2019-07-01 r4934 [x86_64-linux-4.18.0-24-generic] (local build)
Model Number:                       Samsung SSD 970 EVO 2TB
Serial Number:                      S464NB0M200088N
Firmware Version:                   2B2QEXE7

Change History (1)

comment:1 Changed 3 years ago by Christian Franke

Description: modified (diff)
Keywords: nvme linux added
Milestone: undecided

Did it work with an older release on same machine?

Smartctl does not explicitly select a device, it simply accesses the pass-through I/O-control behind the specified device node. Are the major/minor device numbers correctly set for these nodes?

Please provide output of the following commands:

ls -l /dev/nvme*
egrep ':|nvme' /proc/devices

./smartctl -d nvme,0x1 -a /dev/nvme0 | sed -n '1p;5,7p'
Note: See TracTickets for help on using tickets.