xiaoxiao 发表于 2016-6-23 21:12:10

Linux下查看硬盘通电时间及查看硬盘型号

检测硬盘型号可用以下命令查看:
dmesg | grep ATA



检测硬盘通电时间需要安装smartmontools工具:
http://smartmontools.sourceforge.net/

如果是CentOS直接运行:
yum install smartmontools -y
如果是Debian/Ubuntu:
apt-get install smartmontools -y


然后输入:
注:如果不行就用df看看硬盘名,把sda换了即可
smartctl -A /dev/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      UPDATEDWHEN_FAILED RAW_VALUE
1 Raw_Read_Error_Rate   0x002f   200   200   051    Pre-failAlways       -       0
3 Spin_Up_Time            0x0027   201   200   021    Pre-failAlways       -       941
4 Start_Stop_Count      0x0032   100   100   000    Old_age   Always       -       84
5 Reallocated_Sector_Ct   0x0033   200   200   140    Pre-failAlways       -       0
7 Seek_Error_Rate         0x002e   200   200   000    Old_age   Always       -       0
9 Power_On_Hours          0x0032   040   040   000    Old_age   Always       -       44316
10 Spin_Retry_Count      0x0032   100   253   000    Old_age   Always       -       0
11 Calibration_Retry_Count 0x0032   100   253   000    Old_age   Always       -       0
12 Power_Cycle_Count       0x0032   100   100   000    Old_age   Always       -       83
192 Power-Off_Retract_Count 0x0032   200   200   000    Old_age   Always       -       76
193 Load_Cycle_Count      0x0032   200   200   000    Old_age   Always       -       84
194 Temperature_Celsius   0x0022   110   086   000    Old_age   Always       -       33
196 Reallocated_Event_Count 0x0032   200   200   000    Old_age   Always       -       0
197 Current_Pending_Sector0x0032   200   200   000    Old_age   Always       -       0
198 Offline_Uncorrectable   0x0030   200   200   000    Old_age   Offline      -       0
199 UDMA_CRC_Error_Count    0x0032   200   200   000    Old_age   Always       -       0
200 Multi_Zone_Error_Rate   0x0008   200   200   000    Old_age   Offline      -       0

其中Power_On_Hours就是硬盘使用小时了!

如果是Power_On_Minutes就是硬盘使用分钟,例如:
9 Power_On_Minutes      0×0032   201   201   000    Old_age   Always       -       649h+23m



页: [1]
查看完整版本: Linux下查看硬盘通电时间及查看硬盘型号