1

I am running the sensors command in Ubuntu 20.04 to try and get a temperature reading for my NVME SSD drives. However, although I can see the drives I am not sure which one is which:

nvme-pci-2300
Adapter: PCI adapter
Composite:    +45.9°C  (low  =  -5.2°C, high = +79.8°C)
                       (crit = +84.8°C)

nvme-pci-6100
Adapter: PCI adapter
Composite:    +52.9°C  (low  = -273.1°C, high = +79.8°C)
                       (crit = +86.8°C)
Sensor 1:     +52.9°C  (low  = -273.1°C, high = +65261.8°C)
Sensor 2:     +51.9°C  (low  = -273.1°C, high = +65261.8°C)
Sensor 3:     +52.9°C  (low  = -273.1°C, high = +65261.8°C)

nvme-pci-2e00
Adapter: PCI adapter
Composite:    +51.9°C  (low  = -273.1°C, high = +81.8°C)
                       (crit = +84.8°C)
Sensor 1:     +51.9°C  (low  = -273.1°C, high = +65261.8°C)
Sensor 2:     +57.9°C  (low  = -273.1°C, high = +65261.8°C)

The only obvious difference between each of these is the number that comes after nvme-pci- but these don't seem to correspond to my model numbers and Googling them just results in a whole load of different models and brands.

I tried running lspci and lsblk in the hope that there would be something else to help me to link these numbers to the devices but there is not.

In short, I just want to know with absolute certainty the temperature of each NVME SSD device in my system.

1
  • 1
    @anx Yes, you are absolutely right. I was way too focused on trying to get the info from the sensors command! If you'd like to post this as an answer then I will mark it as correct. – Joseph Jun 14 at 13:11
1

The folders in the respective /sys/class/hwmon/hwmon*/ contain a device/ symlink that points to the device the sensor is registered with. After enumerating the sensors you can retrieve vendor, path or serial from that subfolder (e.g. start with /sys/class/hwmon/hwmon*/device/modalias).

Instead of working around the output format of sensors or reading sysfs yourself, you probably want to use SMART interface, which is much more specifically designed to deal with drives, e.g.

smartctl -a /dev/disk/by-id/vendor_serial

Each invocation of smartctl will give you one set of status & temperatures, and you probably already have integration for SMART in your monitoring toolbox anyway.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.