09月22日, 2014 975次
Linux系统查看硬盘使用时间
说明:此方法只适用于独服(独立服务器)!!
首先安装smartmontoos
这里用的centos系统安装命令:
yum install smartmontools -y
这里用的debian系统安装命令:
apt-get install smartmontools
如果有阵列使用命令:
smartctl -a /dev/sg0
smartctl -a /dev/sg1
smartctl -a /dev/sg2
sg1是阵列卡
如果就普通硬盘没有阵列使用命令:
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 0x002f 100 100 000 Pre-fail Always - 0
5 Reallocate_NAND_Blk_Cnt 0x0032 100 100 010 Old_age Always - 0
9 Power_On_Hours 0x0032 100 100 000 Old_age Always - 2927 磁盘使用时间单位小时
12 Power_Cycle_Count 0x0032 100 100 000 Old_age Always - 7
171 Program_Fail_Count 0x0032 100 100 000 Old_age Always - 0
172 Erase_Fail_Count 0x0032 100 100 000 Old_age Always - 0
173 Ave_Block-Erase_Count 0x0032 083 083 000 Old_age Always - 263
174 Unexpect_Power_Loss_Ct 0x0032 100 100 000 Old_age Always - 4
180 Unused_Reserve_NAND_Blk 0x0033 000 000 000 Pre-fail Always - 25
183 SATA_Interfac_Downshift 0x0032 100 100 000 Old_age Always - 0
184 Error_Correction_Count 0x0032 100 100 000 Old_age Always - 0
187 Reported_Uncorrect 0x0032 100 100 000 Old_age Always - 0
194 Temperature_Celsius 0x0022 061 041 000 Old_age Always - 39 (Min/Max 0/59)
196 Reallocated_Event_Count 0x0032 100 100 000 Old_age Always - 0
197 Current_Pending_Sector 0x0032 100 100 000 Old_age Always - 0
198 Offline_Uncorrectable 0x0030 100 100 000 Old_age Offline - 0
199 UDMA_CRC_Error_Count 0x0032 100 100 000 Old_age Always - 0
202 Percent_Lifetime_Remain 0x0030 083 083 001 Old_age Offline - 17
206 Write_Error_Rate 0x000e 100 100 000 Old_age Always - 0
210 Success_RAIN_Recov_Cnt 0x0032 100 100 000 Old_age Always - 0
246 Total_Host_Sector_Write 0x0032 100 100 000 Old_age Always - 153433362682
247 Host_Program_Page_Count 0x0032 100 100 000 Old_age Always - 1298922835
248 FTL_Program_Page_Count 0x0032 100 100 000 Old_age Always - 866902879
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 0x002f 100 100 000 Pre-fail Always - 0
5 Reallocate_NAND_Blk_Cnt 0x0032 100 100 010 Old_age Always - 0
9 Power_On_Hours 0x0032 100 100 000 Old_age Always - 2927 磁盘使用时间单位小时
12 Power_Cycle_Count 0x0032 100 100 000 Old_age Always - 7
171 Program_Fail_Count 0x0032 100 100 000 Old_age Always - 0
172 Erase_Fail_Count 0x0032 100 100 000 Old_age Always - 0
173 Ave_Block-Erase_Count 0x0032 083 083 000 Old_age Always - 263
174 Unexpect_Power_Loss_Ct 0x0032 100 100 000 Old_age Always - 4
180 Unused_Reserve_NAND_Blk 0x0033 000 000 000 Pre-fail Always - 25
183 SATA_Interfac_Downshift 0x0032 100 100 000 Old_age Always - 0
184 Error_Correction_Count 0x0032 100 100 000 Old_age Always - 0
187 Reported_Uncorrect 0x0032 100 100 000 Old_age Always - 0
194 Temperature_Celsius 0x0022 061 041 000 Old_age Always - 39 (Min/Max 0/59)
196 Reallocated_Event_Count 0x0032 100 100 000 Old_age Always - 0
197 Current_Pending_Sector 0x0032 100 100 000 Old_age Always - 0
198 Offline_Uncorrectable 0x0030 100 100 000 Old_age Offline - 0
199 UDMA_CRC_Error_Count 0x0032 100 100 000 Old_age Always - 0
202 Percent_Lifetime_Remain 0x0030 083 083 001 Old_age Offline - 17
206 Write_Error_Rate 0x000e 100 100 000 Old_age Always - 0
210 Success_RAIN_Recov_Cnt 0x0032 100 100 000 Old_age Always - 0
246 Total_Host_Sector_Write 0x0032 100 100 000 Old_age Always - 153433362682
247 Host_Program_Page_Count 0x0032 100 100 000 Old_age Always - 1298922835
248 FTL_Program_Page_Count 0x0032 100 100 000 Old_age Always - 866902879
其中 Power_On_Hours 就是硬盘使用小时了,如果是 Power_On_Minutes 就是硬盘使用分钟,例如:
Power_On_Hours 0x0032 100 100 000 Old_age Always - 2927 磁盘使用时间单位小时
本文标题:Linux系统查看硬盘使用时间
本文链接:https://www.lengxi.net/post/508.html
版权声明:本文不使用任何协议授权,您可以任何形式自由转载或使用。
暂无留言,赶快评论吧