El comando smartctl permite obtener información sobre el estado de nuestros discos duros, ayudando a prevenir un fallo inminente que pueda conllevar la perdida de información.
Su sintaxis es de la forma:
smartctl [opciones] [dispositivo]
Alguna de sus opciones son:
-a Imprime toda la información inteligente sobre el disco, o información TapeAlert de la unidad de cinta o cambiador.
-T permissive ignorar el fracaso (s) de comandos SMART obligatorios. Esta opción puede darse más de una vez. Cada uso adicional de esta opción hará que otro fracaso adicional para ser ignorada. Tenga en cuenta que el uso de esta opción puede llevar a mensajes como "Característica X no implementado", seguido poco después por "Error: no se puede activar la función X". En unos pocos casos, contrariamente a la mensaje final, Característica X está habilitada.
-T verypermissive equivalente a dar un gran número de opciones permissive, ignorar los fallos de cualquier número de obligatorio.
# smartctl -a /dev/sda smartctl 5.41 2011-06-09 r3365 [x86_64-linux-3.18.0-kali3-amd64] (local build) Copyright (C) 2002-11 by Bruce Allen, http://smartmontools.sourceforge.net === START OF INFORMATION SECTION === Model Family: Western Digital Scorpio Blue Serial ATA Device Model: WDC WD3200BEVT-22A23T0 Serial Number: WD-WXN1A60K9602 LU WWN Device Id: 5 0014ee 60053ff96 Firmware Version: 01.01A01 User Capacity: 320.072.933.376 bytes [320 GB] Sector Size: 512 bytes logical/physical Device is: In smartctl database [for details use: -P show] ATA Version is: 8 ATA Standard is: Exact ATA specification draft version not indicated Local Time is: Fri May 8 02:37:14 2015 ART 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: ( 7980) 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: ( 95) minutes. Conveyance self-test routine recommended polling time: ( 5) minutes. SCT capabilities: (0x7037) 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 196 196 051 Pre-fail Always - 21807 3 Spin_Up_Time 0x0027 150 133 021 Pre-fail Always - 1458 4 Start_Stop_Count 0x0032 092 092 000 Old_age Always - 8316 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 096 096 000 Old_age Always - 3233 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 098 098 000 Old_age Always - 2437 191 G-Sense_Error_Rate 0x0032 001 001 000 Old_age Always - 7994 192 Power-Off_Retract_Count 0x0032 200 200 000 Old_age Always - 51 193 Load_Cycle_Count 0x0032 118 118 000 Old_age Always - 247331 194 Temperature_Celsius 0x0022 108 097 000 Old_age Always - 35 196 Reallocated_Event_Count 0x0032 200 200 000 Old_age Always - 0 197 Current_Pending_Sector 0x0032 200 199 000 Old_age Always - 48 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 100 253 000 Old_age Offline - 0 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 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.
Si un disco presenta ATA Error estos se pueden ampliar usando algunos paramnetros opcionales como se muestra acontinuación:
# smartctl -a -d ata /dev/sdb smartctl 5.41 2011-06-09 r3365 [x86_64-linux-3.18.0-kali3-amd64] (local build) Copyright (C) 2002-11 by Bruce Allen, http://smartmontools.sourceforge.net === START OF INFORMATION SECTION === Device Model: ST31000524AS Serial Number: 5VPCW4Z9 LU WWN Device Id: 5 000c50 0538ad628 Firmware Version: JC4C User Capacity: 1.000.204.886.016 bytes [1,00 TB] Sector Size: 512 bytes logical/physical Device is: Not in smartctl database [for details use: -P showall] ATA Version is: 8 ATA Standard is: ATA-8-ACS revision 4 Local Time is: Fri May 8 03:02:23 2015 ART 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: (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: ( 634) 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: ( 1) minutes. Extended self-test routine recommended polling time: ( 181) minutes. Conveyance self-test routine recommended polling time: ( 2) minutes. SCT capabilities: (0x103f) SCT Status supported. SCT Error Recovery Control supported. SCT Feature Control supported. SCT Data Table supported. SMART Attributes Data Structure revision number: 10 Vendor Specific SMART Attributes with Thresholds: ID# ATTRIBUTE_NAME FLAG VALUE WORST THRESH TYPE UPDATED WHEN_FAILED RAW_VALUE 1 Raw_Read_Error_Rate 0x000f 115 079 006 Pre-fail Always - 96056256 3 Spin_Up_Time 0x0003 100 100 000 Pre-fail Always - 0 4 Start_Stop_Count 0x0032 098 098 020 Old_age Always - 2188 5 Reallocated_Sector_Ct 0x0033 100 100 036 Pre-fail Always - 0 7 Seek_Error_Rate 0x000f 082 060 030 Pre-fail Always - 4463744125 9 Power_On_Hours 0x0032 094 094 000 Old_age Always - 5809 10 Spin_Retry_Count 0x0013 100 100 097 Pre-fail Always - 0 12 Power_Cycle_Count 0x0032 098 098 020 Old_age Always - 2172 183 Runtime_Bad_Block 0x0032 001 001 000 Old_age Always - 6533 184 End-to-End_Error 0x0032 100 100 099 Old_age Always - 0 187 Reported_Uncorrect 0x0032 001 001 000 Old_age Always - 4241 188 Command_Timeout 0x0032 100 096 000 Old_age Always - 4295032854 189 High_Fly_Writes 0x003a 100 100 000 Old_age Always - 0 190 Airflow_Temperature_Cel 0x0022 066 046 045 Old_age Always - 34 (Min/Max 28/35) 194 Temperature_Celsius 0x0022 034 054 000 Old_age Always - 34 (0 19 0 0) 195 Hardware_ECC_Recovered 0x001a 034 023 000 Old_age Always - 96056256 197 Current_Pending_Sector 0x0012 100 100 000 Old_age Always - 0 198 Offline_Uncorrectable 0x0010 100 100 000 Old_age Offline - 0 199 UDMA_CRC_Error_Count 0x003e 200 200 000 Old_age Always - 0 240 Head_Flying_Hours 0x0000 100 253 000 Old_age Offline - 255962870984111 241 Total_LBAs_Written 0x0000 100 253 000 Old_age Offline - 1060035455 242 Total_LBAs_Read 0x0000 100 253 000 Old_age Offline - 2425915962 SMART Error Log Version: 1 ATA Error Count: 4321 (device log contains only the most recent five errors) CR = Command Register [HEX] FR = Features Register [HEX] SC = Sector Count Register [HEX] SN = Sector Number Register [HEX] CL = Cylinder Low Register [HEX] CH = Cylinder High Register [HEX] DH = Device/Head Register [HEX] DC = Device Command Register [HEX] ER = Error register [HEX] ST = Status register [HEX] Powered_Up_Time is measured from power on, and printed as DDd hh:mm:SS.sss where DD=days, hh=hours, mm=minutes, SS=sec, and sss=millisec. It "wraps" after 49.710 days. Error 4321 occurred at disk power-on lifetime: 1403 hours (58 days 11 hours) When the command that caused the error occurred, the device was active or idle. After command completion occurred, registers were: ER ST SC SN CL CH DH -- -- -- -- -- -- -- 40 51 00 4e 62 12 08 Error: UNC at LBA = 0x0812624e = 135422542 Commands leading to the command that caused the error were: CR FR SC SN CL CH DH DC Powered_Up_Time Command/Feature_Name -- -- -- -- -- -- -- -- ---------------- -------------------- 60 00 18 38 62 12 48 00 03:37:30.026 READ FPDMA QUEUED ef 90 03 00 00 00 a0 00 03:37:29.148 SET FEATURES [Reserved for Serial ATA] ef 02 00 00 00 00 a0 00 03:37:29.124 SET FEATURES [Enable write cache] 00 00 00 00 00 00 00 ff 03:37:29.028 NOP [Abort queued commands] 60 00 18 38 62 12 48 00 03:37:26.288 READ FPDMA QUEUED Error 4320 occurred at disk power-on lifetime: 1403 hours (58 days 11 hours) When the command that caused the error occurred, the device was active or idle. After command completion occurred, registers were: ER ST SC SN CL CH DH -- -- -- -- -- -- -- 40 51 00 4e 62 12 08 Error: UNC at LBA = 0x0812624e = 135422542 Commands leading to the command that caused the error were: CR FR SC SN CL CH DH DC Powered_Up_Time Command/Feature_Name -- -- -- -- -- -- -- -- ---------------- -------------------- 60 00 18 38 62 12 48 00 03:37:26.288 READ FPDMA QUEUED ef 90 03 00 00 00 a0 00 03:37:25.424 SET FEATURES [Reserved for Serial ATA] ef 02 00 00 00 00 a0 00 03:37:25.406 SET FEATURES [Enable write cache] 00 00 00 00 00 00 00 ff 03:37:25.290 NOP [Abort queued commands] 60 00 18 38 62 12 48 00 03:37:22.566 READ FPDMA QUEUED Error 4319 occurred at disk power-on lifetime: 1403 hours (58 days 11 hours) When the command that caused the error occurred, the device was active or idle. After command completion occurred, registers were: ER ST SC SN CL CH DH -- -- -- -- -- -- -- 40 51 00 4e 62 12 08 Error: UNC at LBA = 0x0812624e = 135422542 Commands leading to the command that caused the error were: CR FR SC SN CL CH DH DC Powered_Up_Time Command/Feature_Name -- -- -- -- -- -- -- -- ---------------- -------------------- 60 00 18 38 62 12 48 00 03:37:22.566 READ FPDMA QUEUED ef 90 03 00 00 00 a0 00 03:37:21.680 SET FEATURES [Reserved for Serial ATA] ef 02 00 00 00 00 a0 00 03:37:21.676 SET FEATURES [Enable write cache] 00 00 00 00 00 00 00 ff 03:37:21.568 NOP [Abort queued commands] 60 00 18 38 62 12 48 00 03:37:18.820 READ FPDMA QUEUED Error 4318 occurred at disk power-on lifetime: 1403 hours (58 days 11 hours) When the command that caused the error occurred, the device was active or idle. After command completion occurred, registers were: ER ST SC SN CL CH DH -- -- -- -- -- -- -- 40 51 00 4e 62 12 08 Error: UNC at LBA = 0x0812624e = 135422542 Commands leading to the command that caused the error were: CR FR SC SN CL CH DH DC Powered_Up_Time Command/Feature_Name -- -- -- -- -- -- -- -- ---------------- -------------------- 60 00 18 38 62 12 48 00 03:37:18.820 READ FPDMA QUEUED ef 90 03 00 00 00 a0 00 03:37:17.956 SET FEATURES [Reserved for Serial ATA] ef 02 00 00 00 00 a0 00 03:37:17.938 SET FEATURES [Enable write cache] 00 00 00 00 00 00 00 ff 03:37:17.821 NOP [Abort queued commands] 60 00 18 38 62 12 48 00 03:37:15.071 READ FPDMA QUEUED Error 4317 occurred at disk power-on lifetime: 1403 hours (58 days 11 hours) When the command that caused the error occurred, the device was active or idle. After command completion occurred, registers were: ER ST SC SN CL CH DH -- -- -- -- -- -- -- 40 51 00 4e 62 12 08 Error: UNC at LBA = 0x0812624e = 135422542 Commands leading to the command that caused the error were: CR FR SC SN CL CH DH DC Powered_Up_Time Command/Feature_Name -- -- -- -- -- -- -- -- ---------------- -------------------- 60 00 18 38 62 12 48 00 03:37:15.071 READ FPDMA QUEUED ef 90 03 00 00 00 a0 00 03:37:14.195 SET FEATURES [Reserved for Serial ATA] ef 02 00 00 00 00 a0 00 03:37:14.189 SET FEATURES [Enable write cache] 00 00 00 00 00 00 00 ff 03:37:14.076 NOP [Abort queued commands] 60 00 18 38 62 12 48 00 03:37:11.335 READ FPDMA QUEUED 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% 5659 - # 2 Short offline Aborted by host 90% 5658 - # 3 Short offline Aborted by host 90% 5658 - 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.
Comprueba cada unidad y los errores en las unidades, los más importantes son: reallocated_sector el cual representa el números de sectores reasignados (sectores defectuosos) y los de ATA Error
# for i in a b c d e f g h i j k l m n o p q r s t u v w x y z; do echo "===drive sd$i==="; smartctl -a /dev/sd$i | egrep -i "reallocated_sector|ata error|serial|model|user capacity"; done; ===drive sda=== Model Family: Western Digital Scorpio Blue Serial ATA Device Model: WDC WD3200BEVT-22A23T0 Serial Number: WD-WXN1A60K9602 User Capacity: 320.072.933.376 bytes [320 GB] 5 Reallocated_Sector_Ct 0x0033 200 200 140 Pre-fail Always - 0 ===drive sdb=== Device Model: ST31000524AS Serial Number: 5VPCW4Z9 User Capacity: 1.000.204.886.016 bytes [1,00 TB] 5 Reallocated_Sector_Ct 0x0033 100 100 036 Pre-fail Always - 0 ATA Error Count: 4321 (device log contains only the most recent five errors) ef 90 03 00 00 00 a0 00 03:37:29.148 SET FEATURES [Reserved for Serial ATA] ef 90 03 00 00 00 a0 00 03:37:25.424 SET FEATURES [Reserved for Serial ATA] ef 90 03 00 00 00 a0 00 03:37:21.680 SET FEATURES [Reserved for Serial ATA] ef 90 03 00 00 00 a0 00 03:37:17.956 SET FEATURES [Reserved for Serial ATA] ef 90 03 00 00 00 a0 00 03:37:14.195 SET FEATURES [Reserved for Serial ATA] ===drive sdc=== Device Model: WDC WD3003FZEX-00Z4SA0 Serial Number: WD-WCC133ZR98Y4 User Capacity: 3.000.592.982.016 bytes [3,00 TB] 5 Reallocated_Sector_Ct 0x0033 200 200 140 Pre-fail Always - 0 ===drive sdd=== ===drive sde=== ===drive sdf=== ===drive sdg=== ===drive sdh=== ===drive sdi=== ===drive sdj=== ===drive sdk=== ===drive sdl=== ===drive sdm=== ===drive sdn=== ===drive sdo=== ===drive sdp=== ===drive sdq=== ===drive sdr=== ===drive sds=== ===drive sdt=== ===drive sdu=== ===drive sdv=== ===drive sdw=== ===drive sdx=== ===drive sdy=== ===drive sdz===
Para un solo disco, en este caso para el sda , sería:
# smartctl -a /dev/sda | egrep -i "ed_sector|ata error|serial|model|user capacity" Device Model: ST31000524AS Serial Number: 5VPCW4Z9 User Capacity: 1.000.204.886.016 bytes [1,00 TB] 5 Reallocated_Sector_Ct 0x0033 100 100 036 Pre-fail Always - 0 ATA Error Count: 4321 (device log contains only the most recent five errors) ef 90 03 00 00 00 a0 00 03:37:29.148 SET FEATURES [Reserved for Serial ATA] ef 90 03 00 00 00 a0 00 03:37:25.424 SET FEATURES [Reserved for Serial ATA] ef 90 03 00 00 00 a0 00 03:37:21.680 SET FEATURES [Reserved for Serial ATA] ef 90 03 00 00 00 a0 00 03:37:17.956 SET FEATURES [Reserved for Serial ATA] ef 90 03 00 00 00 a0 00 03:37:14.195 SET FEATURES [Reserved for Serial ATA]
Existe también una interfaz gráfica del comando smartctl llamada GSmartControl a continuación se muestran unas capturas pantallas del mismo:

Si se hace clic sobre uno de los discos (en este caso sobre el sda) se abre la siguiente ventana:

Envíanos tús preguntas, comentarios o sugerencias