Utilisation de SMART et badblocks

Bonjour,

C’est bientôt le printemps. J’ai quelques hdd dont je voudrais vérifier l’intégrité.
Je pensais utiliser la commande « # smartctl -a /dev/sdX » mais voilà, elle me renvoie un long rapport assez indigeste ! Je ne vois pas comment l’interpréter !
Alors j’ai utilisé la commande suivante bien plus lisible :

Ensuite j’ai utilisé « badblocks ». C’est long mais bien plus lisible :

smartctl --health --info /dev/sdc

smartctl 7.2 2020-12-30 r5155 [x86_64-linux-5.15.0-76-generic] (local build)
Copyright (C) 2002-20, Bruce Allen, Christian Franke, www.smartmontools.org

=== START OF INFORMATION SECTION ===
Model Family: Seagate Maxtor DiamondMax 20
Device Model: MAXTOR STM3160211AS
Serial Number: 5PT18DRD
Firmware Version: 3.AAE
User Capacity: 160 040 803 840 bytes [160 GB]
Sector Size: 512 bytes logical/physical
Device is: In smartctl database [for details use: -P show]
ATA Version is: ATA/ATAPI-7 (minor revision not indicated)
Local Time is: Sun Feb 16 12:18:13 2025 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

badblocks -sv /dev/sdc1

Vérification des blocs 0 à 156287999
Vérification des blocs défectueux (test en mode lecture seule) : 0.00% effectucomplété
Passe complétée, 0 blocs défectueux repérés. (0/0/0 erreurs)

Puis-je en déduire que mon disque externe est sain ? Et reproduire ce test pour tous les autres ?

J’ai un autre disque dur externe dont voici le rapport avec Crystaldiskinfo en 10[DEC]1byte:
https://www.cjoint.com/c/OBqpTztvCQj

Peut-on ‹ réparer › les erreurs sur ce disque ou est-il condamné. Il n’y a rien dessus

Alors le mieux pour smartctl c’est de faire smartctl -a. Exemple:

=== START OF INFORMATION SECTION ===
Model Family:     Western Digital Scorpio Blue Serial ATA (AF)
Device Model:     WDC WD5000BPVT-55A1YT0
Serial Number:    WD-WX61C12L9665
LU WWN Device Id: 5 0014ee 6ad175f71
Firmware Version: 01.01A01
User Capacity:    500 107 862 016 bytes [500 GB]
Sector Sizes:     512 bytes logical, 4096 bytes physical
Rotation Rate:    5400 rpm
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: 1.5 Gb/s)
Local Time is:    Mon Dec 16 15:33:01 2024 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:                (10860) seconds.
Offline data collection
capabilities:                    (0x7b) SMART execute Offline immediate.
                                        Auto Offline data collection on/off support.
                                        Suspend Offline collection upon new
                                        command.
                                        Offline surface scan supported.
                                        Self-test supported.
MART 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:        ( 120) minutes.
Conveyance self-test routine
recommended polling time:        (   5) minutes.
SCT capabilities:              (0x70b5) SCT Status 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   200   200   051    Pre-fail  Always       -       0
  3 Spin_Up_Time            0x0027   184   182   021    Pre-fail  Always       -       1783
  4 Start_Stop_Count        0x0032   095   095   000    Old_age   Always       -       5329
  5 Reallocated_Sector_Ct   0x0033   200   200   140    Pre-fail  Always       -       0
  7 Seek_Error_Rate         0x002e   200   200   000    Old_age   Always       -       0
  9 Power_On_Hours          0x0032   031   031   000    Old_age   Always       -       50643
 10 Spin_Retry_Count        0x0032   100   100   000    Old_age   Always       -       0
 11 Calibration_Retry_Count 0x0032   100   100   000    Old_age   Always       -       0
 12 Power_Cycle_Count       0x0032   095   095   000    Old_age   Always       -       5048
191 G-Sense_Error_Rate      0x0032   001   001   000    Old_age   Always       -       323102
192 Power-Off_Retract_Count 0x0032   200   200   000    Old_age   Always       -       68
193 Load_Cycle_Count        0x0032   182   182   000    Old_age   Always       -       54652
194 Temperature_Celsius     0x0022   112   092   000    Old_age   Always       -       35 (Min/Max 28/47)
196 Reallocated_Event_Count 0x0032   200   200   000    Old_age   Always       -       0
197 Current_Pending_Sector  0x0032   200   200   000    Old_age   Always       -       0
198 Offline_Uncorrectable   0x0030   100   253   000    Old_age   Offline      -       0
199 UDMA_CRC_Error_Count    0x0032   200   200   000    Old_age   Always       -       0
200 Multi_Zone_Error_Rate   0x0008   200   200   000    Old_age   Offline      -       0
254 Free_Fall_Sensor        0x0032   001   001   000    Old_age   Always       -       705

SMART Error Log Version: 1
No Errors Logged

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%     45437         -
    # 2  Extended offline    Completed without error       00%     14448         -
    # 3  Short offline       Completed without error       00%      2092         -
    # 4  Short offline       Completed without error       00%      1998         -
    # 5  Short offline       Completed without error       00%      1874         -

SMART Selective self-test log data structure revision number 1
 SPAN  MIN_LBA  MAX_LBA  CURRENT_TEST_STATUS
    1        0        0  Not_testing
    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.
  • Reallocated_Sector_Ct → donne le nombre de secteurs réalloués, 0 est parfait, c’est un signe de soucis
  • Raw_Read_Error_Rate, UDMA_CRC_Error_Count → nbre erreurs de lecture et nbre erreurs de port SATA (connectique). Là aussi, signe de pbms
    *Pour avoir l’age, il faut regarder Power_On_Hours (>10 ans → soucis possibles), Power_Cycle_Count → nombre de démarrage, Load_Cycle_Count → peut être elevé, je crois que c’est le nombre de parquage des têtes de lectures, >= 50000 = beaucoup. Tu peux les empecher au prix d’une consommation + élevée
  • Current Temperature → la temparature (si). Pbm possible si > 50-60°
  • G-Sense_Error_Rate → nombre de chocs subi par le disque, sur un portable brutalisé chez moi, c’est 300000 ce qui est très (trop) gros
  • Free_Fall_Sensor —> indicateur de chute libre (petite sinon le disque est mort). 705 chez moi, c’est beaucoup. Je dois être une brute.
  • Tu peux enfin faire des tests et regarder les résultats sur ces lignes:
    Num  Test_Description    Status                  Remaining  LifeTime(hours)  LBA_of_first_error
    # 1  Short offline       Completed without error       00%     45437         -
    # 2  Extended offline    Completed without error       00%     14448         -
    # 3  Short offline       Completed without error       00%      2092         -
    # 4  Short offline       Completed without error       00%      1998         -
    # 5  Short offline       Completed without error       00%      1874         -

Tu les lances par

# smartctl -t short /dev/sda
smartctl 6.6 2017-11-05 r4594 [i686-linux-4.19.0-5-686-pae] (local build)
Copyright (C) 2002-17, 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 2 minutes for test to complete.
Test will complete after Mon Feb 17 22:10:44 2025

Use smartctl -X to abort test.

Rq: je viens de penser, à la limite tu peux coller la sortie sur Mistral et demander de faire un résumé.

Si tu as localisé les secteurs à problème, tu peux faire une partition bidon qui les isolera et utiliser le reste. Ça peut marcher si ça n’est pas l’usure du disque. Je précise avoir utiliser près de 10 ans un disque comme cela (il avait eu un choc un peu violent) sans souci.

tu peux voir la :

sinon smartctl -H est pas mal comme résumé
gsmartcontrol est bien comme gui

je ne connais pas ce programme mais en gros ça semble dire que ton disque dur a des problèmes, donc :
1 copier les données
2. le disque peut mourir demain ou dans dix ans ( comme tous les dd :slight_smile: )
perso j’ai un disque 1To qui a des erreurs smart depuis dix ans , il en est à 52000 heures d’utilisation

Bonjour,

Merci à vous deux pour vos conseils.

sudo smartctl -a /dev/sdc
smartctl 7.4 2023-08-01 r5530 [x86_64-linux-6.10.9-amd64] (local build)
Copyright (C) 2002-23, Bruce Allen, Christian Franke, www.smartmontools.org

=== START OF INFORMATION SECTION ===
Model Family: Western Digital Caviar Black
Device Model: WDC WD1001FALS-00J7B0
Serial Number: WD-WMATV8085736
LU WWN Device Id: 5 0014ee 0025101ca
Firmware Version: 05.00K05
User Capacity: 1 000 204 886 016 bytes [1,00 TB]
Sector Size: 512 bytes logical/physical
Device is: In smartctl database 7.3/5528
ATA Version is: ATA8-ACS (minor revision not indicated)
SATA Version is: SATA 2.5, 3.0 Gb/s
Local Time is: Tue Feb 18 07:38:49 2025 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: FAILED!
Drive failure expected in less than 24 hours. SAVE ALL DATA.
See vendor-specific Attribute list for failed Attributes.

General SMART Values:
Offline data collection status: (0x82) Offline data collection activity
was completed without error.
Auto Offline Data Collection: Enabled.
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: (18600) seconds.
Offline data collection
capabilities: (0x7b) SMART execute Offline immediate.
Auto Offline data collection on/off support.
Suspend Offline collection upon new
command.
Offline surface scan supported.
Self-test supported.
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: ( 214) minutes.
Conveyance self-test routine
recommended polling time: ( 5) minutes.
SCT capabilities: (0x3037) SCT Status 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 200 200 051 Pre-fail Always - 69637
3 Spin_Up_Time 0x0027 250 222 021 Pre-fail Always - 7483
4 Start_Stop_Count 0x0032 089 089 000 Old_age Always - 11653
5 Reallocated_Sector_Ct 0x0033 100 100 140 Pre-fail Always FAILING_NOW 795
7 Seek_Error_Rate 0x002e 200 200 000 Old_age Always - 0
9 Power_On_Hours 0x0032 036 036 000 Old_age Always - 47411
10 Spin_Retry_Count 0x0032 100 100 000 Old_age Always - 0
11 Calibration_Retry_Count 0x0032 100 100 000 Old_age Always - 0
12 Power_Cycle_Count 0x0032 097 097 000 Old_age Always - 3035
192 Power-Off_Retract_Count 0x0032 200 200 000 Old_age Always - 246
193 Load_Cycle_Count 0x0032 197 197 000 Old_age Always - 11653
194 Temperature_Celsius 0x0022 136 098 000 Old_age Always - 14
196 Reallocated_Event_Count 0x0032 001 001 000 Old_age Always - 782
197 Current_Pending_Sector 0x0032 195 192 000 Old_age Always - 953
198 Offline_Uncorrectable 0x0030 200 196 000 Old_age Offline - 0
199 UDMA_CRC_Error_Count 0x0032 200 200 000 Old_age Always - 27
200 Multi_Zone_Error_Rate 0x0008 001 001 000 Old_age Offline - 123595

SMART Error Log Version: 1
No Errors Logged

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% 42495 -

SMART Selective self-test log data structure revision number 1
SPAN MIN_LBA MAX_LBA CURRENT_TEST_STATUS
1 0 0 Not_testing
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.

The above only provides legacy SMART information - try ‹ smartctl -x › for more

Je lance ce matin un « smartctl -t short /dev/sdc »

=== START OF READ SMART DATA SECTION ===
SMART Error Log Version: 1
No Errors Logged

Ça c’est ennuyeux au point que smartctl te le signale, énormément d’erreurs dont 795 ayant mené à une réallocation. C’est trop.

Pas très vieux pourtant

782, c’est cohérent avec le 795 plus haut et c’est trop

Bref, je te conseille de changer de disque :slight_smile:

Bon !! Ben merci tout de même :confused:

Alors, cela n’a rien à voir mais je sèche sur la commande dd et pv !!

Pour afficher la boite de dialogue avec une barre de progression sur un « dd if=/dev/zero of/dev/sdc » ? Tu as la commande ? Lorsque je fais
# (pv -n | dd if=/dev/zero of=/dev/sdc bs=1M && sync) 2>&1 | dialog --gauge "la commande dd est en cours d'exécution, merci de patienter..." 10 70 0
j’ai la boîte de dialogue mais il ne se passe rien !!