今天买了台9刀的便宜(垃圾)独服,通上电,想看看硬盘用了多久。就顺手记录一下 Linux 下查看硬盘通电时间的操作吧,其实也比较简单。
查看硬盘通电时间
Ubuntu / Debian:
apt install smartmontools smartctl -A /dev/sda
CentOS:
yum install smartmontools smartctl -A /dev/sda
其中 /dev/sda
是硬盘编号,第一块一般是 /dev/sda
,如果有多块硬盘,第二块就是 /dev/sdb
,以此类推。
报告说明
一般我们会看到如下的输出:
root@185a140b120c93:~# smartctl -A /dev/sda smartctl 6.5 2016-01-24 r4214 [x86_64-linux-4.13.11-041311-generic] (local build) Copyright (C) 2002-16, Bruce Allen, Christian Franke, www.smartmontools.org === START OF READ SMART DATA SECTION === SMART Attributes Data Structure revision number: 10 Vendor Specific SMART Attributes with Thresholds: ID# ATTRIBUTE_NAME FLAG VALUE WORST THRESH TYPE UPDATED WHEN_FAILED RAW_VALUE 1 Raw_Read_Error_Rate 0x0033 120 120 050 Pre-fail Always - 0/0 5 Retired_Block_Count 0x0033 100 100 003 Pre-fail Always - 0 9 Power_On_Hours_and_Msec 0x0032 076 076 000 Old_age Always - 21343h+10m+10.810s 12 Power_Cycle_Count 0x0032 081 081 000 Old_age Always - 19663 171 Program_Fail_Count 0x000a 000 000 000 Old_age Always - 0 172 Erase_Fail_Count 0x0032 000 000 000 Old_age Always - 0 174 Unexpect_Power_Loss_Ct 0x0030 000 000 000 Old_age Offline - 19660 177 Wear_Range_Delta 0x0000 000 000 000 Old_age Offline - 4 181 Program_Fail_Count 0x000a 000 000 000 Old_age Always - 0 182 Erase_Fail_Count 0x0032 000 000 000 Old_age Always - 0 187 Reported_Uncorrect 0x0012 100 100 000 Old_age Always - 0 189 Airflow_Temperature_Cel 0x0000 029 060 000 Old_age Offline - 29 (Min/Max -22/60) 194 Temperature_Celsius 0x0022 029 060 000 Old_age Always - 29 (Min/Max -22/60) 195 ECC_Uncorr_Error_Count 0x001c 120 120 000 Old_age Offline - 0/0 196 Reallocated_Event_Count 0x0033 100 100 003 Pre-fail Always - 0 201 Unc_Soft_Read_Err_Rate 0x001c 120 120 000 Old_age Offline - 0/0 204 Soft_ECC_Correct_Rate 0x001c 120 120 000 Old_age Offline - 0/0 230 Life_Curve_Status 0x0013 100 100 000 Pre-fail Always - 100 231 SSD_Life_Left 0x0013 026 026 010 Pre-fail Always - 0 233 SandForce_Internal 0x0032 000 000 000 Old_age Always - 128184 234 SandForce_Internal 0x0032 000 000 000 Old_age Always - 189875 241 Lifetime_Writes_GiB 0x0032 000 000 000 Old_age Always - 189875 242 Lifetime_Reads_GiB 0x0032 000 000 000 Old_age Always - 64285
其中的“9”,“Power_On_Hours_and_Msec”,就是硬盘通电时间,可以看到我这块硬盘已经通电 21343h+10m+10.810s,算下来有两年半了,真是垃圾。