smartctl

虚拟机不支持这个工具我主要是用它的查看健康状态这个功能,其它的用的少,算是mark以后用的时候再看吧

(1)检测是否开启

/dev/sda2是设备名,可以写需要检测的设备名称,N是终端编号,我在不加-d megaraid,0的时候终端提示如下

[root@rsync ~]# smartctl -i -d megaraid,0 /dev/sda2 | grep Device
Device type:          disk
Device supports SMART and is Disabled            //查看之后支持但是是关闭状态

(2)开启smart

[root@rsync ~]# smartctl --smart=on --offlineauto=on --saveauto=on -d megaraid,0 /dev/sda2

检测是否开启

[root@rsync ~]# smartctl -i -d megaraid,0 /dev/sda2|grep Device
Device type:          disk
Device supports SMART and is Enabled             //已经是enabled状态

(3)查看健康状态

[root@rsync ~]# smartctl -H -d megaraid,0 /dev/sda2 | grep SMART
SMART Health Status: OK

(4)显示设备厂商和属性

[root@rsync ~]# smartctl -A -d megaraid,0 /dev/sda2
smartctl 5.43 2012-06-30 r3573 [x86_64-linux-2.6.32-504.el6.x86_64] (local build)
Copyright (C) 2002-12 by Bruce Allen, http://smartmontools.sourceforge.netCurrent Drive Temperature:     34 C         //设备当前温度
Drive Trip Temperature:        68 C         //驱动跳闸温度(不准确,大神可以告知)
Elements in grown defect list: 0
Vendor (Seagate) cache informationBlocks sent to initiator = 426726713Blocks received from initiator = 2972125000Blocks read from cache and sent to initiator = 532160568Number of read and write commands whose size <= segment size = 71965320Number of read and write commands whose size > segment size = 33
Vendor (Seagate/Hitachi) factory informationnumber of hours powered up = 37215.42number of minutes until next internal SMART test = 2

(5)显示硬盘历史错误信息

[root@rsync ~]# smartctl -l error -d megaraid,0 /dev/sda2
smartctl 5.43 2012-06-30 r3573 [x86_64-linux-2.6.32-504.el6.x86_64] (local build)
Copyright (C) 2002-12 by Bruce Allen, http://smartmontools.sourceforge.netError counter log:Errors Corrected by           Total   Correction     Gigabytes    TotalECC          rereads/    errors   algorithm      processed    uncorrectedfast | delayed   rewrites  corrected  invocations   [10^9 bytes]  errors
read:   157102965        0         0  157102965   157102965       3898.788           0
write:         0        0         0         0          0       5959.977           0
verify: 1984547768        0         0  1984547768   1984547768      46628.006           0Non-medium error count:        5

(6)硬盘自测

[root@rsync ~]# smartctl --test=TEST -d megaraid,0 /dev/sda2 > /var/log/smart_short.log
smartctl 5.43 2012-06-30 r3573 [x86_64-linux-2.6.32-504.el6.x86_64] (local build)
Copyright (C) 2002-12 by Bruce Allen, http://smartmontools.sourceforge.net=======> INVALID ARGUMENT TO -t: TEST
=======> VALID ARGUMENTS ARE: offline, short, long, conveyance, force, vendor,N, select,M-N, pending,N, afterselect,[on|off] <=======//可以采用这些参数,也可以将输出输入到文件中
Use smartctl -h to get a usage summary

中断自测

[root@rsync ~]# smartctl -X -d megaraid,0 /dev/sda2
smartctl 5.43 2012-06-30 r3573 [x86_64-linux-2.6.32-504.el6.x86_64] (local build)
Copyright (C) 2002-12 by Bruce Allen, http://smartmontools.sourceforge.netSelf Test returned without error

显示硬盘测试信息

[root@rsync ~]# smartctl -l selftest -d megaraid,0 /dev/sda2
smartctl 5.43 2012-06-30 r3573 [x86_64-linux-2.6.32-504.el6.x86_64] (local build)
Copyright (C) 2002-12 by Bruce Allen, http://smartmontools.sourceforge.netSMART Self-test log
Num  Test              Status                 segment  LifeTime  LBA_first_err [SK ASC ASQ]Description                              number   (hours)
# 1  Background long   Aborted (by user command)  16   37215                 - [-   -    -]
# 2  Background short  Completed                  16   37215                 - [-   -    -]
# 3  Background long   Completed                  16       1                 - [-   -    -]
# 4  Background short  Completed                  16       0                 - [-   -    -]

(7)显示全部信息

[root@rsync ~]# smartctl -a -d megaraid,0 /dev/sda2
smartctl 5.43 2012-06-30 r3573 [x86_64-linux-2.6.32-504.el6.x86_64] (local build)
Copyright (C) 2002-12 by Bruce Allen, http://smartmontools.sourceforge.netVendor:               SEAGATE
Product:              ST3300657SS
Revision:             ES64
User Capacity:        300,000,000,000 bytes [300 GB]
Logical block size:   512 bytes
Logical Unit id:      0x5000c50043b38c53
Serial number:        6SJ3P4SG
Device type:          disk
Transport protocol:   SAS
Local Time is:        Mon Aug  8 18:02:21 2016 CST
Device supports SMART and is Enabled
Temperature Warning Enabled
SMART Health Status: OKCurrent Drive Temperature:     35 C
Drive Trip Temperature:        68 C
Elements in grown defect list: 0
Vendor (Seagate) cache informationBlocks sent to initiator = 431906112Blocks received from initiator = 2980399378Blocks read from cache and sent to initiator = 532720120Number of read and write commands whose size <= segment size = 71975696Number of read and write commands whose size > segment size = 33
Vendor (Seagate/Hitachi) factory informationnumber of hours powered up = 37216.00number of minutes until next internal SMART test = 27Error counter log:Errors Corrected by           Total   Correction     Gigabytes    TotalECC          rereads/    errors   algorithm      processed    uncorrectedfast | delayed   rewrites  corrected  invocations   [10^9 bytes]  errors
read:   157150833        0         0  157150833   157150833       3900.082           0
write:         0        0         0         0          0       5961.649           0
verify: 1984547768        0         0  1984547768   1984547768      46628.006           0Non-medium error count:        5SMART Self-test log
Num  Test              Status                 segment  LifeTime  LBA_first_err [SK ASC ASQ]Description                              number   (hours)
# 1  Background long   Aborted (by user command)  16   37215                 - [-   -    -]
# 2  Background short  Completed                  16   37215                 - [-   -    -]
# 3  Background long   Completed                  16       1                 - [-   -    -]
# 4  Background short  Completed                  16       0                 - [-   -    -]Long (extended) Self Test duration: 3200 seconds [53.3 minutes]

hdparm

[root@rsync ~]# hdparm -t /dev/sda/dev/sda:Timing buffered disk reads: 894 MB in  3.00 seconds = 297.79 MB/sec

HDSentinel

这个工具我自己装了几遍都有问题,执行以后得到的信息很少,我以为是自己装的有问题,但是反复检查没什么毛病,然后直接去的官网看的,才发现linux版本确实存在这个问题,很多系统或者服务器都不支持。但是windows版本还是可以的。作者在回复网友说是会继续开发linux版本,有最新版本会在官网上发布的,敬请期待。

[root@shijiazhuang ~]# mkdir HDSential
[root@shijiazhuang ~]# cd HDSential/
[root@shijiazhuang HDSential]# ls
hdsentinel_008_x64.zip
[root@shijiazhuang HDSential]# unzip hdsentinel_008_x64.zip
[root@shijiazhuang HDSential]# ls
HDSentinel  hdsentinel_008_x64.zip
[root@shijiazhuang HDSential]# chmod +x HDSentinel
[root@shijiazhuang HDSential]# cp HDSentinel /usr/bin/
[root@shijiazhuang HDSential]# HDSentinel

转载于:https://blog.51cto.com/zhangdl/1835789

linux小知识之硬盘健康状态检测相关推荐

  1. 硬盘健康度检测linux,linux硬盘检测健康状态

    Loading... 使用下面的命令来确认硬盘是否打开了SMART支持 smartctl -i /dev/sda 正常情况下应该会得到下面这样的信息 [root@localhost bbs]# sma ...

  2. 使用鲁大师检测硬盘健康状态

    平时工作中,我们在使用电脑时,大部分的数据保存到硬盘当中.如果硬盘出现了故障,我们存放的数据资料有可能无法读取.因此平常我们需要通过一些工具检查硬盘,防范于未然,及时发现硬盘问题.下面本文给大家介绍一 ...

  3. linux测试工具smartpower,linux下硬盘健康的检测smartmontools

    1.1 什么是Smartmontools? Smartmontools是一种硬盘检测工具,通过控制和管理硬盘的SMART(Self Monitoring Analysis and Reporting ...

  4. iptables的基础知识-iptables中的状态检测

    2019独角兽企业重金招聘Python工程师标准>>> iptables的基础知识-iptables中的状态检测:iptabels被认为是Linux中实现包过滤功能的第四代应用程序. ...

  5. java 简单的健康状态检测系统

    Java输出和输入流,欢迎进入健康状态检测系统,cmd命令行下编译后测试 import java.util.Scanner; public class HealthTest {      public ...

  6. linux服务器健康检查,Linux 检查硬盘健康状态

    不论对于服务器还是工作站, 硬盘应该是电脑内最重要的硬件, 其他硬件坏掉的话换过新的便好, 但硬盘就不同了, 里面的资料才是最重要.本文会介绍在 Linux 下检查硬盘的健康状态. 现在的硬盘大多支援 ...

  7. Vmware ESXi检测服务器RAID和硬盘健康状态

    直接抛出问题的解决方案[Vmware-esx版本5.0/6.x都适用] Vmware-esx 检测raid和硬盘状态的三种方法: 1.官方的vmware-esx-provider-lsiprovide ...

  8. Microsoft Windows 7.0 build 7000 NAP测试--健康状态检测验证报告

    第一份已经发布的测试报告主要是针对Windows 7.0 build 7000的一个功能概览,让大家看看Windows 7.0的主要更新和一些新特性的展现.那么大多数东西是粗浅的,没有细细的品味Win ...

  9. .gpg 进程 linux,小知识之Linux系统中的最大进程数,最大文件描述,最大线程数...

    今天来了解一下linux里面的一些小知识: (一)Linux系统中最大可以起多少个进程? (1)32位系统中最多可以起32768个进程 (2)64位系统中最多可以起2的22次方(4194304)约42 ...

最新文章

  1. 833 计算机学科专业基础综合,2017年西安电子科技大学计算机学院833计算机学科专业基础综合考研仿真模拟题...
  2. 《汇编语言》-王爽-实验7
  3. pythonifnotnone_使用 if x is not None 还是if not x is None
  4. AJAX跨域请求的理解,JAVA
  5. 快速上手友盟推送前后端
  6. codeforces 并查集_codeforces 892E 可撤销并查集
  7. 【2019南京ICPC网络赛 D】Robots【DAG上的随机游走】
  8. pc微信登录扫码显示无法连接服务器,WeAuth微信小程序实现PC网站扫码授权登录...
  9. 圈圈叫你玩usb读书笔记
  10. pdf在线翻译_网页版pdf转换器|pdf转换word免费
  11. 05 Confluent_Kafka权威指南 第五章: kafka内部实现原理
  12. 晨间日记模板 Web应用版 晨间日记软件 开源
  13. 单元测试总结反思_单元测试小反思200字
  14. 知乎爆赞!4504页《微信小程序零基础入门开发文档》+《小程序实战笔记》,你学废了吗?
  15. python截图工具和模拟鼠标键盘_python PyAutoGUI 模拟鼠标键盘操作和截屏功能
  16. 中国水煤浆行业“十四五”规划与运营模式分析报告2022~2028年
  17. 《Bootloader 启动流程和概念介绍》
  18. u盘怎么格式化?格式化后如何恢复数据?4个详细教程
  19. Python多线程下调用win32com包相关问题:pywintypes.com_error: (-2147221008, ‘尚未调用 CoInitialize。‘, None, None)问题处理
  20. 马斯洛理论告诉你,Kubernetes可以满足微服务的这些需求

热门文章

  1. 最快捷的PPT技能提升之路 PPT定制 驼峰设计
  2. JVM GC 日志详解
  3. 【Fiddler学习】Fiddler抓包HTTPS请求和手机抓包
  4. 论文阅读--PVANET: Deep but Lightweight Neural Networks for Real-time Object Detection
  5. 软件定义闪存存储系统关键技术
  6. 友盟-统计不到线上应用数据的坑
  7. 提高 Android 代码质量的4个工具
  8. 造成ORA-12560: TNS: 协议适配器错误的问题的原因有三个:
  9. Django WSGI Error:class.__dict__ not accessible in restricted mode
  10. 网络工程师考试部分技术要点