wiki/HowtoSmart.md

220 lines
7.6 KiB
Markdown
Raw Normal View History

2017-11-28 16:37:43 +01:00
---
categories: hardware storage
2017-11-28 16:47:05 +01:00
title: Howto SMART
2017-11-28 16:37:43 +01:00
...
2017-11-28 16:47:05 +01:00
Documentation : <https://www.smartmontools.org/wiki/TocDoc>
2017-12-04 09:37:32 +01:00
[SMART](https://fr.wikipedia.org/wiki/Self-Monitoring,_Analysis_and_Reporting_Technology) (Self-Monitoring, Analysis and Reporting Technology) est intégrée à la plupart des disques durs pour avoir des indicateurs de diagnostic. Sous Linux/Unix, [Smartmontools](https://www.smartmontools.org/) est l'outil pour exploiter la technologie SMART, notamment avec la commande `smartctl` et le démon `smartd`.
2017-11-28 16:47:05 +01:00
2017-11-28 16:37:43 +01:00
2017-12-04 09:37:32 +01:00
## Installation
2017-11-28 16:47:05 +01:00
2017-11-28 16:37:43 +01:00
~~~
# apt install smartmontools
2017-12-04 09:37:32 +01:00
$ /usr/sbin/smartctl -V
smartctl 6.6 2016-05-31 r4324 [x86_64-linux-4.9.0-4-amd64] (local build)
[...]
smartmontools release 6.6 dated 2016-05-07 at 11:17:46 UTC
smartmontools SVN rev 4324 dated 2016-05-31 at 20:45:50
smartmontools build host: x86_64-pc-linux-gnu
smartmontools build with: C++98, GCC 5.4.0 20160609
[...]
# systemctl status smartd
● smartd.service - Self Monitoring and Reporting Technology (SMART) Daemon
Loaded: loaded (/lib/systemd/system/smartd.service; enabled; vendor preset: enabled)
Docs: man:smartd(8)
man:smartd.conf(5)
2017-11-28 16:37:43 +01:00
~~~
2017-12-04 09:37:32 +01:00
2017-11-28 16:37:43 +01:00
## Utilisation
### Lister les disques
Sur une machine avec un seul disque :
~~~
# smartctl --scan
/dev/sda -d scsi # /dev/sda, SCSI device
~~~
Sur une machine avec du RAID hardware :
~~~
# smartctl --scan
/dev/hdd -d ata # /dev/hdd, ATA device
/dev/sda -d scsi # /dev/sda, SCSI device
/dev/sdb -d scsi # /dev/sdb, SCSI device
/dev/sdc -d scsi # /dev/sdc, SCSI device
/dev/bus/0 -d megaraid,0 # /dev/bus/0 [megaraid_disk_00], SCSI device
/dev/bus/0 -d megaraid,1 # /dev/bus/0 [megaraid_disk_01], SCSI device
/dev/bus/0 -d megaraid,2 # /dev/bus/0 [megaraid_disk_02], SCSI device
/dev/bus/0 -d megaraid,3 # /dev/bus/0 [megaraid_disk_03], SCSI device
/dev/bus/0 -d megaraid,4 # /dev/bus/0 [megaraid_disk_04], SCSI device
/dev/bus/0 -d megaraid,5 # /dev/bus/0 [megaraid_disk_05], SCSI device
/dev/bus/0 -d megaraid,6 # /dev/bus/0 [megaraid_disk_06], SCSI device
~~~
2017-12-01 12:00:58 +01:00
### Voir les informations sur un disque
2017-12-04 09:37:32 +01:00
L'option `-i` permet d'afficher les informations sur un disque :
2017-11-28 16:37:43 +01:00
~~~
# smartctl -i /dev/sda
=== START OF INFORMATION SECTION ===
Model Family: Seagate Laptop Thin HDD
Device Model: ST500LM021-1KJ152
Serial Number: XXXXXXXX
LU WWN Device Id: 5 000c50 09cbac333
Firmware Version: 0005SDM1
User Capacity: 500,107,862,016 bytes [500 GB]
Sector Sizes: 512 bytes logical, 4096 bytes physical
Rotation Rate: 7200 rpm
Form Factor: 2.5 inches
Device is: In smartctl database [for details use: -P show]
ATA Version is: ATA8-ACS T13/1699-D revision 4
SATA Version is: SATA 3.0, 6.0 Gb/s (current: 6.0 Gb/s)
Local Time is: Tue Nov 28 16:19:49 2017 CET
SMART support is: Available - device has SMART capability.
SMART support is: Enabled
~~~
2017-12-04 09:37:32 +01:00
L'option `-a` permet d'afficher toutes les informations SMART :
~~~
# smartctl -a /dev/sda
=== START OF INFORMATION SECTION ===
Model Number: SAMSUNG MZVLW256HEHP-000L7
Serial Number: XXXXXXXX
Firmware Version: 4L7QCXB7
PCI Vendor/Subsystem ID: 0x144d
IEEE OUI Identifier: 0x002538
Total NVM Capacity: 256 060 514 304 [256 GB]
Unallocated NVM Capacity: 0
Controller ID: 2
Number of Namespaces: 1
Namespace 1 Size/Capacity: 256 060 514 304 [256 GB]
Namespace 1 Utilization: 208 604 237 824 [208 GB]
Namespace 1 Formatted LBA Size: 512
Local Time is: Mon Dec 4 00:16:33 2017 CET
Firmware Updates (0x16): 3 Slots, no Reset required
Optional Admin Commands (0x0017): Security Format Frmw_DL *Other*
Optional NVM Commands (0x001f): Comp Wr_Unc DS_Mngmt Wr_Zero Sav/Sel_Feat
Warning Comp. Temp. Threshold: 69 Celsius
Critical Comp. Temp. Threshold: 72 Celsius
Supported Power States
St Op Max Active Idle RL RT WL WT Ent_Lat Ex_Lat
0 + 7.60W - - 0 0 0 0 0 0
1 + 6.00W - - 1 1 1 1 0 0
2 + 5.10W - - 2 2 2 2 0 0
3 - 0.0400W - - 3 3 3 3 210 1500
4 - 0.0050W - - 4 4 4 4 2200 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 0xffffffff)
Critical Warning: 0x00
Temperature: 32 Celsius
Available Spare: 100%
Available Spare Threshold: 10%
Percentage Used: 0%
Data Units Read: 122 540 [62,7 GB]
Data Units Written: 1 927 650 [986 GB]
Host Read Commands: 1 767 402
Host Write Commands: 31 997 703
Controller Busy Time: 47
Power Cycles: 371
Power On Hours: 748
Unsafe Shutdowns: 53
Media and Data Integrity Errors: 0
Error Information Log Entries: 120
Warning Comp. Temperature Time: 0
Critical Comp. Temperature Time: 0
Temperature Sensor 1: 32 Celsius
Temperature Sensor 2: 34 Celsius
Error Information (NVMe Log 0x01, max 64 entries)
Num ErrCount SQId CmdId Status PELoc LBA NSID VS
0 120 0 0x0008 0x4004 - 0 0 -
1 119 0 0x0018 0x4004 0x02c 0 0 -
[...]
~~~
### RAID matériel
2017-12-01 12:00:58 +01:00
Si votre disque n'est pas un disque physique mais un volume d'un RAID matériel, il faut préciser le type et le numéro du disque physique voulu :
2017-11-28 16:37:43 +01:00
~~~
# smartctl -i /dev/sda -d megaraid,0
=== START OF INFORMATION SECTION ===
Device Model: SSDSC2BB480G7R
Serial Number: XXXXXXXXXXXXXXXXXX
LU WWN Device Id: 5 5cd2e4 14d52d0aa
Add. Product Id: DELL(tm)
Firmware Version: N201DL41
User Capacity: 480,103,981,056 bytes [480 GB]
Sector Sizes: 512 bytes logical, 4096 bytes physical
Rotation Rate: Solid State Device
Form Factor: 2.5 inches
Device is: Not in smartctl database [for details use: -P showall]
ATA Version is: ACS-3 T13/2161-D revision 5
SATA Version is: SATA 3.1, 6.0 Gb/s (current: 6.0 Gb/s)
Local Time is: Tue Nov 28 16:27:57 2017 CET
SMART support is: Available - device has SMART capability.
SMART support is: Enabled
~~~
2017-12-01 11:59:13 +01:00
Dans certains cas, le contrôleur RAID dispose d'une possibilité de voir le disque au travers d'un module SCSI générique.
~~~
# modprobe sg
# smartctl -i /dev/sg0
smartctl 6.5 2016-01-24 r4214 [x86_64-linux-4.4.0-92-generic] (local build)
Copyright (C) 2002-16, Bruce Allen, Christian Franke, www.smartmontools.org
=== START OF INFORMATION SECTION ===
Model Family: Toshiba 3.5" MG03ACAxxx(Y) Enterprise HDD
Device Model: TOSHIBA MG03ACA100
2017-12-04 09:37:32 +01:00
Serial Number: XXXXX
2017-12-01 11:59:13 +01:00
LU WWN Device Id: 5 000039 4eb981078
Add. Product Id: DELL(tm)
Firmware Version: FL1D
User Capacity: 1,000,204,886,016 bytes [1.00 TB]
Sector Size: 512 bytes logical/physical
Rotation Rate: 7200 rpm
Form Factor: 3.5 inches
Device is: In smartctl database [for details use: -P show]
ATA Version is: ATA8-ACS (minor revision not indicated)
SATA Version is: SATA 3.0, 3.0 Gb/s (current: 3.0 Gb/s)
Local Time is: Fri Dec 1 11:57:19 2017 CET
SMART support is: Available - device has SMART capability.
SMART support is: Enabled
2017-12-04 09:37:32 +01:00
~~~
## FAQ
Voir <https://www.smartmontools.org/wiki/FAQ>
smartctl -s on /dev/hda %activer
smartctl -a /dev/hda %infos
smartctl -t long /dev/hda
smartctl -l error /dev/hda
gg