天际说

CentOS下查看硬盘已使用时间

发布时间:2014年9月27日 / 分类:未分类的 / 8,960 次围观 / 抢沙发!

在windows系统下我们可以使用hdtune、鲁大师之类的软件查看硬盘的使用时间,那么如何在Centos下查看硬盘已使用时间呢,很简单
安装smartmontools:
yum install smartmontools -y

查看硬盘信息:
smartctl -A /dev/sda
如果不行用df看看硬盘名称,把sda换了即可

如果提示 “bash: smartctl: command not found” ,可以用whereis smartctl 查看一下 smartctl的路径再执行 “路径/smartctl -A /dev/sda”

[root@server ~]# smartctl -A /dev/sda1
smartctl version 5.38 [i686-redhat-linux-gnu] Copyright (C) 2002-8 Bruce Allen
Home page is 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
3 Spin_Up_Time 0x0027 226 226 063 Pre-fail Always – 2356
4 Start_Stop_Count 0x0032 253 253 000 Old_age Always – 21
5 Reallocated_Sector_Ct 0x0033 253 253 063 Pre-fail Always – 0
6 Read_Channel_Margin 0x0001 253 253 100 Pre-fail Offline – 0
7 Seek_Error_Rate 0x000a 253 252 000 Old_age Always – 0
8 Seek_Time_Performance 0x0027 244 234 187 Pre-fail Always – 63567
9 Power_On_Minutes 0x0032 145 145 000 Old_age Always – 294h+35m
10 Spin_Retry_Count 0x002b 253 252 157 Pre-fail Always – 0
11 Calibration_Retry_Count 0x002b 253 252 223 Pre-fail Always – 0
12 Power_Cycle_Count 0x0032 253 253 000 Old_age Always – 36
192 Power-Off_Retract_Count 0x0032 253 253 000 Old_age Always – 0
193 Load_Cycle_Count 0x0032 253 253 000 Old_age Always – 0
194 Temperature_Celsius 0x0032 026 253 000 Old_age Always – 33
195 Hardware_ECC_Recovered 0x000a 253 252 000 Old_age Always – 421
196 Reallocated_Event_Count 0x0008 253 253 000 Old_age Offline – 0
197 Current_Pending_Sector 0x0008 253 253 000 Old_age Offline – 0
198 Offline_Uncorrectable 0x0008 253 253 000 Old_age Offline – 0
199 UDMA_CRC_Error_Count 0x0008 199 199 000 Old_age Offline – 0
200 Multi_Zone_Error_Rate 0x000a 253 252 000 Old_age Always – 0
201 Soft_Read_Error_Rate 0x000a 253 252 000 Old_age Always – 0
202 TA_Increase_Count 0x000a 253 252 000 Old_age Always – 0
203 Run_Out_Cancel 0x000b 253 252 180 Pre-fail Always – 0
204 Shock_Count_Write_Opern 0x000a 253 252 000 Old_age Always – 0
205 Shock_Rate_Write_Opern 0x000a 253 252 000 Old_age Always – 0
207 Spin_High_Current 0x002a 253 252 000 Old_age Always – 0
208 Spin_Buzz 0x002a 253 252 000 Old_age Always – 0
209 Offline_Seek_Performnce 0x0024 240 240 000 Old_age Offline – 156
210 Unknown_Attribute 0x0032 253 252 000 Old_age Always – 0
211 Unknown_Attribute 0x0032 253 252 000 Old_age Always – 0
212 Unknown_Attribute 0x0032 253 252 000 Old_age Always – 0
其中Power_On_Hours就是硬盘使用小时了,如果是Power_On_Minutes就是硬盘使用分钟
例如:
9 Power_On_Minutes 0×0032 201 201 000 Old_age Always – 649h+23m

转自http://www.lanmeng.org/centos-view-hard-disk-has-been-used-time.html

标签:none