Smartctl es una herramienta la cual nos permitirá realizar un testeo de nuestros Discos Rígidos, la cual nos brinda un detallado informe mediante el cual podremos verificar el funcionamiento o posibles errores que posean nuestras unidades… salvándonos de un buen dolorcito de cabeza.
Primero vamos a instalarlo:
# yum install smartmontools
Luego que se instala procederemos a hacer los testeos:
Listamos los discos/particiones solo con el fin de obtener los nombres de nuestras unidades
# df -h Filesystem Size Used Avail Use% Mounted on /dev/sda2 897G 380G 471G 45% / /dev/sda5 2.0G 383M 1.5G 21% /tmp /dev/sda1 99M 32M 62M 34% /boot tmpfs 3.9G 0 3.9G 0% /dev/shm /dev/sdb1 917G 707G 164G 82% /hd2
Aqui vemos que nuestros 2 discos son /dev/sda y /dev/sdb, esos nombres utilizaremos como ejemplos
1) Detalle de la info de los discos:
# smartctl -i /dev/sda smartctl 5.42 2011-10-20 r3458 [fusion_builder_container hundred_percent="yes" overflow="visible"][fusion_builder_row][fusion_builder_column type="1_1" background_position="left top" background_color="" border_size="" border_color="" border_style="solid" spacing="yes" background_image="" background_repeat="no-repeat" padding="" margin_top="0px" margin_bottom="0px" class="" id="" animation_type="" animation_speed="0.3" animation_direction="left" hide_on_mobile="no" center_content="no" min_height="none"][x86_64-linux-2.6.18-498.el5.lve0.8.80] (local build) Copyright (C) 2002-11 by Bruce Allen, http://smartmontools.sourceforge.net === START OF INFORMATION SECTION === Device Model: MB1000EBNCF Serial Number: WCAW30756532 LU WWN Device Id: 5 0014ee 25ac27419 Firmware Version: HPG0 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 6 Local Time is: Mon Apr 6 17:06:32 2015 ART SMART support is: Available - device has SMART capability. SMART support is: Enabled
2) Un testeo solo informativo:
# smartctl -H /dev/sda smartctl 5.42 2011-10-20 r3458 [x86_64-linux-2.6.18-498.el5.lve0.8.80] (local build) Copyright (C) 2002-11 by Bruce Allen, http://smartmontools.sourceforge.net === START OF READ SMART DATA SECTION === SMART overall-health self-assessment test result: PASSED
Este resultado nos muestra que todo esta OK.
IMPORTANTE: Como se mostraría un error a tener muy en cuenta:
# smartctl -H /dev/sda smartctl 5.42 2011-10-20 r3458 [x86_64-linux-2.6.18-498.el5.lve0.8.80] (local build) Copyright (C) 2002-11 by Bruce Allen, http://smartmontools.sourceforge.net === 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. Failed Attributes: ID# ATTRIBUTE_NAME FLAG VALUE WORST THRESH TYPE UPDATED WHEN_FAILED RAW_VALUE 1 Raw_Read_Error_Rate 0x002f 001 001 051 Pre-fail Always FAILING_NOW 330223
Increíblemente el detalle muestra que el disco puede tener un fallo en las próximas 24 hs, por lo que hay que realizar una inmedita copia del contenido.
3) Testeo a fondo, el cual detallará cualquier tipo de error o falla en los discos:
# smartctl -t long /dev/sda smartctl 5.43 2012-06-30 r3573 [x86_64-linux-2.6.32-504.1.3.el6.x86_64] (local build) Copyright (C) 2002-12 by Bruce Allen, http://smartmontools.sourceforge.net === START OF OFFLINE IMMEDIATE AND SELF-TEST SECTION === Sending command: "Execute SMART Extended self-test routine immediately in off-line mode". Drive command "Execute SMART Extended self-test routine immediately in off-line mode" successful. Testing has begun. Please wait 121 minutes for test to complete. Test will complete after Mon Apr 6 19:44:02 2015 Use smartctl -X to abort test.
4) Testeo rápido:
# smartctl -t short /dev/sda smartctl 5.43 2012-06-30 r3573 [x86_64-linux-2.6.32-504.1.3.el6.x86_64] (local build) Copyright (C) 2002-12 by Bruce Allen, http://smartmontools.sourceforge.net === 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 Apr 6 17:48:38 2015
Como vemos aqui, los testeos “short y long” son offline y deberemos verificar el resultado con:
# smartctl -l selftest /dev/sda smartctl 5.43 2012-06-30 r3573 [x86_64-linux-2.6.32-504.1.3.el6.x86_64] (local build) Copyright (C) 2002-12 by Bruce Allen, http://smartmontools.sourceforge.net === START OF READ SMART DATA SECTION === 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% 9627 -
Una herramienta muy útil ante cualquier tipo de aviso o sospecha de daño. A tenerlo en cuenta![/fusion_builder_column][/fusion_builder_row][/fusion_builder_container]