Good day.
I want to draw the community's attention to a characteristic feature of Linux when working with multiple NVMe SSDs in one system. This will be particularly relevant for those who enjoy creating software RAID arrays from NVMe devices.
I hope the information provided below will help protect your data and prevent annoying mistakes.
We are all used to the following logic in Linux when working with block devices:
If a device is named /dev/sda, then the partitions on it will be /dev/sda1, /dev/sda2, and so on.
To view SMART attributes, we use something like smartctl -a /dev/sda, and we format and add the partitions to the arrays, like /dev/sda1.
We all accept the axiom that /dev/sda1 resides on /dev/sda. And if one day SMART indicates that /dev/sda is nearly dead, it is precisely /dev/sda1 that we would replace in the RAID array.
It turns out that when working with NVMe Namespaces, this rule does not apply. Proof:
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 Samsung SSD 970 EVO 500GB 1 96.92 GB / 500.11 GB 512 B + 0 B 1B2QEXE7
/dev/nvme1n1 S466NX0K43XX48W Samsung SSD 970 EVO 500GB 1 91.00 GB / 500.11 GB 512 B + 0 B 1B2QEXE7
/dev/nvme2n1 S466NX0K72XX01A Samsung SSD 970 EVO 500GB 1 0.00 B / 500.11 GB 512 B + 0 B 1B2QEXE7
Serial Number: S466NX0K72XX06M
Serial Number: S466NX0K72XX01A
Serial Number: S466NX0K43XX48W
A careful reader will notice from the comparison of serial numbers that /dev/nvme1n1 is actually located on /dev/nvme2, and vice versa.
P.S.
I wish you never have to remove the last working NVMe SSD from the RAID array.
Source: habr.com
