Linux NVMe setup

Linux NVMe setup


Good day.

Wanted to draw the community's attention on the characteristic feature of Linux when working with multiple NVMe SSD in the same system. Especially important will be for those who like to do from NVMe software RAID arrays.

We hope that the information presented below will help protect your data and get rid of annoying bugs.

We are all accustomed to following the logic of Linux when working with block devices:
If the device is/dev/sda then the partition will be/dev/sda1,/dev/sda2, etc.
To view the SMART attributes we use something like smartctl -a/dev/sda and formatted, and arrays already added partitions like/dev/sda1.

We are all accustomed to the axiom that/dev/sda1 is on/dev/sda. And if one day, SMART will reveal that/dev/sda's nearly dead — it is/dev/sda1 we will be thrown out of a RAID array at a replacement.

It turns out that when working with NVMe Namespaces this rule does not work. Proof:

the
nvme list && ( smartctl -a/dev/nvme0 && smartctl -a/dev/nvme1 && smartctl -a/dev/nvme2 ) | grep Serial
Node SN Model Namespace Usage Format FW Rev 
---------------- -------------------- ---------------------------------------- --------- -------------------------- ---------------- --------/dev/nvme0n1 S466NX0K72XX06M 970 Samsung SSD EVO 500GB 1 96.92 GB/500.11 GB 512 B + 0 B 1B2QEXE7/dev/nvme1n1 S466NX0K43XX48W 970 Samsung SSD EVO 500GB 1 91.00 GB/500.11 GB 512 B + 0 B 1B2QEXE7/dev/nvme2n1 S466NX0K72XX01A 970 Samsung SSD EVO 500GB 1 0.00 B/500.11 GB 512 B + 0 B 1B2QEXE7
Serial Number: S466NX0K72XX06M
Serial Number: S466NX0K72XX01A
Serial Number: S466NX0K43XX48W

The attentive reader on the serial numbers will notice that/dev/nvme1n1 in fact is on/dev/nvme2 and Vice versa.

R. S.

I wish you never to remove from the RAID array last living NVMe SSD.

Source text: Linux NVMe setup