5

How do you check the health of an NVMe ssd using smartctl on Ubuntu?

My laptop, which has a NVMe solid state drive, has been crashing somewhat frequently recently with strange disk read errors. Fortunately, rebooting has temporarily resolved the issue, but I'm trying confirm that the issue is a degraded ssd and not something else, like a faulty motherboard.

The general usage for smartctl is to run something like:

sudo smartctl -i /dev/sdX

However, NVMe don't mount like that. They're mounted using the nvm* prefix and with an extra layer of mount points, showing:

ls -lah /dev/nv*
crw------- 1 root root 238,   0 Oct 31 10:11 /dev/nvme0
brw-rw---- 1 root disk 259,   0 Oct 31 10:11 /dev/nvme0n1
brw-rw---- 1 root disk 259,   1 Oct 31 10:11 /dev/nvme0n1p1
brw-rw---- 1 root disk 259,   2 Oct 31 10:11 /dev/nvme0n1p2
brw-rw---- 1 root disk 259,   3 Oct 31 10:11 /dev/nvme0n1p3
crw------- 1 root root  10, 144 Oct 31 10:11 /dev/nvram

Which of these do I check? The /dev/nvme0n1p2 is my primary data partition, but I also want to make sure the others aren't corrupt, so presumably I would want to check one of the "parent" partitions.

Do I check /dev/nvme0 or /dev/nvme0n1?

2 Answers 2

10

/dev/nvme0 represents the raw device and is the "control" device node that you use to configure the hardware, while /dev/nvme0n1 represents the block-storage – or a chunk thereof. (Specifically, nvme0n1 is a namespace – a logical division similar to partitions but at "hardware" level, slightly similar to SCSI LUNs. A single NVMe device could in theory have several namespaces with e.g. different encryption settings.)

In general, SMART information (and any other kind of hardware status) is global to the device, so using the nvme0 node would be more appropriate, but in current Linux versions both the control device and the block-storage devices will accept SMART ioctls all the same. (Especially on consumer SSDs where only one namespace is ever going to be present.)

(Also: Those are not mountpoints – they're device nodes. The directory that something is mounted on becomes a mountpoint, such as /home.)

2

You seem to have a misconception of the capabilities of SMART.

SMART is not for checking partitions, but for checking hardware drives for their physical stats/errors. It will make no difference if you run smartctl on /dev/sda or /dev/sda1, the output will always reference the physical drive /dev/sda.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .