Smartctl命令显示硬盘详细信息
(2011-08-30 14:21:41 )
标签:
linux
硬盘驱动器
信息
使用
时间
闲谈
1.1
什么是Smartmontools?
Smartmontools是一个通过控制和管理硬盘上的自感知分析(smart )来发现硬盘的工具
报告
技术(Technology,自动检测分析与报告技术)技术实现,SMART技术监控硬盘头单元、磁盘电机驱动器系统、硬盘内部电路和磁盘表面的介质材料等,SMART在硬盘上出现问题SMART技术假设主板受支持
SMART技术也不能保证可以预测所有可能出现的硬盘故障。 智能(SFf-8035 I ) )。
用硬盘制造商制定的工业标准,在硬盘中保存执行情况、可靠性、读取错误率等属性的表。 所有属性都包含1字节(大小范围1-253 )的标准化值和另一个1字节的重要阶段值。 如果属性工作表中的数据小于或达到重要的阶段值,则表明硬盘驱动器工作不正常。
2.1使用smartmontools
1、启动监测流程
# /etc/init.d/smartd start
smartd: [启动: [确定]
2、检查硬盘在SMART 1993年以后出厂的硬盘基本上是否支持SMART技术,可以使用以下命令进行确认:
# smartctl -i /dev/hdb
smartctl 5.33版[ i686-turbo-Linux-GNU ]版权所有(c ) 2002-4
布鲁斯艾伦
home page is http://smartmontools.source forge.net /
===startofinformationsection===
设备型号: ST 3160212 a
Serial Number: 5LS2EDKN
Firmware Version: 3.AAE
用户容量:160,041,885,696字节
device is : notinsmartctldatabase [ fordetailsuse :-p ]
showall]
ATA版本is : 7
atastandardis : exactataspecificationdraftversionnot
未指定
本地时间is : monsep 1702336013360372007 CST
smartsupportis :可用设备体系结构。
智能支持is :启用
从上面的信息可以看到,该硬盘支持SMART技术,目前已打开。 如果智能支持is :
禁用表示未启用SMART,然后运行以下命令启动SMART :
smartctl---smart=on---offline auto=on---save auto=on/dev/hdb
3、检查硬盘健康状况
# smartctl -H
/dev/hdb
smartctl 5.33版[ i686-turbo-Linux-GNU ]版权所有(c ) 2002-4
布鲁斯艾伦
home page is http://smartmontools.source forge.net /
===startofreadsmartdatasection===
智能健康自助评估测试结果:通过
请注意result之后的结果。 PASSED,这表示硬盘健康状况良好。 如果此处显示故障,建议立即将硬盘更换为服务器。 SMART只能报告磁盘不再健康,但不确定报警后可以持续运行多久。 通常,SMART报警参数是保留的,磁盘发出报警后不会当场损坏。 一般能坚持一段时间。 部分硬盘智能报警后仍会持续运行多年,部分硬盘智能在报告错误几天后就会损坏。 千万不能有运气。 运行以下命令可显示详细参数:
# smartctl -A /dev/hdb
smartctl 5.33版[ i686-turbo-Linux-GNU ]版权所有(c ) 2002-4
布鲁斯艾伦
Home page is http://smartmontools.sourceforge.net/=== START OF READ SMART DATA SECTION ===
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 114 100 006 Pre-fail Always -
81812244
3 Spin_Up_Time 0x0003 100 099 000 Pre-fail Always - 0
4 Start_Stop_Count 0x0032 100 100 020 Old_age Always - 257
5 Reallocated_Sector_Ct 0x0033 100 100 036 Pre-fail Always -
0
7 Seek_Error_Rate 0x000f 078 060 030 Pre-fail Always -
64781708
9 Power_On_Hours 0x0032 096 096 000 Old_age Always - 4365
10 Spin_Retry_Count 0x0013 100 100 097 Pre-fail Always - 0
12 Power_Cycle_Count 0x0032 100 100 020 Old_age Always - 276
187 Unknown_Attribute 0x0032 100 100 000 Old_age Always - 0
189 Unknown_Attribute 0x003a 100 100 000 Old_age Always - 0
190 Unknown_Attribute 0x0022 058 053 045 Old_age Always -
773324842
194 Temperature_Celsius 0x0022 042 047 000 Old_age Always - 42
(Lifetime Min/Max 0/21)
195 Hardware_ECC_Recovered 0x001a 052 048 000 Old_age Always -
1562815
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
200 Multi_Zone_Error_Rate 0x0000 100 253 000 Old_age Offline -
0
202 TA_Increase_Count 0x0032 100 253 000 Old_age Always - 0
FLAG是标记,标准数值(VALUE)应当小于或等於关键值(THRESH)。WHEN_FAILED
代表错误信息,上面显示的WHEN_FAILED纵行是空行,说明硬盘没有故障。如果WHEN_FAILED显示数字,表明硬盘磁道可能有比较大的坏道。
4、对硬盘进行检测 手工对硬盘进行测试的方法有以下四种:
smartctl -t short
后台检测硬盘,消耗时间短
smartctl -t long
后台检测硬盘,消耗时间长
smartctl -C -t short
前台检测硬盘,消耗时间短
smartctl -C -t long
前台检测硬盘,消耗时间长
例如,在后台对硬盘进行详细的检查,命令如下:
# smartctl -t long /dev/hdb
smartctl version 5.33 [i686-turbo-linux-gnu] Copyright (C) 2002-4
Bruce Allen
Home page is 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 54 minutes for test to complete.
Test will complete after Mon Sep 17 03:53:32 2007
Use smartctl -X to abort test.
上面的信息显示54分钟后将完成检查,同时可以使用 smartctl -X 终止检查。终止硬盘检查命令的使用方法是:
# smartctl -X /dev/hdb
smartctl version 5.33 [i686-turbo-linux-gnu] Copyright (C) 2002-4
Bruce Allen
Home page is http://smartmontools.sourceforge.net/
=== START OF OFFLINE IMMEDIATE AND SELF-TEST SECTION ===
Sending command: "Abort SMART off-line mode self-test
routine".
Self-testing aborted!
5、查看硬盘日志 使用“smartctl -l logtype
”可以查看硬盘的日志,日志又分为多种类型,如selftest、error等等。例如查看硬盘检测的日志,如下:
# smartctl -l selftest /dev/hdb
smartctl version 5.33 [i686-turbo-linux-gnu] Copyright (C) 2002-4
Bruce Allen
Home page is 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 Extended offline Aborted by host 90% 4365 -
# 2 Extended offline Completed without error 00% 4247 -
# 3 Short offline Aborted by host 30% 4246 -
# 4 Short offline Aborted by host 10% 4246 -
# 5 Extended offline Completed without error 00% 4229 -
查看硬盘错误日志:
# smartctl -l error /dev/hdb
smartctl version 5.33 [i686-turbo-linux-gnu] Copyright (C) 2002-4
Bruce Allen
Home page is http://smartmontools.sourceforge.net/
=== START OF READ SMART DATA SECTION ===
SMART Error Log Version: 1
No Errors Logged
我主要是要看通电时间,所以只用了:
smartctl -A /dev/hda
Power_On_Hours 就是我要的数据
分享:
喜欢
0
赠金笔
加载中,请稍候......
评论加载中,请稍候...
发评论
登录名: 密码: 找回密码 注册记住登录状态
昵 称:
评论并转载此博文
发评论
以上网友发言只代表其个人观点,不代表新浪网的观点或立场。