How can I configure Smartmontools in a server with SSD NVMe?

I have server with two SSD NVMe in RAID1. This server have CloudLinux and cPanel, and he installed automatically Smartmontools.

What command I need use for Smartmontools monitorize the SSD?:

-This?: smartctl -i /dev/nvme0n1

-Or this?: smartctl -i /dev/nvme0

I don't know which is the correct SSD name, in servers with Hard Disk I always use "/dev/sda" and "/dev/sdb".

Other thing please: Smartmontools and mdadm are doing same tasks?, or do different tasks?


Solution 1:

Both smartctl -i /dev/nvme0n1 and smartctl -i /dev/nvme0 should produce the same results. NVMe drives support "namespaces", which is a little like partitioning a drive. Unless you've done something creative, your drive has one namespace, "n1". The wear levelling and other SMART statistics will be the same for all namespaces.

mdadm is the interface to the Linux kernel's software RAID feature. By using RAID 1, you are mirroring the contents of the two SSDs, such that you have two copies of everything written. If one of your SSD's fails, such that it no longer accepts writes or reads, the Linux kernel will "fail" it out of your RAID 1. You will then use mdadm to administer the RAID array, replacing the drive as soon as you possibly can.

Smartmontools report on the condition of your disks using a variety of metrics that drive manufacturers have built up over the years. SMART statistics are leading indicators of failure. By monitoring them, you might predict when your drive may fail. Then, before it fails on its own, you can use mdadm to fail the drive out of your array and replace it with a new drive, in a controlled fashion, on your own schedule.