`

linux查看硬盘温度和使用情况

 
阅读更多

硬盘用在服务器上好几年了,加上用的时候还是一个用了好几年的旧硬盘,担心它会不会突然挂掉。

用百度搜索linux下查看硬盘温度和使用时间的,发现如下工具:

2007、2008年我配过两台台式机,都用的三星160GB 硬盘,到2015年6月17日,就是现在,用在linux服务器上,还非常优秀。

检测温度:

sudo hddtemp /dev/sda

WARNING: Drive /dev/sda doesn't appear in the database of supported drives

WARNING: But using a common value, it reports something.

WARNING: Note that the temperature shown could be wrong.

WARNING: See --help, --debug and --drivebase options.

WARNING: And don't forget you can add your drive to hddtemp.db

/dev/sda: SAMSUNG HD161HJ                         36°C or °F

 

而另一台机器,用的西数黑盘和希捷,都是160GB的,温度达到50摄氏度左右。

 

另外,三星硬盘噪音还是比较大一点,那会儿的160GB硬盘噪音都那么样,噶扎噶扎的响,用在linux上就温柔多了。

 

主要是品相,我担心硬盘用的时间太长了,怕坏了,上周六拆开用湿毛巾擦了擦,竟然很新,比购买的二手希捷和西数硬盘漂亮多了。应该拍照留念好了。看看我的硬盘在服务器工作了4年左右的使用时间:

smartctl -A /dev/sda

smartctl 5.43 2012-06-30 r3573 [x86_64-linux-2.6.32-358.23.2.el6.x86_64] (local build)

Copyright (C) 2002-12 by Bruce Allen, http://smartmontools.sourceforge.net

 

=== START OF READ SMART DATA SECTION ===

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     0x000f   100   100   051    Pre-fail  Always       -       0

  3 Spin_Up_Time            0x0007   253   253   025    Pre-fail  Always       -       4416

  4 Start_Stop_Count        0x0032   093   093   000    Old_age   Always       -       7642

  5 Reallocated_Sector_Ct   0x0033   253   253   010    Pre-fail  Always       -       0

  7 Seek_Error_Rate         0x000f   253   253   051    Pre-fail  Always       -       0

  8 Seek_Time_Performance   0x0025   253   253   015    Pre-fail  Offline      -       0

  9 Power_On_Hours          0x0032   100   100   000    Old_age   Always       -       45329

 10 Spin_Retry_Count        0x0033   253   253   051    Pre-fail  Always       -       0

 11 Calibration_Retry_Count 0x0012   253   100   000    Old_age   Always       -       0

 12 Power_Cycle_Count       0x0032   097   097   000    Old_age   Always       -       3431

 13 Read_Soft_Error_Rate    0x000e   100   100   000    Old_age   Always       -       382001715

184 End-to-End_Error        0x0033   253   253   099    Pre-fail  Always       -       0

187 Reported_Uncorrect      0x0032   001   001   000    Old_age   Always       -       813

188 Command_Timeout         0x0032   253   253   000    Old_age   Always       -       0

190 Airflow_Temperature_Cel 0x0022   133   112   000    Old_age   Always       -       35 (Min/Max 9/42)

194 Temperature_Celsius     0x0022   130   112   000    Old_age   Always       -       36 (Min/Max 9/42)

195 Hardware_ECC_Recovered  0x001a   100   100   000    Old_age   Always       -       382001715

196 Reallocated_Event_Count 0x0032   253   253   000    Old_age   Always       -       0

197 Current_Pending_Sector  0x0012   253   100   000    Old_age   Always       -       0

198 Offline_Uncorrectable   0x0030   253   253   000    Old_age   Offline      -       0

199 UDMA_CRC_Error_Count    0x003e   200   199   000    Old_age   Always       -       0

200 Multi_Zone_Error_Rate   0x000a   100   100   000    Old_age   Always       -       0

201 Soft_Read_Error_Rate    0x000a   100   100   000    Old_age   Always       -       0

202 Data_Address_Mark_Errs  0x0032   253   253   000    Old_age   Always       -       0

 

 

看这一行:  9 Power_On_Hours          0x0032   100   100   000    Old_age   Always       -       45329

4万多小时了。

 

 

这个工具是linux上自带的。

 

还有一个工具叫hddtemp,需要自己安装,百度搜索可以找到安装方法,centos下需要下载安装,ubuntu上则可以apt-get。其它linux请自行学习。

使用的时候需要root权限:

[dhn@N228 ~]$ sudo hddtemp /dev/sda

WARNING: Drive /dev/sda doesn't appear in the database of supported drives

WARNING: But using a common value, it reports something.

WARNING: Note that the temperature shown could be wrong.

WARNING: See --help, --debug and --drivebase options.

WARNING: And don't forget you can add your drive to hddtemp.db

/dev/sda: SAMSUNG HD161HJ                         36°C or °F

分享到:
评论

相关推荐

Global site tag (gtag.js) - Google Analytics