#1 Le 13/04/2016, à 10:46
- malbo
[Tuto] obtenir les données SMART d'un disque dur ou d'un SSD
Ce tuto est destiné aux novices à qui on demande sur le forum de fournir les données SMART d'un disque dur ou d'un SSD.
La procédure détaillée ci-dessous est applicable depuis une session d'un LiveDVD ou d'une LiveUSB Ubuntu aussi bien que depuis une session d'un Ubuntu installé sur disque dur.
1) Identification du lecteur (*) :
Identifier le disque dur ou SSD par le commande suivante à passer dans un terminal (c'est un L minuscule à la fin) :
sudo parted -l
On peut repérer le lecteur qui nous intéresse (sda ou sdb ou autre) et qu'on veut tester.
2) Installation du logiciel de test : Attention : j'ai fait ça depuis Ubuntu 16.04. Consulter le post #2 de kholo pour ceux qui utilisent une version précédente de Ubuntu (c'est un peu différent).
toujours dans le terminal, on passe la commande suivante :
smartctl
Si le logiciel nécessaire n'est pas installé, on voit ça dans le terminal :
smartctl
Le programme « smartctl » n'est pas encore installé. Vous pouvez l'installer en tapant :
sudo apt install smartmontools
Il faut alors faire ce qui est proposé en passant la commande :
sudo apt install smartmontools
Et l'installation va pouvoir se faire.
Si par contre le logiciel nécessaire était déjà installé, la commande smartctl aurait donné ça :
smartctl
smartctl 6.5 2016-01-24 r4214 [x86_64-linux-4.4.0-18-generic] (local build)
Copyright (C) 2002-16, Bruce Allen, Christian Franke, www.smartmontools.org
ERROR: smartctl requires a device name as the final command-line argument.
Use smartctl -h to get a usage summary
là pas besoin d'installer quoi que ce soit, c'est déjà fait.
3) Utilisation de smartctl pour récupérer les données SMART
On suppose qu'on s'intéresse au disque sdc qu'on aura dûment repéré à l'étape 1. La commande à passer est la suivante :
sudo smartctl -a /dev/sdc
Si c'est sda qui est votre disque à tester, il faut remplacer sdc par sda à la fin de la commande.
EDIT le 5 oct 2021 : si on opère depuis une session live (ordi démarré sur un LiveDVD ou une LiveUSB) la commande à passer doit inclure "-s on" afin d'autoriser SMART sur le disque :
sudo smartctl -s on -a /dev/sdc
4) On envoie tout :
on copie tout le résultat de cette commande (commande comprise) et on le colle dans le message de réponse sur le forum
(*) Cette étape est facultative : si on vous a demandé sur le forum de fournir les données SMART de sdb (par exemple), vous savez que c'est sdb qui vous intéresse. Dans ce cas, vous sautez cette étape 1 et vous allez directement à l'étape 2 (Installation du logiciel de test)
Dernière modification par malbo (Le 05/10/2021, à 05:59)
Hors ligne
#2 Le 13/04/2016, à 11:29
- kholo
Re : [Tuto] obtenir les données SMART d'un disque dur ou d'un SSD
pour les version < 16.04 c'est apt-get qui demande à installer smartmontools
smartctl
Le programme « smartctl » n'est pas encore installé. Vous pouvez l'installer en tapant :
sudo apt-get install smartmontools
donc
sudo apt-get install smartmontools
pour parted on peut aussi mettre :
sudo parted -l|grep "Disque"
Tutoriel sur le terminal
un petit raccourcis pour ceux qui galèrent avec la ligne de commande
la partie importante du tuto
3. Passer votre commande !
L'utilisation est assez simple, tapez une commande (ou copiez-collez la) et faites Entrée (clavier) pour l'exécuter.Les raccourcis pour le copier-coller ne sont pas Crtl+C ↔ Ctrl+V par défaut, mais Maj+Ctrl+C et Maj+Ctrl+V. En effet, dans un terminal le raccourci Ctrl+C annule la commande en cours.
Dernière modification par kholo (Le 13/04/2016, à 12:17)
Hors ligne
#3 Le 13/04/2016, à 11:47
- malbo
Re : [Tuto] obtenir les données SMART d'un disque dur ou d'un SSD
Merci pour ton coup de pouce.
Hors ligne
#4 Le 13/04/2016, à 11:53
- grandtoubab
Re : [Tuto] obtenir les données SMART d'un disque dur ou d'un SSD
salut,
le plus complet smartctl -x
Linux tout seul sur HP Pavilion DV7 et Acer Aspire T650, Canon MG3650 en wifi
Debian 11 Bullseye Gnome/Xorg, Gnome/Wayland avec SDDM
https://bidouilledebian.wordpress.com/
ON M'A VU DANS LE VERCORS, SAUTER A L'ELASTIQUE..... J'AI DANS LES BOTTES DES MONTAGNES DE QUESTIONS....
Hors ligne
#5 Le 24/02/2021, à 09:51
- Maryse46
Re : [Tuto] obtenir les données SMART d'un disque dur ou d'un SSD
oem@X751M:~$ sudo parted -l
[sudo] Mot de passe de oem :
Modèle : ATA ST1000LM024 HN-M (scsi)
Disque /dev/sda : 1000GB
Taille des secteurs (logiques/physiques) : 512B/4096B
Table de partitions : msdos
Drapeaux de disque :
Numéro Début Fin Taille Type Système de fichiers Drapeaux
1 1049kB 996GB 996GB primary ext4 démarrage
2 996GB 1000GB 4174MB extended
5 996GB 1000GB 4174MB logical linux-swap(v1)
oem@X751M:~$
Hors ligne
#6 Le 24/02/2021, à 09:53
- Maryse46
Re : [Tuto] obtenir les données SMART d'un disque dur ou d'un SSD
oem@X751M:~$ smartctl -x
smartctl 7.1 2019-12-30 r5022 [x86_64-linux-5.4.0-65-generic] (local build)
Copyright (C) 2002-19, Bruce Allen, Christian Franke, www.smartmontools.org
ERROR: smartctl requires a device name as the final command-line argument.
Use smartctl -h to get a usage summary
oem@X751M:~$
Avec smartctl -h
oem@X751M:~$ martctl -h
La commande « martctl » n'a pas été trouvée, voulez-vous dire :
commande « smartctl » du deb smartmontools (7.1-1build1)
Essayez : sudo apt install <nom du deb>
oem@X751M:~$ smartctl -h
smartctl 7.1 2019-12-30 r5022 [x86_64-linux-5.4.0-65-generic] (local build)
Copyright (C) 2002-19, Bruce Allen, Christian Franke, www.smartmontools.org
Usage: smartctl [options] device
============================================ SHOW INFORMATION OPTIONS =====
-h, --help, --usage
Display this help and exit
-V, --version, --copyright, --license
Print license, copyright, and version information and exit
-i, --info
Show identity information for device
--identify[=[w][nvb]]
Show words and bits from IDENTIFY DEVICE data (ATA)
-g NAME, --get=NAME
Get device setting: all, aam, apm, dsn, lookahead, security,
wcache, rcache, wcreorder, wcache-sct
-a, --all
Show all SMART information for device
-x, --xall
Show all information for device
--scan
Scan for devices
--scan-open
Scan for devices and try to open each device
================================== SMARTCTL RUN-TIME BEHAVIOR OPTIONS =====
-j, --json[=[cgiosuv]]
Print output in JSON format
-q TYPE, --quietmode=TYPE (ATA)
Set smartctl quiet mode to one of: errorsonly, silent, noserial
-d TYPE, --device=TYPE
Specify device type to one of:
ata, scsi[+TYPE], nvme[,NSID], sat[,auto][,N][+TYPE], usbcypress[,X], usbjmicron[,p][,x][,N], usbprolific, usbsunplus, sntjmicron[,NSID], intelliprop,N[+TYPE], jmb39x,N[,sLBA][,force][+TYPE], marvell, areca,N/E, 3ware,N, hpt,L/M/N, megaraid,N, aacraid,H,L,ID, cciss,N, auto, test
-T TYPE, --tolerance=TYPE (ATA)
Tolerance: normal, conservative, permissive, verypermissive
-b TYPE, --badsum=TYPE (ATA)
Set action on bad checksum to one of: warn, exit, ignore
-r TYPE, --report=TYPE
Report transactions (see man page)
-n MODE[,STATUS], --nocheck=MODE[,STATUS] (ATA)
No check if: never, sleep, standby, idle (see man page)
============================== DEVICE FEATURE ENABLE/DISABLE COMMANDS =====
-s VALUE, --smart=VALUE
Enable/disable SMART on device (on/off)
-o VALUE, --offlineauto=VALUE (ATA)
Enable/disable automatic offline testing on device (on/off)
-S VALUE, --saveauto=VALUE (ATA)
Enable/disable Attribute autosave on device (on/off)
-s NAME[,VALUE], --set=NAME[,VALUE]
Enable/disable/change device setting: aam,[N|off], apm,[N|off],
dsn,[on|off], lookahead,[on|off], security-freeze,
standby,[N|off|now], wcache,[on|off], rcache,[on|off],
wcreorder,[on|off[,p]], wcache-sct,[ata|on|off[,p]]
======================================= READ AND DISPLAY DATA OPTIONS =====
-H, --health
Show device SMART health status
-c, --capabilities (ATA, NVMe)
Show device SMART capabilities
-A, --attributes
Show device SMART vendor-specific Attributes and values
-f FORMAT, --format=FORMAT (ATA)
Set output format for attributes: old, brief, hex[,id|val]
-l TYPE, --log=TYPE
Show device log. TYPE: error, selftest, selective, directory[,g|s],
xerror[,N][,error], xselftest[,N][,selftest], background,
sasphy[,reset], sataphy[,reset], scttemp[sts,hist],
scttempint,N[,p], scterc[,N,M], devstat[,N], defects[,N], ssd,
gplog,N[,RANGE], smartlog,N[,RANGE], nvmelog,N,SIZE
-v N,OPTION , --vendorattribute=N,OPTION (ATA)
Set display OPTION for vendor Attribute N (see man page)
-F TYPE, --firmwarebug=TYPE (ATA)
Use firmware bug workaround:
none, nologdir, samsung, samsung2, samsung3, xerrorlba, swapid
-P TYPE, --presets=TYPE (ATA)
Drive-specific presets: use, ignore, show, showall
-B [+]FILE, --drivedb=[+]FILE (ATA)
Read and replace [add] drive database from FILE
[default is +/etc/smart_drivedb.h
and then /var/lib/smartmontools/drivedb/drivedb.h]
============================================ DEVICE SELF-TEST OPTIONS =====
-t TEST, --test=TEST
Run test. TEST: offline, short, long, conveyance, force, vendor,N,
select,M-N, pending,N, afterselect,[on|off]
-C, --captive
Do test in captive mode (along with -t)
-X, --abort
Abort any non-captive test on device
=================================================== SMARTCTL EXAMPLES =====
smartctl --all /dev/sda (Prints all SMART information)
smartctl --smart=on --offlineauto=on --saveauto=on /dev/sda
(Enables SMART on first disk)
smartctl --test=long /dev/sda (Executes extended disk self-test)
smartctl --attributes --log=selftest --quietmode=errorsonly /dev/sda
(Prints Self-Test & Attribute errors)
smartctl --all --device=3ware,2 /dev/sda
smartctl --all --device=3ware,2 /dev/twe0
smartctl --all --device=3ware,2 /dev/twa0
smartctl --all --device=3ware,2 /dev/twl0
(Prints all SMART info for 3rd ATA disk on 3ware RAID controller)
smartctl --all --device=hpt,1/1/3 /dev/sda
(Prints all SMART info for the SATA disk attached to the 3rd PMPort
of the 1st channel on the 1st HighPoint RAID controller)
smartctl --all --device=areca,3/1 /dev/sg2
(Prints all SMART info for 3rd ATA disk of the 1st enclosure
on Areca RAID controller)
oem@X751M:~$
Hors ligne
#7 Le 24/02/2021, à 09:58
- Maryse46
Re : [Tuto] obtenir les données SMART d'un disque dur ou d'un SSD
oem@X751M:~$ sudo smartctl -a /dev/sda
smartctl 7.1 2019-12-30 r5022 [x86_64-linux-5.4.0-65-generic] (local build)
Copyright (C) 2002-19, Bruce Allen, Christian Franke, www.smartmontools.org
=== START OF INFORMATION SECTION ===
Model Family: Seagate Samsung SpinPoint M8 (AF)
Device Model: ST1000LM024 HN-M101MBB
Serial Number: S32XJ9DF802341
LU WWN Device Id: 5 0004cf 20dc382a1
Firmware Version: 2BA30001
User Capacity: 1000204886016 bytes [1,00 TB]
Sector Sizes: 512 bytes logical, 4096 bytes physical
Rotation Rate: 5400 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 6
SATA Version is: SATA 3.0, 6.0 Gb/s (current: 3.0 Gb/s)
Local Time is: Wed Feb 24 09:57:52 2021 CET
SMART support is: Available - device has SMART capability.
SMART support is: Enabled
=== START OF READ SMART DATA SECTION ===
SMART overall-health self-assessment test result: PASSED
General SMART Values:
Offline data collection status: (0x00) Offline data collection activity
was never started.
Auto Offline Data Collection: Disabled.
Self-test execution status: ( 0) The previous self-test routine completed
without error or no self-test has ever
been run.
Total time to complete Offline
data collection: (12600) seconds.
Offline data collection
capabilities: (0x5b) SMART execute Offline immediate.
Auto Offline data collection on/off support.
Suspend Offline collection upon new
command.
Offline surface scan supported.
Self-test supported.
No Conveyance Self-test supported.
Selective Self-test supported.
SMART capabilities: (0x0003) Saves SMART data before entering
power-saving mode.
Supports SMART auto save timer.
Error logging capability: (0x01) Error logging supported.
General Purpose Logging supported.
Short self-test routine
recommended polling time: ( 2) minutes.
Extended self-test routine
recommended polling time: ( 210) minutes.
SCT capabilities: (0x003f) SCT Status supported.
SCT Error Recovery Control supported.
SCT Feature Control supported.
SCT Data Table supported.
SMART Attributes Data Structure revision number: 16
Vendor Specific SMART Attributes with Thresholds:
ID# ATTRIBUTE_NAME FLAG VALUE WORST THRESH TYPE UPDATED WHEN_FAILED RAW_VALUE
1 Raw_Read_Error_Rate 0x002f 100 100 051 Pre-fail Always - 40
2 Throughput_Performance 0x0026 252 252 000 Old_age Always - 0
3 Spin_Up_Time 0x0023 092 088 025 Pre-fail Always - 2531
4 Start_Stop_Count 0x0032 097 097 000 Old_age Always - 3093
5 Reallocated_Sector_Ct 0x0033 252 252 010 Pre-fail Always - 0
7 Seek_Error_Rate 0x002e 252 252 051 Old_age Always - 0
8 Seek_Time_Performance 0x0024 252 252 015 Old_age Offline - 0
9 Power_On_Hours 0x0032 100 100 000 Old_age Always - 8641
10 Spin_Retry_Count 0x0032 252 252 051 Old_age Always - 0
12 Power_Cycle_Count 0x0032 097 097 000 Old_age Always - 3059
191 G-Sense_Error_Rate 0x0022 100 100 000 Old_age Always - 2144
192 Power-Off_Retract_Count 0x0022 252 252 000 Old_age Always - 0
194 Temperature_Celsius 0x0002 064 052 000 Old_age Always - 31 (Min/Max 8/51)
195 Hardware_ECC_Recovered 0x003a 100 100 000 Old_age Always - 0
196 Reallocated_Event_Count 0x0032 252 252 000 Old_age Always - 0
197 Current_Pending_Sector 0x0032 252 252 000 Old_age Always - 0
198 Offline_Uncorrectable 0x0030 252 252 000 Old_age Offline - 0
199 UDMA_CRC_Error_Count 0x0036 200 200 000 Old_age Always - 0
200 Multi_Zone_Error_Rate 0x002a 100 100 000 Old_age Always - 36958
223 Load_Retry_Count 0x0032 098 098 000 Old_age Always - 2385
225 Load_Cycle_Count 0x0032 077 077 000 Old_age Always - 232950
SMART Error Log Version: 1
No Errors Logged
SMART Self-test log structure revision number 1
No self-tests have been logged. [To run self-tests, use: smartctl -t]
SMART Selective self-test log data structure revision number 0
Note: revision number not 1 implies that no selective self-test has ever been run
SPAN MIN_LBA MAX_LBA CURRENT_TEST_STATUS
1 0 0 Completed [00% left] (0-65535)
2 0 0 Not_testing
3 0 0 Not_testing
4 0 0 Not_testing
5 0 0 Not_testing
Selective self-test flags (0x0):
After scanning selected spans, do NOT read-scan remainder of disk.
If Selective self-test is pending on power-up, resume after 0 minute delay.
oem@X751M:~$
Hors ligne