RadarURL

유닉스/리눅스
2014.12.26 18:21

Linux에서 Disk(HDD) Check 하기

조회 수 858 추천 수 0 댓글 0
?

단축키

Prev이전 문서

Next다음 문서

크게 작게 위로 아래로 댓글로 가기 인쇄
?

단축키

Prev이전 문서

Next다음 문서

크게 작게 위로 아래로 댓글로 가기 인쇄

엔지니어다 보니…. 시스템을 관리 하는 경우 종종 Disk 상태에 대해서 민감 하게 된다.

이때, HDD를 체크 하기 위해서 여러가지 방법이 있는데…

그중 하나가 tool을 사용하는 것이다….

 

[대표적 tool]

대표적으로 Disk를 체크 하는 Tool은… (모 내가 알고 있는 경우지만..)

# dd

   > 복사 하면서 체크 해야 하기 때문에 불편함… 원래 체크 용도로 사용되는 것도 아니니..

# smartmontool

   > 추천~~~ 이 툴은 온도 및 상태 체크 long term test, short term test 등을 지원 한다…

# hdparm

   > HDD 속도 체크 할때 유용하며, 상당히 직관적으로 보여줌

 

[설치 및 다운로드]

여기서 소개할 tool은 smartmontool 이다 명령어로 실행될 경우 smartctl로 실행 됨.

인스톨은 http://sourceforge.net/apps/trac/smartmontools/wiki/Download#RunsmartmontoolsfromLive-system 여기 보면 자세히 기술 되어 있음.

메뉴얼 및 릴리즈 현황은 이곳에서 http://sourceforge.net/apps/trac/smartmontools/

 

일부 리눅스 시스템의 상황에 따라서 틀리기 때문에 내가 한방법을 기술합니다.

OS : CentOS 기반에 설치 함.

 

1. 패키지 다운로드

- http://sourceforge.net/projects/smartmontools/files/smartmontools/ << 다운로드는 요기서

   > 현재는 6.1 이 최신 버전이다…(2013.04.30 현재)

 

2. 설치

- 패키지를 적당한 위치에 다운로드 한다.

- 압축되어 있으니 압축을 해제 및 이동

    # tar zxvf smartmontools-6.1.tar.gz

    # cd smartmontools-6.1

- build 및 install

    # ./configure

    # make

    # make install  (root 권한이 아니면 sudo 및 su 명령어 이용해서… 제가 사용한 시스템에서는 sudo 명령어 없이 root로 로그인)

 

이렇게 해서 설치가 다 되었다.. (엄청 간단함… ㅎㅎ)

 

[사용법]

Device 명은 /dev/sda 로 가정 (장치명은 각 HDD 장치 명에 따라서 변경 해줘야 함.)

 

1. ATA Disk Report

- 전체 적인 HDD의 전체적인 리포트를 쭉 출력해 줌.
    # smartctl -a /dev/sda


penta-np smartmontools-6.1 # smartctl -q noserial -a /dev/sda
smartctl 6.1 2013-03-16 r3800 [x86_64-linux-2.6.29.3] (local build)
Copyright (C) 2002-13, Bruce Allen, Christian Franke, www.smartmontools.org

=== START OF INFORMATION SECTION ===
Device Model:     Hitachi HDS721050CLA662

Serial Number:    JP1572JE3WJ0TK
Firmware Version: JP2OA50E
User Capacity:    500,107,862,016 bytes [500 GB]
Sector Size:      512 bytes logical/physical
Rotation Rate:    7200 rpm
Device is:        Not in smartctl database [for details use: -P showall]
ATA Version is:   ATA8-ACS T13/1699-D revision 4
SATA Version is:  SATA 2.6, 6.0 Gb/s (current: 3.0 Gb/s)
Local Time is:    Tue Apr 30 13:41:54 2013 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:  (0x85)    Offline data collection activity
                    was aborted by an interrupting command from host.
                    Auto Offline Data Collection: Enabled.
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:         ( 4769) 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:      (   1) minutes.
Extended self-test routine
recommended polling time:      (  80) minutes.
SCT capabilities:            (0x003d)    SCT Status supported.
                    SCT Error Recovery Control supported.
                    SCT Feature Control supported.
                    SCT Data Table supported.

SMART Attributes Data Structure revision number: 16
Vendor Specific SMART Attributes with Thresholds:
ID# ATTRIBUTE_NAME          FLAG     VALUE WORST THRESH TYPE      UPDATED  WHEN_FAILED RAW_VALUE
  1 Raw_Read_Error_Rate     0x000b   098   098   016    Pre-fail  Always       -       5

       > 디스크 표면으로부터 데이터를 읽는 과정에서 문제가 있을때 (주로 물리적인 충격으로 유발됨)
  2 Throughput_Performance  0x0005   135   135   054    Pre-fail  Offline      -       96
  3 Spin_Up_Time            0x0007   131   131   024    Pre-fail  Always       -       176 (Average 173)
  4 Start_Stop_Count        0x0012   100   100   000    Old_age   Always       -       149

       > 플래터가 회전하고 정지한 횟수
  5 Reallocated_Sector_Ct   0x0033   100   100   005    Pre-fail  Always       -       0

       > 섹터에 문제가 생겨서 스페어영역의 섹터로 대체한 횟수
  7 Seek_Error_Rate         0x000b   100   100   067    Pre-fail  Always       -       0

       > 탐색 오류율
  8 Seek_Time_Performance   0x0005   138   138   020    Pre-fail  Offline      -       31
  9 Power_On_Hours          0x0012   100   100   000    Old_age   Always       -       5175

       > 하드디스트에 전원 On 된 시간
10 Spin_Retry_Count        0x0013   100   100   060    Pre-fail  Always       -       0
12 Power_Cycle_Count       0x0032   100   100   000    Old_age   Always       -       149

       > 전원 on/off 횟수
192 Power-Off_Retract_Count 0x0032   100   100   000    Old_age   Always       -       151
193 Load_Cycle_Count        0x0012   100   100   000    Old_age   Always       -       151
194 Temperature_Celsius     0x0002   150   150   000    Old_age   Always       -       40 (Min/Max 25/62)

      > HDD 온도 (현재 40도 – 최소 25도, 최대 62도)
196 Reallocated_Event_Count 0x0032   100   100   000    Old_age   Always       -       0
197 Current_Pending_Sector  0x0022   100   100   000    Old_age   Always       -       0

       > 불안정적인 섹터로 스페어영역 섹터로 remap을 준비중이거나 읽는 과정에 문제가 생긴 섹터 (준 Bad Sector)
198 Offline_Uncorrectable   0x0008   100   100   000    Old_age   Offline      -       0

       > 읽기/쓰기에 문제가 생긴 섹터, 즉 디스크 표면이 손상됨.(Bad Sector)
199 UDMA_CRC_Error_Count    0x000a   200   200   000    Old_age   Always       -       0  

       > 하드디스크 인터페이스를 통해 데이터 전송과정에 발생한 CRC오류 횟수

SMART Error Log Version: 0
No Errors Logged

SMART Self-test log structure revision number 1
Num  Test_Description    Status                  Remaining  LifeTime(hours)  LBA_of_first_error
# 1  Short offline       Completed without error       00%      5173         -
# 2  Short offline       Completed without error       00%      5173         -
# 3  Short offline       Completed without error       00%      5173         -

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.


2. (추가) 명령어 사용 예제

    # smartctl -i /dev/sda 

       > HDD의 정보를 출력 함.

       > 최초 i 옵션으로 체크 해서 정상적으로 안나온다면 SMART 기능이 꺼져 있을 수도 있기 때문에 아래의 –s 옵션 과같이 Smart 기능을 on 해줘야 함.)

    # smartctl –s on /dev/sda

       > SMART 기능을 enable 시킴

    # smartctl –l selftest /dev/sda

       > HDD의 기본적인 테스트를 진행

 

[중요체크 사항]

기본적인 사항은 1번의 smartctl –a /dev/sda 명령어로 체크 하면 될듯 함.

중요한 사항은 아래의 값들은 0으로 표시 되어야 한다. (음 내부 테스트 장비가 데이터 읽는 과정에서 문제가 생겼군요 ㅎㅎㅎ 5번이나 말이죠)

ID# ATTRIBUTE_NAME FLAG VALUE WORST THRESH TYPE UPDATED WHEN_FAILED RAW_VALUE
1 Raw_Read_Error_Rate 0x000b 098 098 016 Pre-fail Always - 5

> 디스크 표면으로부터 데이터를 읽는 과정에서 문제가 있을 때 (주로 물리적인 충격으로 유발됨)
5 Reallocated_Sector_Ct 0x0033 100 100 005 Pre-fail Always - 0

> 섹터에 문제가 생겨서 스페어영역의 섹터로 대체한 횟수
7 Seek_Error_Rate 0x000b 100 100 067 Pre-fail Always - 0

> 탐색 오류율
10 Spin_Retry_Count 0x0013 100 100 060 Pre-fail Always – 0

> 섹터에 문제가 생겨서 스페어영역의 섹터로 대체한 횟수
197 Current_Pending_Sector 0x0022 100 100 000 Old_age Always - 0

> 불안정적인 섹터로 스페어영역 섹터로 remap을 준비중이거나 읽는 과정에 문제가 생긴 섹터 (준 Bad Sector)
198 Offline_Uncorrectable 0x0008 100 100 000 Old_age Offline - 0

> 읽기/쓰기에 문제가 생긴 섹터, 즉 디스크 표면이 손상됨.(Bad Sector)
199 UDMA_CRC_Error_Count 0x000a 200 200 000 Old_age Always - 0

> 하드디스크 인터페이스를 통해 데이터 전송과정에 발생한 CRC오류 횟수


출처 : http://secuof.tistory.com/entry/Linux에서-DiskHDD-Check-하기

TAG •
?

공부 게시판

공부에 도움되는 글을 올려주세요.

List of Articles
번호 분류 제목 글쓴이 날짜 조회 수
공지 [공지] 공부 게시판 입니다. 처누 2003.08.18 927775
2046 유닉스/리눅스 ipv6 off 시키기 JaeSoo 2014.12.26 427
2045 유닉스/리눅스 mrtg 2.16.2 yum 설치 문서 JaeSoo 2014.12.26 562
2044 유닉스/리눅스 Linux MRTG 설치 (yum install) JaeSoo 2014.12.26 800
2043 유닉스/리눅스 웹서버 CentOS 6.5 MRTG 설치 JaeSoo 2014.12.26 788
2042 연애 [연애 가이드] 애널섹스가 궁금하더냐? file JaeSoo 2014.12.26 688
2041 유닉스/리눅스 리눅스 - 디스크 검사 및 파일 시스템 복구 (badblocks, fsck) JaeSoo 2014.12.26 752
» 유닉스/리눅스 Linux에서 Disk(HDD) Check 하기 JaeSoo 2014.12.26 858
2039 유닉스/리눅스 UNIX, Linux fuser 사용법 (umount 옵션이 안될때 사용) JaeSoo 2014.12.26 891
2038 웹서버,WAS 리눅스 webalizer를 통한 apache log(웹서버 접속 통계) 분석하기 (추천) JaeSoo 2014.12.25 1098
2037 데이터베이스 Mysql 에서 Got a packet bigger than 'max_allowed_packet' bytes 오류 JaeSoo 2014.12.25 925
2036 데이터베이스 MySQL 내부 변수 max_allowed_packet JaeSoo 2014.12.25 585
2035 법/정책 소득세법 시행령 JaeSoo 2014.12.24 459
2034 법/정책 소득세법 JaeSoo 2014.12.24 340
2033 법/정책 선택적복지 포인트 과세 여부 질문입니다. file JaeSoo 2014.12.24 723
2032 법/정책 선택형 복지포인트 근로소득 제외 여부 - 국세법령정보시스템 JaeSoo 2014.12.24 797
2031 취미 인디라 SR-2 후기입니다 (뮤직인포) file jaesoo 2014.12.22 802
2030 웹서버,WAS 리눅스 아파치 로그 뷰어 webalizer, utf-8로 변환하기 file JaeSoo 2014.12.22 877
2029 유닉스/리눅스 Linux 커널이 32bit 인가 64bit인가 확인하는 법 JaeSoo 2014.12.22 877
2028 웹서버,WAS Webalizer Configuration – Configure Webalizer for SEO JaeSoo 2014.12.22 1412
2027 웹서버,WAS Webalizer, AWStats에서 국가 정보 확인하기 file JaeSoo 2014.12.22 854
Board Pagination Prev 1 ... 17 18 19 20 21 22 23 24 25 26 ... 124 Next
/ 124


즐겨찾기 (가족)

JAESOO's HOMEPAGE


YOUNGAE's HOMEPAGE


장여은 홈페이지


장여희 홈페이지


장여원 홈페이지


즐겨찾기 (업무)

알리카페 홀릭

숭실대 컴퓨터 통신연구실 (서창진)

말레이시아 KL Sentral 한국인 GuestHouse


즐겨찾기 (취미)

어드민아이디

유에코 사랑회

아스가르드 좋은사람/나쁜사람

JServer.kr

제이서버 메타블로그

재수 티스토리


즐겨찾기 (강의, 커뮤니티)

재수 강의 홈페이지


한소리


VTMODE.COM


숭실대 인공지능학과


숭실대 통신연구실


베너