There is a home page for smartmontools.
Install the tools:
apt install smartmontools
Scan for drives:
# smartctl --scan
/dev/sda -d sat # /dev/sda [SAT], ATA device
/dev/sdb -d sat # /dev/sdb [SAT], ATA device
/dev/sdf -d scsi # /dev/sdf, SCSI device
# smartctl --scan -d nvme
/dev/nvme0 -d nvme # /dev/nvme0, NVMe device
Check the drives for SMART support. nvme drives don't have SMART support, but are available to the tools:
# smartctl -i /dev/nvme0n1
smartctl 6.6 2016-05-31 r4324 [x86_64-linux-4.12.0-2-amd64] (local build)
Copyright (C) 2002-16, Bruce Allen, Christian Franke, www.smartmontools.org
=== START OF INFORMATION SECTION ===
Model Number: Samsung SSD 960 PRO 512GB
Serial Number: S3EWNWAJ200309M
Firmware Version: 1B6QCXP7
PCI Vendor/Subsystem ID: 0x144d
IEEE OUI Identifier: 0x002538
Total NVM Capacity: 512,110,190,592 [512 GB]
Unallocated NVM Capacity: 0
Controller ID: 2
Number of Namespaces: 1
Namespace 1 Size/Capacity: 512,110,190,592 [512 GB]
Namespace 1 Utilization: 31,038,529,536 [31.0 GB]
Namespace 1 Formatted LBA Size: 512
Local Time is: Sun Sep 24 18:29:43 2017 ADT
But many regular drives do:
# smartctl -i /dev/sdf
smartctl 6.6 2016-05-31 r4324 [x86_64-linux-4.12.0-2-amd64] (local build)
Copyright (C) 2002-16, Bruce Allen, Christian Franke, www.smartmontools.org
=== START OF INFORMATION SECTION ===
Model Family: Samsung based SSDs
Device Model: Samsung SSD 850 EVO 1TB
Serial Number: S35UNX0J102403N
LU WWN Device Id: 5 002538 d419eca15
Firmware Version: EMT02B6Q
User Capacity: 1,000,204,886,016 bytes [1.00 TB]
Sector Size: 512 bytes logical/physical
Rotation Rate: Solid State Device
Form Factor: 2.5 inches
Device is: In smartctl database [for details use: -P show]
ATA Version is: ACS-2, ATA8-ACS T13/1699-D revision 4c
SATA Version is: SATA 3.1, 6.0 Gb/s (current: 6.0 Gb/s)
Local Time is: Sun Sep 24 18:33:20 2017 ADT
SMART support is: Available - device has SMART capability.
SMART support is: Enabled
Configurations can be changed in /etc/smartd.conf. Change the -m parameter to customize an email address.
/dev/nvme0n1 -a -H -S on -d nvme -m xxx
/dev/sda -a -H -S on -d sat -m xxx
/dev/sdb -a -H -S on -d sat -m xxx
/dev/sdf -a -H -S on -d sat -m xxx
Enable the service by uncommenting "start_smartd=yes" in /etc/default/smartmontools.
Then start the service: systemctl start smartmontools
Running a manual self test:
# smartctl -t short /dev/sdb
smartctl 6.6 2016-05-31 r4324 [x86_64-linux-4.12.0-2-amd64] (local build)
Copyright (C) 2002-16, Bruce Allen, Christian Franke, www.smartmontools.org
=== START OF OFFLINE IMMEDIATE AND SELF-TEST SECTION ===
Sending command: "Execute SMART Short self-test routine immediately in off-line mode".
Drive command "Execute SMART Short self-test routine immediately in off-line mode" successful.
Testing has begun.
Please wait 1 minutes for test to complete.
Test will complete after Sun Sep 24 19:24:05 2017
Use smartctl -X to abort test.
# smartctl -l selftest /dev/sdb
smartctl 6.6 2016-05-31 r4324 [x86_64-linux-4.12.0-2-amd64] (local build)
Copyright (C) 2002-16, Bruce Allen, Christian Franke, www.smartmontools.org
=== START OF READ SMART DATA SECTION ===
SMART Self-test log structure revision number 1
Num Test_Description Status Remaining LifeTime(hours) LBA_of_first_error
# 1 Short offline Self-test routine in progress 20% 29 -
# smartctl -l selftest /dev/sdb
smartctl 6.6 2016-05-31 r4324 [x86_64-linux-4.12.0-2-amd64] (local build)
Copyright (C) 2002-16, Bruce Allen, Christian Franke, www.smartmontools.org
=== START OF READ SMART DATA SECTION ===
SMART Self-test log structure revision number 1
Num Test_Description Status Remaining LifeTime(hours) LBA_of_first_error
# 1 Short offline Completed without error 00% 29 -
# smartctl -l error /dev/sdb
smartctl 6.6 2016-05-31 r4324 [x86_64-linux-4.12.0-2-amd64] (local build)
Copyright (C) 2002-16, Bruce Allen, Christian Franke, www.smartmontools.org
=== START OF READ SMART DATA SECTION ===
SMART Error Log Version: 1
No Errors Logged
A list of everything on an nvme drive, but doesn't seem to be picked up by the smartd service, by default, but with a specific configuration, as listed previously, will be monitored by the service:
# smartctl -x /dev/nvme0n1
smartctl 6.6 2016-05-31 r4324 [x86_64-linux-4.12.0-2-amd64] (local build)
Copyright (C) 2002-16, Bruce Allen, Christian Franke, www.smartmontools.org
=== START OF INFORMATION SECTION ===
Model Number: Samsung SSD 960 PRO 512GB
Serial Number: S3EWNWAJ200309M
Firmware Version: 1B6QCXP7
PCI Vendor/Subsystem ID: 0x144d
IEEE OUI Identifier: 0x002538
Total NVM Capacity: 512,110,190,592 [512 GB]
Unallocated NVM Capacity: 0
Controller ID: 2
Number of Namespaces: 1
Namespace 1 Size/Capacity: 512,110,190,592 [512 GB]
Namespace 1 Utilization: 31,038,529,536 [31.0 GB]
Namespace 1 Formatted LBA Size: 512
Local Time is: Sun Sep 24 18:59:20 2017 ADT
Firmware Updates (0x16): 3 Slots, no Reset required
Optional Admin Commands (0x0007): Security Format Frmw_DL
Optional NVM Commands (0x001f): Comp Wr_Unc DS_Mngmt Wr_Zero Sav/Sel_Feat
Maximum Data Transfer Size: 512 Pages
Warning Comp. Temp. Threshold: 73 Celsius
Critical Comp. Temp. Threshold: 76 Celsius
Supported Power States
St Op Max Active Idle RL RT WL WT Ent_Lat Ex_Lat
0 + 6.90W - - 0 0 0 0 0 0
1 + 5.50W - - 1 1 1 1 0 0
2 + 5.10W - - 2 2 2 2 0 0
3 - 0.0500W - - 3 3 3 3 210 1200
4 - 0.0080W - - 4 4 4 4 2000 6000
Supported LBA Sizes (NSID 0x1)
Id Fmt Data Metadt Rel_Perf
0 + 512 0 0
=== START OF SMART DATA SECTION ===
SMART overall-health self-assessment test result: PASSED
SMART/Health Information (NVMe Log 0x02, NSID 0x1)
Critical Warning: 0x00
Temperature: 40 Celsius
Available Spare: 100%
Available Spare Threshold: 10%
Percentage Used: 0%
Data Units Read: 389,879 [199 GB]
Data Units Written: 1,939,611 [993 GB]
Host Read Commands: 3,489,454
Host Write Commands: 9,432,811
Controller Busy Time: 104
Power Cycles: 196
Power On Hours: 451
Unsafe Shutdowns: 36
Media and Data Integrity Errors: 0
Error Information Log Entries: 66
Warning Comp. Temperature Time: 0
Critical Comp. Temperature Time: 0
Temperature Sensor 1: 40 Celsius
Temperature Sensor 2: 48 Celsius
Simple manual health check:
# smartctl -H /dev/nvme0
smartctl 6.6 2016-05-31 r4324 [x86_64-linux-4.12.0-2-amd64] (local build)
Copyright (C) 2002-16, Bruce Allen, Christian Franke, www.smartmontools.org
=== START OF SMART DATA SECTION ===
SMART overall-health self-assessment test result: PASSED
2018/04/15 On an HP DL360 G6 server with P410i card running SAS 15K drives with 4.14 kernel, which uses hpsa driver, here is a sample command for seeing the drives on the controller. NOTE: HP drives will be required, as they have the firmware to talk to the controller.
# smartctl -a -d cciss,2 /dev/sg0
smartctl 6.6 2016-05-31 r4324 [x86_64-linux-4.14.0-0.bpo.3-amd64] (local build)
Copyright (C) 2002-16, Bruce Allen, Christian Franke, www.smartmontools.org
=== START OF INFORMATION SECTION ===
Vendor: HP
Product: EH0146FARWD
Revision: HPDD
User Capacity: 146,815,737,856 bytes [146 GB]
Logical block size: 512 bytes
Rotation Rate: 15030 rpm
Form Factor: 2.5 inches
Logical Unit id: 0x5000cca00bc4861c
Serial number: PLYH2J1E
Device type: disk
Transport protocol: SAS (SPL-3)
Local Time is: Sun Apr 15 21:01:11 2018 UTC
SMART support is: Available - device has SMART capability.
SMART support is: Enabled
Temperature Warning: Enabled
=== START OF READ SMART DATA SECTION ===
SMART Health Status: OK
Current Drive Temperature: 29 C
Drive Trip Temperature: 65 C
Manufactured in week 11 of year 2013
Specified cycle count over device lifetime: 50000
Accumulated start-stop cycles: 52
Elements in grown defect list: 0
Vendor (Seagate) cache information
Blocks sent to initiator = 65447533740032
Error counter log:
Errors Corrected by Total Correction Gigabytes Total
ECC rereads/ errors algorithm processed uncorrected
fast | delayed rewrites corrected invocations [10^9 bytes] errors
read: 0 172383 0 172383 0 32707.187 0
write: 0 17647 0 17647 0 289.906 0
Non-medium error count: 155
SMART Self-test log
Num Test Status segment LifeTime LBA_first_err [SK ASC ASQ]
Description number (hours)
# 1 Background short Completed - 390 - [- - -]
# 2 Background short Completed - 48 - [- - -]
# 3 Background short Completed - 48 - [- - -]
# 4 Background short Completed - 18 - [- - -]
# 5 Background short Completed - 14 - [- - -]
# 6 Background short Completed - 7 - [- - -]
# 7 Background short Completed - 6 - [- - -]
# 8 Background short Completed - 2 - [- - -]
# 9 Background short Completed - 1 - [- - -]
Long (extended) Self Test duration: 1394 seconds [23.2 minutes]
There are four drives in my system, so the four commands would be:
# smartctl -a -d cciss,0 /dev/sg0
# smartctl -a -d cciss,1 /dev/sg0
# smartctl -a -d cciss,2 /dev/sg0
# smartctl -a -d cciss,3 /dev/sg0