I want to test the health of my disk and I am reading this wiki https://wiki.archlinux.org/title/Smartctl
I run this command # smartctl --info /dev/nvme0n1 | grep 'SMART support is:' but no output in terminal. It means support not available?
But when I run #inxi -Daz it shows SMART: yes
Local Storage: total: 931.51 GiB used: 348.14 GiB (37.4%)
ID-1: /dev/nvme0n1 maj-min: 259:0 vendor: Samsung
model: SSD 970 EVO Plus 1TB size: 931.51 GiB block-size: physical: 512 B
logical: 512 B speed: 31.6 Gb/s lanes: 4 tech: SSD serial: <filter>
fw-rev: 4B2QEXM7 temp: 35.9 C scheme: GPT
SMART: yes health: PASSED on: 34d 2h cycles: 5,350
read-units: 14,696,762 [7.52 TB] written-units: 19,403,533 [9.93 TB]
Please help me understand this and tell me how I can test the health of ssd if commands in wiki not available for this ssd. Thank you so much!
Just running smartctl -i /dev/nvme0n1 gives you the information for this drive. The line which grep is looking for is not there for NVMe devices, that’s why your command fails.
This looks OK, it’s just the information (-i) or all information, including logs etc ( -a).
What you really want is to see if the self-test passes with ‘OK’.
Try smartctl -t short /dev/nvme0n1 first to see if this works. With NVMe devices, you might need a different approach. Come back with the result of smartctl -l selftest after you ran the test, or the error message if it won’t run the test.
Yup, expected as much. Same here. Install the NVMe tools with sudo pacman -S nvme-cli.
Then sudo nvme device-self-test /dev/nvme0n1 -s 1 for the short or -s 2 for the extended test.
Get the output with sudo nvme self-test-log /dev/nvme0n1 | head -n 9. You should get something like
Device Self Test Log for NVME device:nvme0n1
Current operation : 0
Current Completion : 0%
Self Test Result[0]:
Operation Result : 0
Self Test Code : 2
Valid Diagnostic Information : 0
Power on hours (POH) : 0x10
Vendor Specific : 0 0
Operation result 0 means test is passed with OK, line 2 is type of test (after the -s from the last command).
nvme self-test-log /dev/nvme0n1 | head -n 9
Device Self Test Log for NVME device:nvme0n1
Current operation : 0
Current Completion : 0%
Self Test Result[0]:
Operation Result : 0
Self Test Code : 2
Valid Diagnostic Information : 0
Power on hours (POH) : 0x332
Vendor Specific : 0 0
smartctl -d nvme,0xffffffff -t short /dev/nvme0n1
smartctl 7.4 2023-08-01 r5530 [x86_64-linux-6.6.1-zen1-1-zen] (local build)
Copyright (C) 2002-23, Bruce Allen, Christian Franke, www.smartmontools.org
Self-test has begun
Use smartctl -X to abort test