新聞中心

EEPW首頁 > 嵌入式系統(tǒng) > 設(shè)計(jì)應(yīng)用 > Linux磁盤檢測(cè)工具smartctl的使用和分析

Linux磁盤檢測(cè)工具smartctl的使用和分析

作者: 時(shí)間:2016-10-08 來源:網(wǎng)絡(luò) 收藏

對(duì)/dev/sda進(jìn)行短時(shí)間測(cè)試。

smartctl -t short /dev/sda

3.2.5.1 觀察測(cè)試進(jìn)度

通過-c 參數(shù),可以觀察到測(cè)試的進(jìn)度:

# smartctl -c /dev/sda

Self-test execution status: ( 242) Self-test routine in progress...

20% of test remaining.

3.2.5.2 觀察測(cè)試結(jié)果

通過-l selftest 參數(shù),可以看到/dev/sda測(cè)試的結(jié)果記錄:

“#1”代表的那一次測(cè)試,Completed without error表示完成,沒有錯(cuò)誤。

“#2”代表的那一次測(cè)試,Aborted by host表示測(cè)試被用戶終止,還有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參數(shù),可以看到/dev/sda SMART屬性值。

smartctl -A /dev/sda

3.4 SMART 屬性

使用smartctl -A /dev/sda能看到很多磁盤的SMART 屬性,可以知道磁盤是否健康。

下面是一個(gè)列表,可以知道每個(gè)屬性的具體含義:

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 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. The raw value has different structure for different vendors and is often not meaningful as a decimal number.

080x08Seek Time PerformanceAverage performance of seek operations of the magnetic heads. If this attribute is decreasing, it is a sign of problems in the mechanical subsystem.

090x09Power-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.

100x0ASpin Retry CountCount 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.

110x0BRecalibration Retries orCalibration Retry CountThis attribute indicates the count that recalibration was requested (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.

120x0CPower Cycle CountThis attribute indicates the count of full hard disk power on/off cycles.

130x0DSoft Read Error RateUncorrected read errors reported to the operating system.



關(guān)鍵詞:

評(píng)論


相關(guān)推薦

技術(shù)專區(qū)

關(guān)閉