Smartctl

7 篇文章 0 订阅
smartctl [options] device

补充说明

系统需要安装smartmontools才可以使用smartctl命令。smartmontools 就是利用硬盘 S.M.A.R.T. (Self-Monitoring_Analysis_and_Reporting) 特性特性监测硬盘的软件包,包含 smartctl 和 smartd 两个程序,前者是前台命令行工具、后者是后台运行程序。

# yum install kernel-utils

在 CentOS/Fedora 下安装smartmontools

# apt-get install smartmontools

在 Debian/Ubuntu 下安装

参数

smartctl -a <device> 显示硬盘所有SMART信息。

smartctl -i <device> 显示硬盘model number, serial number,是否开启SMART等信息。

smartctl -s on <device> 如果没有打开SMART技术,使用该命令打开SMART技术。

smartctl -t short <device> 后台检测硬盘,消耗时间短

smartctl -t long <device> 后台检测硬盘,消耗时间长

smartctl -C -t short <device> 前台检测硬盘,消耗时间短

smartctl -C -t long <device> 前台检测硬盘,消耗时间长

smartctl -X <device> 中断后台检测硬盘。

smartctl -l selftest <device> 显示硬盘检测日志。

smartctl -l error <device> 显示硬盘错误汇总。

相关命令

hdparmsmartctl

实例

# smartctl -i /dev/sda 
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
Model Family:     Western Digital Caviar Second Generation Serial ATA family
Device Model:     WDC WD3200JS-55PDB0
Serial Number:    WD-WCAPD1876075
Firmware Version: 21.00M21
User Capacity:    320,072,933,376 bytes
Device is:        In smartctl database [for details use: -P show]
ATA Version is:   7
ATA Standard is:  Exact ATA specification draft version not indicated
Local Time is:    Mon Dec 19 17:21:12 2011 CST
SMART support is: Available - device has SMART capability.
SMART support is: Enabled

检查一下硬盘是否具有 SMART 特性

# smartctl -H /dev/sda 
smartctl version 5.38 [x86_64-redhat-linux-gnu] Copyright (C) 2002-8 Bruce Allen
Home page is http://smartmontools.sourceforge.net/

START OF READ SMART DATA SECTION 
SMART overall-health self-assessment test result: PASSED

查看硬盘健康状态

Note: 结果是 PASSED 并不意味着硬盘100%安全,如果结果是Failure一般都有问题,您需要备份数据或更新硬盘。
# smartctl -t short /dev/sda 
smartctl version 5.38 [x86_64-redhat-linux-gnu] Copyright (C) 2002-8 Bruce Allen
Home page is 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 Dec 19 17:33:51 2011

Use smartctl -X to abort test.

快速检测硬盘。

# smartctl -l selftest /dev/sda

查看硬盘测试结果

#smartctl -l error /dev/sda
  • 0
    点赞
  • 3
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

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

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

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值