linux下的硬盘检测工具 Smartmontools
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/sda
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 <device>”可以查看硬盘的日志,日志又分为多种类型,如selftest、error等等。
?
?
例如查看硬盘检测的日志,如下:
# smartctl -l selftest /dev/sda
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/sda
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/sda
其中
Power_On_Hours 就是我要的数据