主机点评网,主机测评
VPS推荐,VPS优惠码
servergigabit “hostkvm” “gigsgigscloud” “tothost” “henghost” “casbay”

Linux检查独服硬盘通电时间

“hncloud”

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

一键更换Linux软件源:SuperUpdate.sh脚本教程

以下是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这行的就是通电时间。

版权声明:本文采用知识共享 署名4.0国际许可协议 [BY-NC-SA] 进行授权,转载请注明出处
文章名称:《Linux检查独服硬盘通电时间》
文章链接:https://zhujidianping.com/linux%e6%a3%80%e6%9f%a5%e7%8b%ac%e6%9c%8d%e7%a1%ac%e7%9b%98%e9%80%9a%e7%94%b5%e6%97%b6%e9%97%b4/
本站资源仅供个人学习交流,请于下载后24小时内删除,不允许用于商业用途,否则法律问题自行承担。
【声明】:国外主机点评仅分享信息,不参与任何交易,也非中介,所有内容仅代表个人观点,均不作直接、间接、法定、约定的保证,读者购买风险自担。一旦您访问国外主机点评,即表示您已经知晓并接受了此声明通告。
【关于安全】:任何 IDC商家都有倒闭和跑路的可能,备份永远是最佳选择,服务器也是机器,不勤备份是对自己极不负责的表现,请保持良好的备份习惯。
“lisahost”