NVMe drives don’t make noise when they start to fail, so I like having a quick way to look at their wear. The nvme-cli package has one command for it.
Install nvme-cli from your distribution, then run:
sudo nvme smart-log /dev/nvme0
The output is a short list of counters read from the drive itself. The ones I’d look at first are critical_warning (should be 0), temperature, available_spare, percentage_used and media_errors. percentage_used is the drive’s own estimate of how much of its rated endurance is gone, and data_units_written tells you how much has been written over its life.
Use the controller device (/dev/nvme0), not a namespace like /dev/nvme0n1, if your version complains. nvme list shows what is installed.
A caveat: the percentage is an estimate by the manufacturer’s firmware and it can go past 100 on a drive that keeps working. Treat it as a trend to watch, not a deadline. The unit of data_units_written is also odd: one unit is 1000 blocks of 512 bytes, so multiply before comparing it with the TBW rating in the datasheet.
If you already use smartmontools, smartctl -a /dev/nvme0 shows much the same data in a different layout.
Further reading: nvme-cli on GitHub, nvme-smart-log man page