
디스크에서 smartctl -a를 실행하면 많은 출력이 표시됩니다.
디스크의 상태가 양호한지 불량인지를 나타내는 최종 상태는 무엇입니까?
smartctl -a /dev/sdb
smartctl 6.2 2013-07-26 r3841 [x86_64-linux-3.10.0-327.el7.x86_64] (local build)
Copyright (C) 2002-13, Bruce Allen, Christian Franke, www.smartmontools.org
=== START OF INFORMATION SECTION ===
Vendor: SEAGATE
Product: ST2000NX0433
Revision: NS02
User Capacity: 2,000,398,934,016 bytes [2.00 TB]
Logical block size: 512 bytes
Formatted with type 2 protection
Logical block provisioning type unreported, LBPME=0, LBPRZ=0
Rotation Rate: 7200 rpm
Form Factor: 2.5 inches
Logical Unit id: 0x5000c5009eaededf
Serial number: W46064KW
Device type: disk
Transport protocol: SAS
Local Time is: Thu Nov 22 10:38:35 2018 UTC
SMART support is: Available - device has SMART capability.
SMART support is: Enabled
Temperature Warning: Disabled or Not Supported
=== START OF READ SMART DATA SECTION ===
SMART Health Status: OK
Current Drive Temperature: 23 C
Drive Trip Temperature: 60 C
Manufactured in week 06 of year 2017
Specified cycle count over device lifetime: 10000
Accumulated start-stop cycles: 49
Specified load-unload count over device lifetime: 300000
Accumulated load-unload cycles: 550
Elements in grown defect list: 0
Vendor (Seagate) cache information
Blocks sent to initiator = 1986603075
Blocks received from initiator = 2165723528
Blocks read from cache and sent to initiator = 1298028358
Number of read and write commands whose size <= segment size = 201615101
Number of read and write commands whose size > segment size = 0
Vendor (Seagate/Hitachi) factory information
number of hours powered up = 12335.38
number of minutes until next internal SMART test = 26
Error counter log:
Errors Corrected by Total Correction Gigabytes Total
ECC rereads/ errors algorithm processed uncorrected
fast | delayed rewrites corrected invocations [10^9 bytes] errors
read: 26648753 0 0 26648753 0 83475.092 0
write: 0 0 2 2 2 135145.593 0
verify: 3914513941 0 0 3914513941 0 109628.879 0
Non-medium error count: 14
SMART Self-test log
Num Test Status segment LifeTime LBA_first_err [SK ASC ASQ]
Description number (hours)
# 1 Background short Completed 96 2 - [- - -]
Long (extended) Self Test duration: 20400 seconds [340.0 minutes]
다음 복용량은 좋은 징후입니까?
smartctl -a /dev/sda | grep Completed
또는
smartctl -a /dev/sda
echo $?
답변1
smartctl -a
전반적인 건강은 글로벌 문제를 해결하는 결과의 일부입니다.
운전자는 좋은가요, 나쁜가요?
최고. 인용한 출력에서 상태는 다음 줄에 보고됩니다.
SMART Health Status: OK
옵션 대신 를 사용하여 -H
개별적으로(일부 헤더 포함) 얻을 수도 있습니다.smartctl
-a
이 평가는 smartmontools가 아닌 드라이브 자체에서 수행됩니다(맨 페이지 참조).지능형 제어(8)on -H
option) 그 의미는 다소 조잡합니다.위키피디아:
SMART 상태가 반드시 드라이브의 과거 또는 현재 신뢰성을 나타내는 것은 아닙니다. 드라이브에 치명적인 오류가 발생한 경우 SMART 상태에 액세스하지 못할 수 있습니다. 또는 과거에 드라이브에 문제가 발생했지만 센서가 더 이상 이러한 문제를 감지하지 못하는 경우 제조업체의 프로그래밍에 따라 SMART 상태는 드라이브가 이제 손상되지 않았음을 나타낼 수 있습니다.
그리고 (같은 출처):
SMART 속성을 확인하면 드라이브 상태에 대한 자세한 정보를 얻을 수 있습니다.
smartctl
전체 상태는 오류가 발생한 디스크에 설정된 종료 상태의 비트 3(0부터 계산)으로 반영됩니다 . 매뉴얼 페이지의 "반환 값" 섹션을 참조하십시오.지능형 제어(8).
실행 직후 smartctl
비트는 $(($? & 8))
아래와 같이 (Bash) 표현식을 통해 평가될 수 있습니다.
if [ $(($? & 8)) -eq 0 ]; then
echo Good.
else
echo Bad.
fi
비트 3이 설정되면 표현식은 $(($? & 8))
1이 아닌 8로 평가됩니다.
정상적인 디스크의 경우 종료 상태 0 smartctl
이면 충분하지만(SMART가 알 수 있는 한) 조건으로는 너무 강력할 수 있습니다. 상태의 비트 6은 장치 로그에 오류 기록이 있음을 반영합니다. 드라이브와 호스트 간의 통신 오류(DMA 오류 읽기)를 참조할 수도 있습니다. 저는 사용 후 처음 몇 시간 동안 로그에 이와 같은 오류를 표시하는 드라이브가 여러 개 있지만 이 드라이브를 수년 동안 매일 아무런 문제 없이 사용해 왔습니다. 따라서 이 기준은 많은 오탐지를 제공할 것입니다. 물론 이는 결국 실수가 있기 때문에 논란의 여지가 있다.
어쨌든, 이 비트(비트 6)를 제외한 모든 비트를 고려하려면 테스트에서 다음 표현식을 사용할 수 있습니다 $(($? & 191))
.
반면, 표준
smartctl -a /dev/sda | grep Completed
귀하가 언급한 내용은 결과를 고려하지 않고 자체 테스트가 완료되었다고만 보고하므로 드라이브 상태에 대해서는 아무 것도 알려주지 않습니다.