Получение информации о накопителях c помощью smartctl

Кроме информации, доступной по SNMP, можно получить информацию о состоянии жестких дисков при помощи утилиты smartctl. Данная утилита использует технологию SMART (Self Monitoring Analysing and Reporting Technology) для получения информации о различного рода проблемах и повреждениях (проблемы блока магнитных головок, проблемы механики, температура и др.).

Для определения дисков в системе можно использовать утилиту с опцией «--scan»:

root@sterragate:~# smartctl --scan

/dev/sda -d scsi # /dev/sda, SCSI device

Для вывода информации по диску можно использовать утилиту с опцией «-a»:

root@sterragate:~# smartctl -a /dev/sda

smartctl 6.6 2016-05-31 r4324 [x86_64-linux-4.9.0-11-amd64] (local build)

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

 

=== START OF INFORMATION SECTION ===

Model Family:     Innodisk 3IE3/3ME3 SSDs

Device Model:     mSATA mini 3ME3

Serial Number:    B2A11807170060805

LU WWN Device Id: 5 24693f 22a221959

Firmware Version: S16425

User Capacity:    16,013,942,784 bytes [16.0 GB]

Sector Size:      512 bytes logical/physical

Rotation Rate:    Solid State Device

Form Factor:      2.5 inches

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

ATA Version is:   ATA8-ACS (minor revision not indicated)

SATA Version is:  SATA 3.0, 6.0 Gb/s (current: 3.0 Gb/s)

Local Time is:    Thu Nov  3 23:02:14 2016 MSK

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.

Total time to complete Offline

data collection:            (   32) seconds.

Offline data collection

capabilities:                (0x00)       Offline data collection not supported.

SMART capabilities:            (0x0003)     Saves SMART data before entering

                                  power-saving mode.

                                  Supports SMART auto save timer.

Error logging capability:        (0x00)     Error logging NOT supported.

                                  No General Purpose Logging support.

SCT capabilities:            (0x0039)      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     0x0000   000   000   000    Old_age   Offline      -       0

  2 Throughput_Performance  0x0000   000   000   000    Old_age   Offline      -       0

  3 Spin_Up_Time            0x0000   000   000   000    Old_age   Offline      -       0

  5 Later_Bad_Block         0x0013   100   100   001    Pre-fail  Always       -       0

  7 Seek_Error_Rate         0x0000   000   000   000    Old_age   Offline      -       0

  8 Seek_Time_Performance   0x0000   000   000   000    Old_age   Offline      -       0

  9 Power_On_Hours          0x0002   119   000   000    Old_age   Always       -       1143

 10 Spin_Retry_Count        0x0000   000   000   000    Old_age   Offline      -       0

 12 Power_Cycle_Count       0x0002   115   000   000    Old_age   Always       -       371

163 Total_Bad_Block_Count   0x0000   000   000   000    Old_age   Offline      -       11

168 SATA_PHY_Error_Count    0x0000   000   000   000    Old_age   Offline      -       0

169 Remaining_Lifetime_Perc 0x0000   099   000   000    Old_age   Offline      -       99

175 Bad_Cluster_Table_Count 0x0000   000   000   000    Old_age   Offline      -       0

192 Power-Off_Retract_Count 0x0000   000   000   000    Old_age   Offline      -       0

194 Temperature_Celsius     0x0000   030   100   000    Old_age   Offline      -       30 (2 100 0 0 0)

197 Current_Pending_Sector  0x0012   000   100   000    Old_age   Always       -       0

225 Data_Log_Write_Count    0x0000   000   032   000    Old_age   Offline      -       569317

240 Write_Head              0x0000   000   000   000    Old_age   Offline      -       0

165 Max_Erase_Count         0x0002   025   001   000    Old_age   Always       -       25

167 Average_Erase_Count     0x0002   010   001   000    Old_age   Always       -       10

170 Spare_Block_Count       0x0003   100   001   000    Pre-fail  Always       -       143

171 Program_Fail_Count      0x0002   000   001   000    Old_age   Always       -       0

172 Erase_Fail_Count        0x0002   000   001   000    Old_age   Always       -       0

176 RANGE_RECORD_Count      0x0000   100   001   000    Old_age   Offline      -       0

187 Reported_Uncorrect      0x0002   000   001   000    Old_age   Always       -       0

229 Flash_ID                0x0002   100   001   000    Old_age   Always       -       0x517693943a98

232 Spares_Remaining_Perc   0x0003   100   001   000    Pre-fail  Always       -       0

235 Later_Bad_Blk_Inf_R/W/E 0x0002   000   000   000    Old_age   Always       -       0 0 0

241 Host_Writes_32MiB       0x0002   100   001   000    Old_age   Always       -       2223

242 Host_Reads_32MiB        0x0002   100   001   000    Old_age   Always       -       24116

 

SMART Error Log not supported

 

SMART Self-test Log not supported

 

Selective Self-tests/Logging not supported

Если по какой-то причине технология SMART на диске отключена, ее можно включить при помощи опции «-s»:

root@sterragate:~# smartctl -s on /dev/sda

smartctl 6.6 2016-05-31 r4324 [x86_64-linux-4.9.0-11-amd64] (local build)

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

 

=== START OF ENABLE/DISABLE COMMANDS SECTION ===

SMART Enabled.