메뉴 닫기

Smartd 데몬을 이용한 DISK 상태 모니터링

smartd 데몬은 서버에 장착된 디스크의 상태를 모니터링 하는 도구입니다.

일반적으로 리눅스 시스템 설치시 기본적으로 설치가 되며, 설치가 되지 않은 경우 yum으로 설치가 가능합니다.
사용방법은 smartctl 이란 명령어를 이용하여, 상태를 체크하고자 하는 하드디스크의 장치명을 선택하시면 됩니다.

예를 들어, OS가 설치된 /dev/sda 장치의 전반적인 상태를 확인하고자 할 경우 다음과 같이 입력하시면 됩니다.
# smartctl -a /dev/sda

그럼 다음과 같이 해당 하드디스크의 정보를 체크할 수 있습니다.

[root@localhost] smartctl -a /dev/sda

smartctl 5.42 2011-10-20 r3458 [x86_64-linux-2.6.18-371.8.1.el5] (local build)
Copyright (C) 2002-11 by Bruce Allen, http://smartmontools.sourceforge.net

=== START OF INFORMATION SECTION ===
Model Family: Samsung based SSDs
Device Model: SAMSUNG 470 Series SSD
Serial Number: S0STNEAB202438
Firmware Version: AXM08B1Q
User Capacity: 64,023,257,088 bytes [64.0 GB]
Sector Size: 512 bytes logical/physical
Device is: In smartctl database [for details use: -P show]
ATA Version is: 7
ATA Standard is: ATA/ATAPI-7 T13 1532D revision 1
Local Time is: Mon Dec 29 13:42:46 2014 KST
SMART support is: Available – device has SMART capability.
SMART support is: Enabled

=== START OF READ SMART DATA SECTION ===
SMART overall-health self-assessment test result: PASSED

General SMART Values:
Offline data collection status: (0x00) Offline data collection activity
was never started.
Auto Offline Data Collection: Disabled.
Self-test execution status: ( 0) The previous self-test routine completed
without error or no self-test has ever
been run.
Total time to complete Offline
data collection: ( 420) seconds.
Offline data collection
capabilities: (0x5b) SMART execute Offline immediate.
Auto Offline data collection on/off support.
Suspend Offline collection upon new
command.
Offline surface scan supported.
Self-test supported.
No Conveyance Self-test supported.
Selective Self-test supported.
SMART capabilities: (0x0003) Saves SMART data before entering
power-saving mode.
Supports SMART auto save timer.
Error logging capability: (0x01) Error logging supported.
General Purpose Logging supported.
Short self-test routine
recommended polling time: ( 2) minutes.
Extended self-test routine
recommended polling time: ( 7) minutes.

SMART Attributes Data Structure revision number: 1
Vendor Specific SMART Attributes with Thresholds:
ID# ATTRIBUTE_NAME FLAG VALUE WORST THRESH TYPE UPDATED WHEN_FAILED RAW_VALUE
9 Power_On_Hours 0x0032 093 093 — Old_age Always – 30903
12 Power_Cycle_Count 0x0032 099 099 — Old_age Always – 11
177 Wear_Leveling_Count 0x0013 095 095 — Pre-fail Always – 215
178 Used_Rsvd_Blk_Cnt_Chip 0x0013 062 062 — Pre-fail Always – 382
190 Airflow_Temperature_Cel 0x0022 073 056 — Old_age Always – 27
235 Unknown_Attribute 0x0012 099 099 — Old_age Always – 11

SMART Error Log Version: 1
No Errors Logged

SMART Self-test log structure revision number 1
No self-tests have been logged. [To run self-tests, use: smartctl -t]

SMART Selective self-test log data structure revision number 1
SPAN MIN_LBA MAX_LBA CURRENT_TEST_STATUS
1 0 0 Not_testing
2 0 0 Not_testing
3 0 0 Not_testing
4 0 0 Not_testing
5 0 0 Not_testing
Selective self-test flags (0x0):
After scanning selected spans, do NOT read-scan remainder of disk.
If Selective self-test is pending on power-up, resume after 0 minute delay.

위와 같은 예시에서는 아무런 메세지가 나타나지 않았습니다. 이것은 곧 하드디스크 상테가 양호하다는 의미겠지요..
만일 위 명령을 수행했을때 어떤 메세지가 나온다면, 한번쯤 해당 디스크 상태를 체크하고, 교체여부를 검토해야 할것입니다.
당연히 해당 디스크의 데이터 백업은 반드시 해두어야 할테구요..

그럼 위의 결과값들을 이해할 수 있도록 각 항목들에 대한 간략한 내용입니다.

Raw_Read_Error_Rate
디스크 표면으로 부터 데이터를 읽는 과정에 문제가 있는 경우
정상적인 경우 0
 
Sping_up_Time
플레터 회전에 제로 rpm 에서 최대 rpm에 도달하는 평균 시간
 
Start_Stop_Count
플레터가 회전하고 정지한 횟수

Reallocated_Sector_Ct
섹터에 문제가 생겨서 스페어 영역의 스페어 영역으로 섹터 이동
정상적인 경우 0

Seek_Error_Rate
탐색오류율, 정상적인 경우 0

Power_On_Hours
하드디스크에 전원이 인가된 시간

Spin_Retry_Count
최대 rpm에 도달하기 위해서 회전을 시도하는 횟수
정상적인 경우 0

Power_Cycle_Count
전원 on/off 횟수

Power-Off_retract_Count
헤드가 플레터에서 벗어나는 횟수

Load_Cycle_Count
헤드가 플레터위로 진입한 횟수

Temperature_Celsius
하드디스크 온도

Reallocated_Event_Count
스페어 영역으로 대체된 섹터로 부터 데이터를 읽어간 횟수

Current_Pending_Sector
불안전한 섹터로 스페어 영역 섹터로 remap을 준비중이거나 읽는 과정에 문제가 생긴 섹터, 준 배드섹터
정상적인 경우 0

Offline_Uncorrectable
읽기/쓰기 에 문제가 생긴 섹터, 즉 디스크 표면이 손상됨. 배드섹터
정상적인 경우 0
 
UDMA_CRC_Error_Count
하드디스크 인터페이스를 통해 데이터 전송과정에 발생한 CRC 오류 횟수
정상적인 경우 0

Multi_Zone_Error_Rate
섹터에 쓰기과정에 발생한 에러가 검출된 횟수

 

[polldaddy rating=”7739789″]

답글 남기기

이메일 주소는 공개되지 않습니다. 필수 항목은 *(으)로 표시합니다