在我们选择的服务器,有些时候需要检测服务商的服务器的通电时间,这样也可以检测这个服务器的质量。

以下是Linux检查独服硬盘通电时间的命令:
smartmontools工具安装:
#Ubuntu / Debian: apt-get -y install smartmontools
或者
#CentOS: yum -y install smartmontools
没有做raid的情况:
smartctl -A /dev/sda
做了raid的话可以用以下命令查看:
Disk A smartctl -a -d cciss,0 /dev/sda Disk B smartctl -a -d cciss,1 /dev/sda
一般我们会看到如下的输出:
root@zhujidianping:~# 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
找到Power_On_Hours这行的就是通电时间。

主机点评








