组Raid1后查看每块硬盘的使用时间

Online.net昨晚再次放出特价机,16欧便可以拿到一台16G内存2*2T的服务器,相当划算。当我看到消息时已是早上八点与16欧失之交臂。但并没有遗憾,毕竟之前20欧的特价机对我来说性价比也很高,更何况我也没有经济能力去剁手太多的服务器。去Hostloc看了看16欧的相关讨论,意外的收获了关于查看硬盘使用时间的干货。

我的20欧服务器拿到手后便在后台组了RAID1,安装完系统后发现用传统的方法无法获得硬盘的使用时间,如下显示:

root@localhost:~# smartctl -A /dev/sda
smartctl 6.4 2014-10-07 r4002 [x86_64-linux-3.16.0-4-amd64] (local build)
Copyright (C) 2002-14, Bruce Allen, Christian Franke, www.smartmontools.org

=== START OF READ SMART DATA SECTION ===

当时也在网上查了很多资料,得出的结论是硬Raid卡组的Raid1需要厂方提供的专门工具才行,自己也不想仅仅为了查看使用时间而重装系统,或者将Raid1暂时改为Raid0。问题被搁置到一边,这不影响服务器的使用,疙瘩却一直存在心里。

其实这个干货很简单,同样还是使用了smartmontools,就两行命令,增加了几个参数:

# Disk A
root@localhost:~# smartctl -a -d cciss,0 /dev/sda
# Disk B
root@localhost:~# smartctl -a -d cciss,1 /dev/sda

打印出来的结果如下,同时也是我的20欧服务器的硬盘使用情况:

smartctl 6.4 2014-10-07 r4002 [x86_64-linux-3.16.0-4-amd64] (local build)
Copyright (C) 2002-14, Bruce Allen, Christian Franke, www.smartmontools.org

/dev/sda [cciss_disk_00] [SAT]: Device open changed type from 'sat,auto+cciss' to 'sat'
=== START OF INFORMATION SECTION ===
Device Model:     MB2000EBUCF
Serial Number:    YFJNJ9JA
LU WWN Device Id: 5 000cca 223e583a5
Firmware Version: MK7OHPG3
User Capacity:    2,000,398,934,016 bytes [2.00 TB]
Sector Size:      512 bytes logical/physical
Rotation Rate:    7200 rpm
Form Factor:      3.5 inches
Device is:        Not in smartctl database [for details use: -P showall]
ATA Version is:   ATA8-ACS T13/1699-D revision 6
SATA Version is:  SATA 2.6, 3.0 Gb/s (current: 3.0 Gb/s)
Local Time is:    Fri Feb 26 13:15:13 2016 CST
SMART support is: Available - device has SMART capability.
SMART support is: Enabled

  9 Power_On_Hours          0x0032   099   099   000    Old_age   Always       -       13574
smartctl 6.4 2014-10-07 r4002 [x86_64-linux-3.16.0-4-amd64] (local build)
Copyright (C) 2002-14, Bruce Allen, Christian Franke, www.smartmontools.org

/dev/sda [cciss_disk_01] [SAT]: Device open changed type from 'sat,auto+cciss' to 'sat'
=== START OF INFORMATION SECTION ===
Device Model:     MB2000EBUCF
Serial Number:    YFJNJ8WA
LU WWN Device Id: 5 000cca 223e58391
Firmware Version: MK7OHPG3
User Capacity:    2,000,398,934,016 bytes [2.00 TB]
Sector Size:      512 bytes logical/physical
Rotation Rate:    7200 rpm
Form Factor:      3.5 inches
Device is:        Not in smartctl database [for details use: -P showall]
ATA Version is:   ATA8-ACS T13/1699-D revision 6
SATA Version is:  SATA 2.6, 3.0 Gb/s (current: 3.0 Gb/s)
Local Time is:    Fri Feb 26 13:16:14 2016 CST
SMART support is: Available - device has SMART capability.
SMART support is: Enabled

  9 Power_On_Hours          0x0032   099   099   000    Old_age   Always       -       13574

由此可以看出,我的硬盘使用时间为13574小时,不到两年的时间,是在可以接收的范围之内。 扩展阅读:


本页最后更新时间:2016-02-26 Fri 13:50.
小过的布拉格 - Copyright©2013-2017 - @xiaoguo - Powered by Emacs 26.1 (Org mode 9.1.1)
行路难,行路难, 多歧路,今安在。长风破浪会有时,直挂云帆济沧海。