Get S.M.A.R.T Information for the Transcend Embedded SATA/NVMe SSD product.
This sample code demonstrates how to get the disk information of the solid state drives (SSD) in Linux,
include identify information (model name, firmware version and serial number, etc.) ,
S.M.A.R.T information (temperature, erase count and power-on hours, etc.) and Health information.
Note : The project works for Transcend Embedded SSD products.
- compile the executable file
g++ -Wformat=0 -std=c++11 -static main.cpp nvme_util.cpp -o SMARTQuery_Cmd
- use <chmod +x> for sure you have proper right to execute the executable file
chmod +x SMARTQuery_Cmd
sudo ./SMARTQuery_Cmd
-
SMARTQuery_Cmd
show all information of devices -
SMARTQuery_Cmd [option] <device>
show specific information of the device by option- Options:
- -all: list all information of the device
- -id: get id table information of the device
- -smart: get S.M.A.R.T table information of the device
- -health: get the health information of the device
- -license: display the End User License Agreement and Statement
- -v: display the application version
- Options:
For NVMe SSD :
sudo ./SMARTQuery_Cmd [option] /dev/nvme0n1
For SATA SSD :
sudo ./SMARTQuery_Cmd [option] /dev/sda
Get ID , SMART and Health information by following command for NVMe SSD.
Get ID , SMART and Health information by following command for SATA SSD.