우분투 / 데비안 하드디스크 SMART 정보 및 온도 확인 (U5PVR 도 포함)

category 서버/리눅스 서버 2017.12.08 03:29

안녕하세요. 이번에는 우분투 및 데비안 계열에서 하드디스크 SMART 정보를 보는 방법에 대해서 기술하려고 합니다.


http://cafe.naver.com/mk802/24260


상기 글에 대한 답변입니다.


아래의 가이드는 U5PVR 셋톱박스에서 실행 되었으나 모든 우분투 및 데비안 계열에서 활용이 가능합니다.





smartmontools 를 설치하기


root@AOL-Debian:~# apt-get install smartmontools

Reading package lists... Done

Building dependency tree

Reading state information... Done

The following extra packages will be installed:

  bsd-mailx exim4-base exim4-config exim4-daemon-light liblockfile-bin

  liblockfile1 psmisc

Suggested packages:

  mail-reader eximon4 exim4-doc-html exim4-doc-info spf-tools-perl swaks

  gsmartcontrol smart-notifier

Recommended packages:

  mailx

The following NEW packages will be installed:

  bsd-mailx exim4-base exim4-config exim4-daemon-light liblockfile-bin

  liblockfile1 psmisc smartmontools

0 upgraded, 8 newly installed, 0 to remove and 4 not upgraded.

Need to get 2,805 kB of archives.

After this operation, 5,870 kB of additional disk space will be used.

Do you want to continue? [Y/n]





하드 정보 확인하기


저는 500기가 시게이트 하드를 사용중입니다.


장치 목록 확인하기


root@AOL-Debian:~# df -h

Filesystem                                                       Size  Used Avail Use% Mounted on

/dev/block/platform/soc/f9830000.himciv200.MMC/by-name/userdata   10G  2.3G  7.8G  23% /data

tmpfs                                                            943M  496K  942M   1% /dev

tmpfs                                                            943M     0  943M   0% /mnt

/dev/block/platform/soc/f9830000.himciv200.MMC/by-name/system    1.4G  1.3G   14M  99% /system

/data/media                                                       10G  2.3G  7.7G  23% /mnt/runtime/default/emulated

/data/media                                                       10G  2.3G  7.7G  23% /mnt/runtime/read/emulated

/data/media                                                       10G  2.3G  7.7G  23% /mnt/runtime/write/emulated

/dev/block/vold/public:8,1                                       466G   47G  420G  10% /mnt/media_rw/sda1

/mnt/media_rw/sda1                                               466G   47G  420G  10% /mnt/runtime/default/sda1

/mnt/media_rw/sda1                                               466G   47G  420G  10% /mnt/runtime/read/sda1

/mnt/media_rw/sda1                                               466G   47G  420G  10% /mnt/runtime/write/sda1

tmpfs                                                            947M  8.0K  947M   1% /dev/shm

tmpfs                                                            947M   52K  947M   1% /run

root@AOL-Debian:~#


상기 정보에서 sda 라는 것을 알았습니다.


아래의 명령으로 하드 정보를 확인합니다.


root@AOL-Debian:~# smartctl -i /dev/block/sda -d ata

smartctl 6.4 2014-10-07 r4002 [armv7l-linux-3.18.24_hi3798cv2x] (local build)

Copyright (C) 2002-14, Bruce Allen, Christian Franke, www.smartmontools.org


=== START OF INFORMATION SECTION ===

Model Family:     Seagate Momentus 7200.4

Device Model:     ST9500420AS

Serial Number:    5VJ87D01

LU WWN Device Id: 5 000c50 02aaebcc8

Firmware Version: 0002SDM1

User Capacity:    500,107,862,016 bytes [500 GB]

Sector Size:      512 bytes logical/physical

Rotation Rate:    7200 rpm

Device is:        In smartctl database [for details use: -P show]

ATA Version is:   ATA8-ACS T13/1699-D revision 4

SATA Version is:  SATA 2.6, 3.0 Gb/s

Local Time is:    Fri Dec  8 03:26:33 2017 KST

SMART support is: Available - device has SMART capability.

SMART support is: Enabled


root@AOL-Debian:~#


좀더 상세히 보기


root@AOL-Debian:~# smartctl -a /dev/block/sda -d ata

smartctl 6.4 2014-10-07 r4002 [armv7l-linux-3.18.24_hi3798cv2x] (local build)

Copyright (C) 2002-14, Bruce Allen, Christian Franke, www.smartmontools.org


=== START OF INFORMATION SECTION ===

Model Family:     Seagate Momentus 7200.4

Device Model:     ST9500420AS

Serial Number:    5VJ87D01

LU WWN Device Id: 5 000c50 02aaebcc8

Firmware Version: 0002SDM1

User Capacity:    500,107,862,016 bytes [500 GB]

Sector Size:      512 bytes logical/physical

Rotation Rate:    7200 rpm

Device is:        In smartctl database [for details use: -P show]

ATA Version is:   ATA8-ACS T13/1699-D revision 4

SATA Version is:  SATA 2.6, 3.0 Gb/s

Local Time is:    Fri Dec  8 03:27:16 2017 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

See vendor-specific Attribute list for marginal Attributes.


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:                (    0) seconds.

Offline data collection

capabilities:                    (0x73) SMART execute Offline immediate.

                                        Auto Offline data collection on/off support.

                                        Suspend Offline collection upon new

                                        command.

                                        No Offline surface scan supported.

                                        Self-test supported.

                                        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:        ( 110) minutes.

Conveyance self-test routine

recommended polling time:        (   3) minutes.

SCT capabilities:              (0x103f) SCT Status supported.

                                        SCT Error Recovery Control supported.

                                        SCT Feature Control supported.

                                        SCT Data Table supported.


SMART Attributes Data Structure revision number: 10

Vendor Specific SMART Attributes with Thresholds:

ID# ATTRIBUTE_NAME          FLAG     VALUE WORST THRESH TYPE      UPDATED  WHEN_FAILED RAW_VALUE

  1 Raw_Read_Error_Rate     0x000f   111   081   006    Pre-fail  Always       -       38029404

  3 Spin_Up_Time            0x0003   099   097   085    Pre-fail  Always       -       0

  4 Start_Stop_Count        0x0032   096   096   020    Old_age   Always       -       4185

  5 Reallocated_Sector_Ct   0x0033   100   100   036    Pre-fail  Always       -       1

  7 Seek_Error_Rate         0x000f   071   060   030    Pre-fail  Always       -       30168161674

  9 Power_On_Hours          0x0032   086   086   000    Old_age   Always       -       12511

 10 Spin_Retry_Count        0x0013   100   100   097    Pre-fail  Always       -       0

 12 Power_Cycle_Count       0x0032   099   099   020    Old_age   Always       -       1860

184 End-to-End_Error        0x0032   100   100   099    Old_age   Always       -       0

187 Reported_Uncorrect      0x0032   001   001   000    Old_age   Always       -       10526

188 Command_Timeout         0x0032   100   099   000    Old_age   Always       -       4295032848

189 High_Fly_Writes         0x003a   100   100   000    Old_age   Always       -       0

190 Airflow_Temperature_Cel 0x0022   065   042   045    Old_age   Always   In_the_past 35 (0 9 35 34 0)

191 G-Sense_Error_Rate      0x0032   100   100   000    Old_age   Always       -       114

192 Power-Off_Retract_Count 0x0032   100   100   000    Old_age   Always       -       213

193 Load_Cycle_Count        0x0032   046   046   000    Old_age   Always       -       108351

194 Temperature_Celsius     0x0022   035   058   000    Old_age   Always       -       35 (0 12 0 0 0)

195 Hardware_ECC_Recovered  0x001a   045   035   000    Old_age   Always       -       38029404

197 Current_Pending_Sector  0x0012   100   100   000    Old_age   Always       -       0

198 Offline_Uncorrectable   0x0010   100   100   000    Old_age   Offline      -       0

199 UDMA_CRC_Error_Count    0x003e   200   200   000    Old_age   Always       -       5

240 Head_Flying_Hours       0x0000   100   253   000    Old_age   Offline      -       10118 (20 239 0)

241 Total_LBAs_Written      0x0000   100   253   000    Old_age   Offline      -       60507662

242 Total_LBAs_Read         0x0000   100   253   000    Old_age   Offline      -       120032095

254 Free_Fall_Sensor        0x0032   100   100   000    Old_age   Always       -       0


SMART Error Log Version: 1

ATA Error Count: 6375 (device log contains only the most recent five errors)

        CR = Command Register [HEX]

        FR = Features Register [HEX]

        SC = Sector Count Register [HEX]

        SN = Sector Number Register [HEX]

        CL = Cylinder Low Register [HEX]

        CH = Cylinder High Register [HEX]

        DH = Device/Head Register [HEX]

        DC = Device Command Register [HEX]

        ER = Error register [HEX]

        ST = Status register [HEX]

Powered_Up_Time is measured from power on, and printed as

DDd+hh:mm:SS.sss where DD=days, hh=hours, mm=minutes,

SS=sec, and sss=millisec. It "wraps" after 49.710 days.


Error 6375 occurred at disk power-on lifetime: 2217 hours (92 days + 9 hours)

  When the command that caused the error occurred, the device was active or idle.


  After command completion occurred, registers were:

  ER ST SC SN CL CH DH

  -- -- -- -- -- -- --

  40 51 00 ff ff ff 0f  Error: UNC at LBA = 0x0fffffff = 268435455


  Commands leading to the command that caused the error were:

  CR FR SC SN CL CH DH DC   Powered_Up_Time  Command/Feature_Name

  -- -- -- -- -- -- -- --  ----------------  --------------------

  25 00 80 ff ff ff ef 00      03:23:51.098  READ DMA EXT

  35 00 80 ff ff ff ef 00      03:23:51.097  WRITE DMA EXT

  25 00 80 ff ff ff ef 00      03:23:51.096  READ DMA EXT

  35 00 80 ff ff ff ef 00      03:23:51.096  WRITE DMA EXT

  25 00 80 ff ff ff ef 00      03:23:51.095  READ DMA EXT


Error 6374 occurred at disk power-on lifetime: 2217 hours (92 days + 9 hours)

  When the command that caused the error occurred, the device was active or idle.


  After command completion occurred, registers were:

  ER ST SC SN CL CH DH

  -- -- -- -- -- -- --

  40 51 00 ff ff ff 0f  Error: UNC at LBA = 0x0fffffff = 268435455


  Commands leading to the command that caused the error were:

  CR FR SC SN CL CH DH DC   Powered_Up_Time  Command/Feature_Name

  -- -- -- -- -- -- -- --  ----------------  --------------------

  25 00 80 ff ff ff ef 00      03:23:07.404  READ DMA EXT

  35 00 80 ff ff ff ef 00      03:23:07.403  WRITE DMA EXT

  25 00 80 ff ff ff ef 00      03:23:07.403  READ DMA EXT

  35 00 80 ff ff ff ef 00      03:23:07.402  WRITE DMA EXT

  25 00 80 ff ff ff ef 00      03:23:07.401  READ DMA EXT


Error 6373 occurred at disk power-on lifetime: 2217 hours (92 days + 9 hours)

  When the command that caused the error occurred, the device was active or idle.


  After command completion occurred, registers were:

  ER ST SC SN CL CH DH

  -- -- -- -- -- -- --

  40 51 00 ff ff ff 0f  Error: UNC at LBA = 0x0fffffff = 268435455


  Commands leading to the command that caused the error were:

  CR FR SC SN CL CH DH DC   Powered_Up_Time  Command/Feature_Name

  -- -- -- -- -- -- -- --  ----------------  --------------------

  25 00 80 ff ff ff ef 00      03:22:20.477  READ DMA EXT

  35 00 80 ff ff ff ef 00      03:22:20.476  WRITE DMA EXT

  25 00 80 ff ff ff ef 00      03:22:20.476  READ DMA EXT

  35 00 80 ff ff ff ef 00      03:22:20.475  WRITE DMA EXT

  25 00 80 ff ff ff ef 00      03:22:20.474  READ DMA EXT


Error 6372 occurred at disk power-on lifetime: 2217 hours (92 days + 9 hours)

  When the command that caused the error occurred, the device was active or idle.


  After command completion occurred, registers were:

  ER ST SC SN CL CH DH

  -- -- -- -- -- -- --

  40 51 00 ff ff ff 0f  Error: UNC at LBA = 0x0fffffff = 268435455


  Commands leading to the command that caused the error were:

  CR FR SC SN CL CH DH DC   Powered_Up_Time  Command/Feature_Name

  -- -- -- -- -- -- -- --  ----------------  --------------------

  25 00 80 ff ff ff ef 00      03:21:38.362  READ DMA EXT

  35 00 80 ff ff ff ef 00      03:21:38.361  WRITE DMA EXT

  25 00 80 ff ff ff ef 00      03:21:38.360  READ DMA EXT

  35 00 80 ff ff ff ef 00      03:21:38.359  WRITE DMA EXT

  25 00 80 ff ff ff ef 00      03:21:38.358  READ DMA EXT


Error 6371 occurred at disk power-on lifetime: 2217 hours (92 days + 9 hours)

  When the command that caused the error occurred, the device was active or idle.


  After command completion occurred, registers were:

  ER ST SC SN CL CH DH

  -- -- -- -- -- -- --

  40 51 00 ff ff ff 0f  Error: UNC at LBA = 0x0fffffff = 268435455


  Commands leading to the command that caused the error were:

  CR FR SC SN CL CH DH DC   Powered_Up_Time  Command/Feature_Name

  -- -- -- -- -- -- -- --  ----------------  --------------------

  25 00 80 ff ff ff ef 00      03:20:56.944  READ DMA EXT

  35 00 80 ff ff ff ef 00      03:20:56.942  WRITE DMA EXT

  25 00 80 ff ff ff ef 00      03:20:56.941  READ DMA EXT

  35 00 80 ff ff ff ef 00      03:20:56.939  WRITE DMA EXT

  25 00 80 ff ff ff ef 00      03:20:56.937  READ DMA EXT


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%     11509         -

# 2  Short offline       Completed without error       00%      6376         -

# 3  Extended offline    Completed without error       00%      5544         -

# 4  Short offline       Completed without error       00%      4636         -


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.


root@AOL-Debian:~#





하드 테스트 하기


하드를 저장용도로 써도 되는지 보려면 테스트가 PASS 하는지 봐야합니다.


root@AOL-Debian:~# smartctl -H /dev/block/sda -d ata

smartctl 6.4 2014-10-07 r4002 [armv7l-linux-3.18.24_hi3798cv2x] (local build)

Copyright (C) 2002-14, Bruce Allen, Christian Franke, www.smartmontools.org


=== START OF READ SMART DATA SECTION ===

SMART overall-health self-assessment test result: PASSED

Please note the following marginal Attributes:

ID# ATTRIBUTE_NAME          FLAG     VALUE WORST THRESH TYPE      UPDATED  WHEN_FAILED RAW_VALUE

190 Airflow_Temperature_Cel 0x0022   065   042   045    Old_age   Always   In_the_past 35 (0 9 35 34 0)


root@AOL-Debian:~#


상기 결과처럼 PASSED 이면 문제가 없는 것입니다.


에러가 발생하기 시작하면 패스가 안되기 시작합니다. (하드를 교체해야 하는 상황)





하드 온도 확인하기


root@AOL-Debian:~# apt-get install hddtemp

Reading package lists... Done

Building dependency tree

Reading state information... Done

Suggested packages:

  ksensors

The following NEW packages will be installed:

  hddtemp

0 upgraded, 1 newly installed, 0 to remove and 4 not upgraded.

Need to get 60.1 kB of archives.

After this operation, 237 kB of additional disk space will be used.

Get:1 http://httpredir.debian.org/debian/ jessie/main hddtemp armhf 0.3-beta15-52 [60.1 kB]

Fetched 60.1 kB in 1s (32.0 kB/s)

Preconfiguring packages ...

Selecting previously unselected package hddtemp.

(Reading database ... 24964 files and directories currently installed.)

Preparing to unpack .../hddtemp_0.3-beta15-52_armhf.deb ...

Unpacking hddtemp (0.3-beta15-52) ...

Processing triggers for systemd (215-17+deb8u6) ...

Processing triggers for man-db (2.7.0.2-5) ...

Setting up hddtemp (0.3-beta15-52) ...

Processing triggers for systemd (215-17+deb8u6) ...

root@AOL-Debian:~# hddtemp /dev/block/sda

/dev/block/sda: ST9500420AS: 32°C

root@AOL-Debian:~#


여기서 마치겠습니다.




댓글을 달아 주세요