Linux磁盘检测工具smartctl的使用和分析
smartctl -l error /dev/sda
smartctl -l selftest /dev/sda
smartctl -l selective /dev/sda
3.2.3 开/关SMART功能
打开或关闭/dev/sda 的SMART功能。
smartctl -s on/off /dev/sda
查看当前SMART功能是否开启,可以使用 –i 参数。
smartctl -i /dev/sda
3.2.4 离线测试
对/dev/sda进行离线测试,它的结果主要用来更新SMART 属性。
smartctl -t offline /dev/sda
3.2.5 短时间测试
对/dev/sda进行短时间测试。
smartctl -t short /dev/sda
3.2.5.1 观察测试进度
通过-c 参数,可以观察到测试的进度:
# smartctl -c /dev/sda
…
Self-test execution status: ( 242) Self-test routine in progress...
20% of test remaining.
…
3.2.5.2 观察测试结果
通过-l selftest 参数,可以看到/dev/sda测试的结果记录:
“#1”代表的那一次测试,Completed without error表示完成,没有错误。
“#2”代表的那一次测试,Aborted by host表示测试被用户终止,还有90%没有完成。
# smartctl -l selftest /dev/sda
...
Num Test_Description Status Remaining LifeTime(hours) LBA_of_first_error
# 1 Short offline Completed without error 00% 9535 -
# 2 Extended offline Aborted by host 90% 9534 -
...
3.2.6 查看SMART属性值
通过-A参数,可以看到/dev/sda SMART属性值。
smartctl -A /dev/sda
3.4 SMART 属性
使用smartctl -A /dev/sda能看到很多磁盘的SMART 属性,可以知道磁盘是否健康。
下面是一个列表,可以知道每个属性的具体含义:
IDHexAttribut nameDescription
010x01Read Error Rate(Vendor specific raw value.) Stores data related to the rate of hardware read errors that occurred when reading data from a disk surface. The raw value has different structure for different vendors and is often not meaningful as a decimal number.
020x02Throughput PerformanceOverall (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.
030x03Spin-Up TimeAverage time of spindle spin up (from zero RPM to fully operational [millisecs]).
040x04Start/Stop CountA tally of spindle start/stop cycles. The spindle turns on, and hence the count is increased, both when the hard disk is turned on after having before been turned entirely off (disconnected from power source) and when the hard disk returns from having previously been put to sleep mode.
050x05Reallocated Sectors CountCount of reallocated sectors. When the hard drive finds a read/write/verification error, it marks that 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. The raw value normally represents a count of the bad sectors that have been found and remapped. Thus, the higher the attribute value, the more sectors the drive has had to reallocate. This allows a drive with bad sectors to continue operation; however, a drive which has had any reallocations at all is significantly more likely to fail in the near future.[2]While primarily used as a metric of the life expectancy of the drive, this number also affects performance. As the count of reallocated sectors increases, the read/write speed tends to become worse because the drive head is forced to seek to the reserved area whenever a remap is accessed. A workaround which will preserve drive speed at the expense of capacity is to create a disk partition over the region which contains remaps and instruct the operating system to not use that partition.
060x06Read Channel MarginMargin of a channel while reading data. The function of this attribute is not specified.
070x07Seek Error Rate(Vendor specific raw value.) Rate of seek errors of the magnetic heads. If there is a partial fa
- Windows CE 进程、线程和内存管理(11-09)
- RedHatLinux新手入门教程(5)(11-12)
- uClinux介绍(11-09)
- openwebmailV1.60安装教学(11-12)
- Linux嵌入式系统开发平台选型探讨(11-09)
- Windows CE 进程、线程和内存管理(二)(11-09)