嵌入式工具——smartmontools

Smartmontools是一种硬盘检测工具,通过控制和管理硬盘的SMART(Self Monitoring Analysis and Reporting Technology,自动检测分析及报告技术)技术来实现的,SMART技术可以对硬盘的磁头单元、盘片电机驱动系统、硬盘内部电路以及盘片表面介质材料等进行监测,当SMART监测并分析出硬盘可能出现问题时会及时向用户报警以避免计算机数据受损失。

版本:smartmontools-6.2

编译方法:

1. ./configure --host=arm-hisiv300-linux LDFLAGS=-static
2. make
3. object file:
  arm-hisiv300-linux-strip smartctl

注:arm-hisiv300-linux交叉编译器

smart信息分析:

smartctl 6.2 2013-07-26 r3841 [armv7l-linux-3.0.8] (local build)
Copyright (C) 2002-13, Bruce Allen, Christian Franke, www.smartmontools.org


=== START OF INFORMATION SECTION ===
Model Family:     Western Digital AV-GP (AF)
Device Model:     WDC WD10EURX-73C57Y0
Serial Number:    WD-WCC4J0336158
LU WWN Device Id: 5 0014ee 2b3825b79
Firmware Version: 01.01A01
User Capacity:    1,000,204,886,016 bytes [1.00 TB]
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:   ACS-2 (minor revision not indicated)
SATA Version is:  SATA 3.0, 6.0 Gb/s (current: 3.0 Gb/s)
Local Time is:    Tue Mar 11 16:57:54 2014 UTC
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: (13140) 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: ( 149) minutes.
Conveyance self-test routine
recommended polling time: (   5) minutes.
SCT capabilities:       (0x3035) 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   106   099   006    Pre-fail  Always       -       10594752
  3 Spin_Up_Time            0x0003   099   099   000    Pre-fail  Always       -       0
  4 Start_Stop_Count        0x0032   100   100   020    Old_age   Always       -       4
  5 Reallocated_Sector_Ct   0x0033   100   100   010    Pre-fail  Always       -       0
  7 Seek_Error_Rate         0x000f   100   253   030    Pre-fail  Always       -       219589
  9 Power_On_Hours          0x0032   100   100   000    Old_age   Always       -       27
 10 Spin_Retry_Count        0x0013   100   100   097    Pre-fail  Always       -       0
 12 Power_Cycle_Count       0x0032   100   100   020    Old_age   Always       -       2
183 Runtime_Bad_Block       0x0032   100   100   000    Old_age   Always       -       0
184 End-to-End_Error        0x0032   100   100   099    Old_age   Always       -       0
187 Reported_Uncorrect      0x0032   100   100   000    Old_age   Always       -       0
188 Command_Timeout         0x0032   100   100   000    Old_age   Always       -       0 0 0
189 High_Fly_Writes         0x003a   100   100   000    Old_age   Always       -       0
190 Airflow_Temperature_Cel 0x0022   056   050   045    Old_age   Always       -       44 (Min/Max 16/50)
191 G-Sense_Error_Rate      0x0032   100   100   000    Old_age   Always       -       0
192 Power-Off_Retract_Count 0x0032   100   100   000    Old_age   Always       -       2
193 Load_Cycle_Count        0x0032   100   100   000    Old_age   Always       -       4
194 Temperature_Celsius     0x0022   044   050   000    Old_age   Always       -       44 (0 16 0 0 0)
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      -       27h+05m+53.346s
241 Total_LBAs_Written      0x0000   100   253   000    Old_age   Offline      -       90322384
242 Total_LBAs_Read         0x0000   100   253   000    Old_age   Offline      -       1930609

SMART Error Log Version: 1
No Errors Logged


------------------------------------------ 第二中情况 有硬盘错误日志--------------------------------------------------
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       -       28
  3 Spin_Up_Time            0x0027   130   128   021    Pre-fail  Always       -       4458
  4 Start_Stop_Count        0x0032   100   100   000    Old_age   Always       -       18
  5 Reallocated_Sector_Ct   0x0033   142   142   140    Pre-fail  Always       -       2478
  7 Seek_Error_Rate         0x002e   195   180   000    Old_age   Always       -       1694
  9 Power_On_Hours          0x0032   098   098   000    Old_age   Always       -       1788
 10 Spin_Retry_Count        0x0032   100   253   000    Old_age   Always       -       0
 11 Calibration_Retry_Count 0x0032   100   253   000    Old_age   Always       -       0
 12 Power_Cycle_Count       0x0032   100   100   000    Old_age   Always       -       12
192 Power-Off_Retract_Count 0x0032   200   200   000    Old_age   Always       -       10
193 Load_Cycle_Count        0x0032   200   200   000    Old_age   Always       -       7
194 Temperature_Celsius     0x0022   109   099   000    Old_age   Always       -       34
196 Reallocated_Event_Count 0x0032   074   074   000    Old_age   Always       -       126
197 Current_Pending_Sector  0x0032   200   200   000    Old_age   Always       -       2
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
ATA Error Count: 3399 (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 3399 occurred at disk power-on lifetime: 1788 hours (74 days + 12 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 61 46 00 00 00 a0  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
  -- -- -- -- -- -- -- --  ----------------  --------------------
  ef 03 46 00 00 00 a0 08  44d+03:37:47.113  SET FEATURES [Set transfer mode]
  ec 00 00 00 00 00 a0 08  44d+03:37:47.113  IDENTIFY DEVICE
  c8 00 08 10 20 01 e0 08  44d+03:37:47.113  READ DMA
  ec 00 00 00 00 00 a0 08  44d+03:37:47.112  IDENTIFY DEVICE
  ef 03 46 00 00 00 a0 08  44d+03:37:47.112  SET FEATURES [Set transfer mode]


Error 3398 occurred at disk power-on lifetime: 1788 hours (74 days + 12 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 61 08 10 20 01 e0  Device Fault; Error: ABRT 8 sectors at LBA = 0x00012010 = 73744


  Commands leading to the command that caused the error were:
  CR FR SC SN CL CH DH DC   Powered_Up_Time  Command/Feature_Name
  -- -- -- -- -- -- -- --  ----------------  --------------------
  c8 00 08 10 20 01 e0 08  44d+03:37:47.113  READ DMA
  ec 00 00 00 00 00 a0 08  44d+03:37:47.112  IDENTIFY DEVICE
  ef 03 46 00 00 00 a0 08  44d+03:37:47.112  SET FEATURES [Set transfer mode]
  ec 00 00 00 00 00 a0 08  44d+03:37:47.112  IDENTIFY DEVICE
  c8 00 08 10 20 01 e0 08  44d+03:37:47.111  READ DMA


Error 3397 occurred at disk power-on lifetime: 1788 hours (74 days + 12 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 61 46 00 00 00 a0  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
  -- -- -- -- -- -- -- --  ----------------  --------------------
  ef 03 46 00 00 00 a0 08  44d+03:37:47.112  SET FEATURES [Set transfer mode]
  ec 00 00 00 00 00 a0 08  44d+03:37:47.112  IDENTIFY DEVICE
  c8 00 08 10 20 01 e0 08  44d+03:37:47.111  READ DMA
  ec 00 00 00 00 00 a0 08  44d+03:37:47.111  IDENTIFY DEVICE
  ef 03 46 00 00 00 a0 08  44d+03:37:47.111  SET FEATURES [Set transfer mode]


Error 3396 occurred at disk power-on lifetime: 1788 hours (74 days + 12 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 61 08 10 20 01 e0  Device Fault; Error: ABRT 8 sectors at LBA = 0x00012010 = 73744


  Commands leading to the command that caused the error were:
  CR FR SC SN CL CH DH DC   Powered_Up_Time  Command/Feature_Name
  -- -- -- -- -- -- -- --  ----------------  --------------------
  c8 00 08 10 20 01 e0 08  44d+03:37:47.111  READ DMA
  ec 00 00 00 00 00 a0 08  44d+03:37:47.111  IDENTIFY DEVICE
  ef 03 46 00 00 00 a0 08  44d+03:37:47.111  SET FEATURES [Set transfer mode]
  ec 00 00 00 00 00 a0 08  44d+03:37:47.110  IDENTIFY DEVICE
  c8 00 08 10 20 01 e0 08  44d+03:37:47.110  READ DMA


Error 3395 occurred at disk power-on lifetime: 1788 hours (74 days + 12 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 61 46 00 00 00 a0  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
  -- -- -- -- -- -- -- --  ----------------  --------------------
  ef 03 46 00 00 00 a0 08  44d+03:37:47.111  SET FEATURES [Set transfer mode]
  ec 00 00 00 00 00 a0 08  44d+03:37:47.110  IDENTIFY DEVICE
  c8 00 08 10 20 01 e0 08  44d+03:37:47.110  READ DMA
  ec 00 00 00 00 00 a0 08  44d+03:37:47.109  IDENTIFY DEVICE
  ef 03 46 00 00 00 a0 08  44d+03:37:47.109  SET FEATURES [Set transfer mode]
--------------------------------------- end ---------------------------------------------------

Raw_Read_Error_Rate:读取硬盘时出现的硬件读取出错率,不同厂家不一样
Reallocated_Sector_Ct:坏扇区被发现并且重新映射备用扇区,RAW_VALUE就是被映射扇区数
Reallocated_Event_Count:重映射操作次数
Spin_Retry_Count:硬盘第一次没转动,然后再次转动的次数,如果有升高说明机械故障或者供电原因
Current_Pending_Sector:当前被怀疑有坏扇区等待重新off-line验证的数量,如果验证失败就重新映射扇区
End-to-End_Error:传输数据的时候缓存里的数据和主控,硬盘无法相对应
Command_Timeout:硬盘工作中出现超时,一般是电源或者数据线问题
UDMA_CRC_Error_Count: 


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.


  • 0
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
Smartmontools是一个硬盘检测工具,可以用来监视硬盘的运行状况。它可以单独运行,也可以注册为系统服务。通过使用Smartmontools,您可以查看硬盘的一些“秘密”信息,比如温度、写入量、使用寿命值等。\[1\]\[2\]此外,Smartmontools还提供了一些S.M.A.R.T.指标,如Reallocated_Sector_Count、Reported_Uncorrectable_Errors、Command_Timeout、Current_Pending_Sector_Count和Offline_Uncorrectable,这些指标可以帮助您判断硬盘是否存在故障的风险。如果这些指标中的任何一项值大于0,那么就应该对该磁盘进行持续的关注,因为这可能意味着硬盘驱动器即将发生故障。\[3\] #### 引用[.reference_title] - *1* [硬盘检测工具Smartmontools安装、部署、使用](https://blog.csdn.net/qq_18941425/article/details/126872260)[target="_blank" data-report-click={"spm":"1018.2226.3001.9630","extra":{"utm_source":"vip_chatgpt_common_search_pc_result","utm_medium":"distribute.pc_search_result.none-task-cask-2~all~insert_cask~default-1-null.142^v91^control_2,239^v3^insert_chatgpt"}} ] [.reference_item] - *2* *3* [Linux中SSD的smart信息——smartmontools工具](https://blog.csdn.net/weixin_38428439/article/details/121482073)[target="_blank" data-report-click={"spm":"1018.2226.3001.9630","extra":{"utm_source":"vip_chatgpt_common_search_pc_result","utm_medium":"distribute.pc_search_result.none-task-cask-2~all~insert_cask~default-1-null.142^v91^control_2,239^v3^insert_chatgpt"}} ] [.reference_item] [ .reference_list ]

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值