需要安装这个:
http://smartmontools.sourceforge.net/
如果是centos直接运行yum install smartmontools -y就可以了
debian系统运行 apt-get install smartmontools -y

然后输入这个:
smartctl -A /dev/sda
如果不行用df看看硬盘名称,把sda换了即可

=== 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 0x000b 100 100 016 Pre-fail Always - 0
2 Throughput_Performance 0x0005 130 130 054 Pre-fail Offline - 152
3 Spin_Up_Time 0x0007 109 109 024 Pre-fail Always - 650 (Average 626)
4 Start_Stop_Count 0x0012 100 100 000 Old_age Always - 45
5 Reallocated_Sector_Ct 0x0033 100 100 005 Pre-fail Always - 0
7 Seek_Error_Rate 0x000b 100 100 067 Pre-fail Always - 0
8 Seek_Time_Performance 0x0005 132 132 020 Pre-fail Offline - 33
9 Power_On_Hours 0x0012 094 094 000 Old_age Always - 42920
10 Spin_Retry_Count 0x0013 100 100 060 Pre-fail Always - 0
12 Power_Cycle_Count 0x0032 100 100 000 Old_age Always - 43
192 Power-Off_Retract_Count 0x0032 100 100 000 Old_age Always - 107
193 Load_Cycle_Count 0x0012 100 100 000 Old_age Always - 107
194 Temperature_Celsius 0x0002 200 200 000 Old_age Always - 30 (Min/Max 20/52)
196 Reallocated_Event_Count 0x0032 100 100 000 Old_age Always - 0
197 Current_Pending_Sector 0x0022 100 100 000 Old_age Always - 0
198 Offline_Uncorrectable 0x0008 100 100 000 Old_age Offline - 0
199 UDMA_CRC_Error_Count 0x000a 200 200 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

另外,不支持vps的,用vps的就别试了……

标签:linux

评论已关闭