smartctl es una utilidad para el control y monitorización de discos S.M.A.R.T.
smartctl es una utilidad de línea de comandos diseñada para realizar tareas como mostrar los registros de SMART de autotest y error, la activación y desactivación automática de pruebas de SMART, y el inicio de auto-pruebas en dispositivos.
Podemos comprobar las salud de nuestros discos, en elos siguientes ejemplos podemos ver el estado de un disco normal y otro en fallo o apunto de fallar.
Ejemplo de disco con buena salud:
$ smartctl -a /dev/sdb smartctl version 5.38 [x86_64-redhat-linux-gnu] Copyright (C) 2002-8 Bruce Allen Home page is http://smartmontools.sourceforge.net/ === START OF INFORMATION SECTION === Device Model: ST3500418AS Serial Number: 6VM04HYP Firmware Version: CC34 User Capacity: 500,107,862,016 bytes 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: Thu Sep 1 11:55:29 2011 CEST 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: ( 600) 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: ( 95) minutes. Conveyance self-test routine recommended polling time: ( 2) minutes. SCT capabilities: (0x103f) SCT Status 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 117 100 006 Pre-fail Always - 155041021 3 Spin_Up_Time 0x0003 097 097 000 Pre-fail Always - 0 4 Start_Stop_Count 0x0032 100 100 020 Old_age Always - 340 5 Reallocated_Sector_Ct 0x0033 100 100 036 Pre-fail Always - 21 7 Seek_Error_Rate 0x000f 072 060 030 Pre-fail Always - 17476217 9 Power_On_Hours 0x0032 097 097 000 Old_age Always - 3169 10 Spin_Retry_Count 0x0013 100 100 097 Pre-fail Always - 0 12 Power_Cycle_Count 0x0032 100 100 020 Old_age Always - 341 183 Unknown_Attribute 0x0000 100 100 000 Old_age Offline - 0 184 Unknown_Attribute 0x0032 100 100 099 Old_age Always - 0 187 Reported_Uncorrect 0x0032 100 100 000 Old_age Always - 0 188 Unknown_Attribute 0x0032 100 099 000 Old_age Always - 16 189 High_Fly_Writes 0x003a 100 100 000 Old_age Always - 0 190 Airflow_Temperature_Cel 0x0022 054 050 045 Old_age Always - 46 (Lifetime Min/Max 29/46) 194 Temperature_Celsius 0x0022 046 050 000 Old_age Always - 46 (0 15 0 0) 195 Hardware_ECC_Recovered 0x001a 026 021 000 Old_age Always - 155041021 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 - 245199682932762 241 Unknown_Attribute 0x0000 100 253 000 Old_age Offline - 2387432809 242 Unknown_Attribute 0x0000 100 253 000 Old_age Offline - 1541266388 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% 3169 - 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.
Ejemplo de disco duro apunto de morir:
$ smartctl -a /dev/sdb smartctl 5.40 2010-02-03 r3060 [i686-pc-linux-gnu] (local build) Copyright (C) 2002-10 by Bruce Allen, http://smartmontools.sourceforge.net === START OF INFORMATION SECTION === Model Family: Seagate Barracuda ES.2 Device Model: ST3500320NS Serial Number: 9QMC2983 Firmware Version: SN06 User Capacity: 500,107,862,016 bytes Device is: In smartctl database [for details use: -P show] ATA Version is: 8 ATA Standard is: ATA-8-ACS revision 4 Local Time is: Thu Sep 1 07:49:15 2011 CEST 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: ( 650) 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: ( 119) minutes. Conveyance self-test routine recommended polling time: ( 2) minutes. SCT capabilities: (0x103d) SCT Status 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 030 029 044 Pre-fail Always FAILING_NOW 27148058 3 Spin_Up_Time 0x0003 099 099 000 Pre-fail Always - 0 4 Start_Stop_Count 0x0032 100 100 020 Old_age Always - 22 5 Reallocated_Sector_Ct 0x0033 001 001 036 Pre-fail Always FAILING_NOW 2045 7 Seek_Error_Rate 0x000f 076 060 030 Pre-fail Always - 4341683886 9 Power_On_Hours 0x0032 085 085 000 Old_age Always - 13745 10 Spin_Retry_Count 0x0013 100 100 097 Pre-fail Always - 0 12 Power_Cycle_Count 0x0032 100 100 020 Old_age Always - 22 184 End-to-End_Error 0x0032 100 100 099 Old_age Always - 0 187 Reported_Uncorrect 0x0032 001 001 000 Old_age Always - 24353 188 Command_Timeout 0x0032 076 054 000 Old_age Always - 687205253280 189 High_Fly_Writes 0x003a 100 100 000 Old_age Always - 0 190 Airflow_Temperature_Cel 0x0022 064 052 045 Old_age Always - 36 (Lifetime Min/Max 35/38) 194 Temperature_Celsius 0x0022 036 048 000 Old_age Always - 36 (0 18 0 0) 195 Hardware_ECC_Recovered 0x001a 041 041 000 Old_age Always - 27148058 197 Current_Pending_Sector 0x0012 100 100 000 Old_age Always - 2 198 Offline_Uncorrectable 0x0010 100 100 000 Old_age Offline - 2 199 UDMA_CRC_Error_Count 0x003e 200 200 000 Old_age Always - 0 SMART Error Log Version: 1 ATA Error Count: 232 (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 232 occurred at disk power-on lifetime: 13685 hours (570 days + 5 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 -- -- -- -- -- -- -- 04 71 04 9d 00 32 e0 Device Fault; Error: ABRT Commands leading to the command that caused the error were: CR FR SC SN CL CH DH DC Powered_Up_Time Command/Feature_Name -- -- -- -- -- -- -- -- ---------------- -------------------- a1 00 00 00 00 00 a0 00 13d+18:32:31.531 IDENTIFY PACKET DEVICE ec 00 00 00 00 00 a0 00 13d+18:32:31.523 IDENTIFY DEVICE ff 00 00 00 00 00 00 00 13d+18:32:31.367 [VENDOR SPECIFIC] 00 00 00 00 00 00 00 04 13d+18:32:31.366 NOP [Abort queued commands] a1 00 00 00 00 00 a0 00 13d+18:32:26.375 IDENTIFY PACKET DEVICE Error 231 occurred at disk power-on lifetime: 13685 hours (570 days + 5 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 -- -- -- -- -- -- -- 04 71 04 9d 00 32 e0 Commands leading to the command that caused the error were: CR FR SC SN CL CH DH DC Powered_Up_Time Command/Feature_Name -- -- -- -- -- -- -- -- ---------------- -------------------- ec 00 00 00 00 00 a0 00 13d+18:32:31.523 IDENTIFY DEVICE ff 00 00 00 00 00 00 00 13d+18:32:31.367 [VENDOR SPECIFIC] 00 00 00 00 00 00 00 04 13d+18:32:31.366 NOP [Abort queued commands] a1 00 00 00 00 00 a0 00 13d+18:32:26.375 IDENTIFY PACKET DEVICE ec 00 00 00 00 00 a0 00 13d+18:32:26.367 IDENTIFY DEVICE Error 230 occurred at disk power-on lifetime: 13685 hours (570 days + 5 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 -- -- -- -- -- -- -- 04 71 04 9d 00 32 e0 Device Fault; Error: ABRT Commands leading to the command that caused the error were: CR FR SC SN CL CH DH DC Powered_Up_Time Command/Feature_Name -- -- -- -- -- -- -- -- ---------------- -------------------- a1 00 00 00 00 00 a0 00 13d+18:32:26.375 IDENTIFY PACKET DEVICE ec 00 00 00 00 00 a0 00 13d+18:32:26.367 IDENTIFY DEVICE ff 00 00 00 00 00 00 00 13d+18:32:26.211 [VENDOR SPECIFIC] 00 00 00 00 00 00 00 04 13d+18:32:26.210 NOP [Abort queued commands] a1 00 00 00 00 00 a0 00 13d+18:32:26.187 IDENTIFY PACKET DEVICE Error 229 occurred at disk power-on lifetime: 13685 hours (570 days + 5 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 -- -- -- -- -- -- -- 04 71 04 9d 00 32 e0 Commands leading to the command that caused the error were: CR FR SC SN CL CH DH DC Powered_Up_Time Command/Feature_Name -- -- -- -- -- -- -- -- ---------------- -------------------- ec 00 00 00 00 00 a0 00 13d+18:32:26.367 IDENTIFY DEVICE ff 00 00 00 00 00 00 00 13d+18:32:26.211 [VENDOR SPECIFIC] 00 00 00 00 00 00 00 04 13d+18:32:26.210 NOP [Abort queued commands] a1 00 00 00 00 00 a0 00 13d+18:32:26.187 IDENTIFY PACKET DEVICE ec 00 00 00 00 00 a0 00 13d+18:32:26.165 IDENTIFY DEVICE Error 228 occurred at disk power-on lifetime: 13685 hours (570 days + 5 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 -- -- -- -- -- -- -- 04 71 04 9d 00 32 e0 Device Fault; Error: ABRT Commands leading to the command that caused the error were: CR FR SC SN CL CH DH DC Powered_Up_Time Command/Feature_Name -- -- -- -- -- -- -- -- ---------------- -------------------- a1 00 00 00 00 00 a0 00 13d+18:32:26.187 IDENTIFY PACKET DEVICE ec 00 00 00 00 00 a0 00 13d+18:32:26.165 IDENTIFY DEVICE 25 00 20 ff ff ff ef 00 13d+18:32:22.590 READ DMA EXT b0 d5 01 09 4f c2 00 00 13d+18:27:14.751 SMART READ LOG b0 d5 01 06 4f c2 00 00 13d+18:27:14.702 SMART READ LOG 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.