Oct 24 2008

S.M.A.R.T. 数值的含义

Category: 技术ssmax @ 14:59:48

一般VALUE是当前值,WORST是曾经最差值,THRESH是出厂设定值,如果VALUE接近THRESH(一般就是VALUE小于或者等于THRESH)的时候,而且TYPE是Pre-fail的,就表示硬盘差不多坏了。

 

ATA S.M.A.R.T. Attributes

Each drive manufacturer defines a set of attributes, and sets threshold values beyond which attributes should not pass under normal operation. Each attribute has a raw value, whose meaning is entirely up to the drive manufacturer (but often corresponds to counts or a physical unit, such degrees Celsius or seconds), and a normalized value, which ranges from 1 to 253 (with 1 representing the worst case and 253 representing the best). Depending on the manufacturer, a value of 100 or 200 will often be chosen as the “normal” value.

Manufacturers that have supported at least one S.M.A.R.T. attribute in various products include: Samsung, Seagate, IBM (Hitachi), Fujitsu, Maxtor, Toshiba, Western Digital and ExcelStor Technology.

[edit] Known ATA S.M.A.R.T. attributes

The following chart lists some S.M.A.R.T. attributes and the typical meaning of their raw values. Normalized values are always mapped so that higher values are better (with only very rare exceptions such as the “Temperature” attribute on certain Seagate drives[12]), but higher raw attribute values may be better or worse depending on the attribute and manufacturer. For example, the “Reallocated Sectors Count” attribute’s normalized value decreases as the number of reallocated sectors increases. In this case, the attribute’s raw value will often indicate the actual number of sectors that were reallocated, although vendors are in no way required to adhere to this convention. As manufacturers do not necessarily agree on precise attribute definitions and measurement units, the following list of attributes should be regarded as a general guide only.

Legend
Higher raw value is better Lower raw value is better
Critical Potential indicators of imminent electromechanical failure
ID Hex Attribute name Better Description
01 01 Read Error Rate Indicates the rate of hardware read errors that occurred when reading data from a disk surface. A non-zero value indicates a problem with either the disk surface or read/write heads. Note that Seagate drives often report a raw value that is very high even on new drives, and does not thereby indicate a failure.
02 02 Throughput Performance Overall (general) throughput performance of a hard disk drive. If the value of this attribute is decreasing there is a high probability that there is a problem with the disk.
03 03 Spin-Up Time Average time of spindle spin up (from zero RPM to fully operational [millisecs]).
04 04 Start/Stop Count   A tally of spindle start/stop cycles.
05 05 Reallocated Sectors Count Count of reallocated sectors. When the hard drive finds a read/write/verification error, it marks this sector as “reallocated” and transfers data to a special reserved area (spare area). This process is also known as remapping, and “reallocated” sectors are called remaps. This is why, on modern hard disks, “bad blocks” cannot be found while testing the surface – all bad blocks are hidden in reallocated sectors. However, as the number of reallocated sectors increases, the read/write speed tends to decrease. The raw value normally represents a count of the number of bad sectors that have been found and remapped. Thus, the higher the attribute value, the more sectors the drive has had to reallocate.
06 06 Read Channel Margin   Margin of a channel while reading data. The function of this attribute is not specified.
07 07 Seek Error Rate Rate of seek errors of the magnetic heads. If there is a partial failure in the mechanical positioning system, then seek errors will arise. Such a failure may be due to numerous factors, such as damage to a servo, or thermal widening of the hard disk. More seek errors indicates a worsening condition of a disk’s surface or the mechanical subsystem, or both. Note that Seagate drives often report a raw value that is very high, even on new drives, and this does not normally indicate a failure.
08 08 Seek Time Performance Average performance of seek operations of the magnetic heads. If this attribute is decreasing, it is a sign of problems in the mechanical subsystem.
09 09 Power-On Hours (POH) Count of hours in power-on state. The raw value of this attribute shows total count of hours (or minutes, or seconds, depending on manufacturer) in power-on state.
10 0A Spin Retry Count Count of retry of spin start attempts. This attribute stores a total count of the spin start attempts to reach the fully operational speed (under the condition that the first attempt was unsuccessful). An increase of this attribute value is a sign of problems in the hard disk mechanical subsystem.
11 0B Recalibration Retries This attribute indicates the number of times recalibration was requested (under the condition that the first attempt was unsuccessful). A decrease of this attribute value is a sign of problems in the hard disk mechanical subsystem.
12 0C Device Power Cycle Count   This attribute indicates the count of full hard disk power on/off cycles.
13 0D Soft Read Error Rate Uncorrected read errors reported to the operating system. If the value is non-zero, you should back up your data.
189 BD High Fly Writes (WDC) Fly Height Monitor Improves Hard Drive Reliability. Western Digital’s Fly Height Monitor protects write operations by detecting when a recording head is flying outside its normal operating range. If an unsafe fly height condition is encountered, the write process is stopped, and the information is rewritten or reallocated to a safe region of the hard drive. This constant monitoring process increases the reliability of write operations and reduces the probability of read errors.The new Fly Height Monitor is being implemented in Western Digital’s drives, beginning with the WD Enterprise WDE18300 and WDE9180 Ultra2 SCSI hard drives, and will be included on all future WD Enterprise products.(http://www.wdc.com/en/library/2579-850123.pdf)
190 BE Airflow Temperature (WDC) Airflow temperature on Western Digital HDs (Same as temp. [C2], but current value is 50 less for some models. Marked as obsolete.)
190 BE Temperature Difference from 100 Value is equal to (100 – temp. °C), allowing manufacturer to set a minimum threshold which corresponds to a maximum temperature.(Seagate only?)[citation needed]
Seagate ST910021AS: Verified Present[citation needed]
Seagate ST9120823ASG: Verified Present under name “Airflow Temperature Cel” 2008-10-06
Seagate ST3802110A: Verified Present 2007-02-13[citation needed]
Seagate ST980825AS: Verified Present 2007-04-05[citation needed]
Seagate ST3320620AS: Verified Present 2007-04-23[citation needed]
Seagate ST3500641AS: Verified Present 2007-06-12[citation needed]
Seagate ST3250824AS: Verified Present 2007-08-07[citation needed]
Seagate ST31000340AS: Verified Present 2008-02-05[citation needed]
Seagate ST3160211AS: Verified Present 2008-06-12[citation needed]
Seagate ST3320620AS: Verified Present 2008-06-12[citation needed]
Seagate ST3400620AS: Verified Present 2008-06-12[citation needed]
Samsung HD501LJ: Verified Present under name “Airflow Temperature” 2008-03-02[citation needed]
Samsung HD753LJ: Verified Present under name “Airflow Temperature” 2008-07-15[citation needed]
191 BF G-sense error rate Frequency of mistakes as a result of impact loads[citation needed]
192 C0 Power-off Retract Count Number of times the heads are loaded off the media. Heads can be unloaded without actually powering off.[citation needed] (or Emergency Retract Cycle count – Fujitsu)[citation needed]
193 C1 Load/Unload Cycle Count of load/unload cycles into head landing zone position.[citation needed]
194 C2 Temperature Current internal temperature.
195 C3 Hardware ECC Recovered Time between ECC-corrected errors.[citation needed]
196 C4 Reallocation Event Count Count of remap operations. The raw value of this attribute shows the total number of attempts to transfer data from reallocated sectors to a spare area. Both successful & unsuccessful attempts are counted.
197 C5 Current Pending Sector Count Number of “unstable” sectors (waiting to be remapped). If the unstable sector is subsequently written or read successfully, this value is decreased and the sector is not remapped. Read errors on the sector will not remap the sector, it will only be remapped on a failed write attempt. This can be problematic to test because cached writes will not remap the sector, only direct I/O writes to the disk.
198 C6 Uncorrectable Sector Count The total number of uncorrectable errors when reading/writing a sector. A rise in the value of this attribute indicates defects of the disk surface and/or problems in the mechanical subsystem.
199 C7 UltraDMA CRC Error Count The number of errors in data transfer via the interface cable as determined by ICRC (Interface Cyclic Redundancy Check).
200 C8 Write Error Rate /
Multi-Zone Error Rate
The total number of errors when writing a sector.
201 C9 Soft Read Error Rate Number of off-track errors. If non-zero, make a backup.
202 CA Data Address Mark errors Number of Data Address Mark errors (or vendor-specific).[citation needed]
203 CB Run Out Cancel Number of ECC errors
204 CC Soft ECC Correction Number of errors corrected by software ECC[citation needed]
205 CD Thermal Asperity Rate (TAR) Number of thermal asperity errors.[citation needed]
206 CE Flying Height  ? Height of heads above the disk surface.[citation needed]
207 CF Spin High Current  ? Amount of high current used to spin up the drive.[citation needed]
208 D0 Spin Buzz  ? Number of buzz routines to spin up the drive[citation needed]
209 D1 Offline Seek Performance  ? Drive’s seek performance during offline operations[citation needed]
211 D3 Vibration During Write  ? Vibration During Write[citation needed]
212 D4 Shock During Write  ? Shock During Write[citation needed]
220 DC Disk Shift Distance the disk has shifted relative to the spindle (usually due to shock). Unit of measure is unknown.
221 DD G-Sense Error Rate The number of errors resulting from externally-induced shock & vibration.
222 DE Loaded Hours  ? Time spent operating under data load (movement of magnetic head armature)[citation needed]
223 DF Load/Unload Retry Count  ? Number of times head changes position.[citation needed]
224 E0 Load Friction Resistance caused by friction in mechanical parts while operating.[citation needed]
225 E1 Load/Unload Cycle Count Total number of load cycles[citation needed]
226 E2 Load ‘In’-time  ? Total time of loading on the magnetic heads actuator (time not spent in parking area).[citation needed]
227 E3 Torque Amplification Count Number of attempts to compensate for platter speed variations[citation needed]
228 E4 Power-Off Retract Cycle The number of times the magnetic armature was retracted automatically as a result of cutting power.[citation needed]
230 E6 GMR Head Amplitude  ? Amplitude of “thrashing” (distance of repetitive forward/reverse head motion)[citation needed]
231 E7 Temperature Drive Temperature
240 F0 Head Flying Hours  ? Time while head is positioning[citation needed]
250 FA Read Error Retry Rate Number of errors while reading from a disk
254 FE Free Fall Protection Number of “Free Fall Events” detected [13]


Oct 24 2008

keepalived failover机制的一些探讨

Category: 技术ssmax @ 14:21:56

一般来说keepalived failover它自动实现了的,不用什么设置,在vip和本机真实ip不同的情况下,这个默认的实现方式是能够工作的,但是当vip就是本机真实ip的时候,默认的设置就不能工作了,看了一下文档,估计就是vrrp的包发不出去,一般使用keepalived 都有内外网两个网卡,其实我们只要设置一下vrrp发的网卡和使用ip,就可以解决这个问题。

这个是master的配置,vip就是eth0上面的真实ip。

vrrp_instance LVS_GZ80 {
state MASTER
interface eth0
mcast_src_ip 172.31.31.80
lvs_sync_daemon_inteface eth1
virtual_router_id 55
priority 100
advert_int 1
authentication {
auth_type PASS
auth_pass ooxx
}
virtual_ipaddress {
x.x.55.80
}
}

下面就是backup机的设置
vrrp_instance LVS_GZ229 {
state BACKUP
interface eth0
mcast_src_ip 172.31.31.229
lvs_sync_daemon_inteface eth1
virtual_router_id 55
priority 50
advert_int 1
authentication {
auth_type PASS
auth_pass ooxx
}
virtual_ipaddress {
x.x.55.80
}
}

这样子设置,当master的keepalived服务fail了以后,我们能看到backup马上抢到了vip(也是master的真实ip),并且backup机器进入master state,log如下:
Oct 24 13:18:03 localhost Keepalived_vrrp: VRRP_Instance(LVS_GZ229) Transition to MASTER STATE
Oct 24 13:18:04 localhost Keepalived_vrrp: VRRP_Instance(LVS_GZ229) Entering MASTER STATE
Oct 24 13:18:04 localhost Keepalived_vrrp: VRRP_Instance(LVS_GZ229) setting protocol VIPs.
Oct 24 13:18:04 localhost Keepalived_healthcheckers: Netlink reflector reports IP x.x.55.80 added
Oct 24 13:18:04 localhost Keepalived_vrrp: VRRP_Instance(LVS_GZ229) Sending gratuitous ARPs on eth0 for x.x.55.80

当master的keepalived重新起来的时候,vrrp包能发送到backup机上面,backup就把vip重新让出来了。
backup上面可以看到如下log
Oct 24 13:18:22 localhost Keepalived_vrrp: VRRP_Instance(LVS_GZ229) Received higher prio advert
Oct 24 13:18:22 localhost Keepalived_vrrp: VRRP_Instance(LVS_GZ229) Entering BACKUP STATE
Oct 24 13:18:22 localhost Keepalived_vrrp: VRRP_Instance(LVS_GZ229) removing protocol VIPs.

如果没有这样设置的话,当master重新抢到ip之后,backup机并不能从master state进入backup state,在master上的keepalived服务再次fail了以后(master并不是死机,只是服务死了,master仍然占用vip),backup认为自己一直在master状态,并不会发gratuitous ARP包,这样到vip的请求还是回到原来的master。
这种情况下,典型的就是切换恢复以后不能看到上面的log,backup机器仍然运行在master模式。


Oct 24 2008

lvs + keepalived在redhat AS3上面安装的问题

Category: 技术ssmax @ 12:33:25

昨晚两台机器,转发器,一台跑的是lvs+pulse,另外一台是lvs+keepalived,不能热备,切网的时候很麻烦,今天自己装个keepalived试试,tnnd

一般系统里面现在都有ip_vs 模块的了
直接modprobe ip_vs就启动了
关于modprobe的一些操作:
1、modprobe 命令是根据depmod -a的输出/lib/modules/version/modules.dep来加载全部的所需要模块。

2、删除模块的命令是:modprobe -r 模块名

3、系统启动后,正常工作的模块都在/proc/modules文件中列出。使用lsmod命今也可显示相同内容。

4、在内核中有一个“Automatic kernel module loading”功能被编译到了内核中。当用户尝试打开某类型的文件时,内核会根据需要尝试加载相应的模块。/etc/modules.conf或/etc/modprobe.conf文件是一个自动处理内核模块的控制文件。

版本keepalived-1.1.12.tar.gz
然后是标准的Linux源码安装过程:configure→make→make install 。 需要注意的是,在RedHat AS4的系统上安装过程没有问题,但是在AS3的系统上configure编译过程会出错,出错提示如下:

checking openssl/ssl.h usability… no
checking openssl/ssl.h presence… no
checking for openssl/ssl.h… no
configure: error:
!!! OpenSSL is not properly installed on your system. !!!
!!! Can not include OpenSSL headers files. !!!

其实系统安装了openssl,ssl.h文件也没问题,问题在于redhat AS3 把Kerberos includes 放在一个“奇怪”的地方,以致于keepalived的configure程序找不到,只好报openssl安装有问题。解决方法是设置编译环境的CPPFLAGS变量:export CPPFLAGS=-I/usr/kerberos/include ,再次编译就通过了。