没有RAID的磁盘状态可以通过工具获取Smart信息

root@OpenWrt:~# smartctl -a /dev/sda
smartctl 6.3 2014-07-26 r3976 [mips-linux-3.18.23] (localbuild)
Copyright (C) 2002-14, Bruce Allen, Christian Franke, www.smartmontools.org

=== START OF INFORMATION SECTION ===
Model Family:     SAMSUNG SpinPoint M7
Device Model:     SAMSUNG HM500JI
Serial Number:    S1WFJ90S905680
LU WWN Device Id: 5 0024e9 200f8bcb1
Firmware Version: 2AC101C4
User Capacity:    500,107,862,016 bytes [500 GB]
Sector Size:      512 bytes logical/physical
Form Factor:      2.5 inches
Device is:        In smartctl database [for details use: -P show]
ATA Version is:   ATA8-ACS T13/1699-D revision 6
SATA Version is:  SATA 2.6, 3.0 Gb/s
Local Time is:    Wed Jun 29 02:43:29 2016 GMT
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:        ( 8460) 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:    ( 141) minutes.
SCT capabilities:          (0x003f) 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     0x002f   100   100   051    Pre-fail  Always       -       7
  2 Throughput_Performance  0x0026   252   252   000    Old_age   Always       -       0
  3 Spin_Up_Time            0x0023   090   089   025    Pre-fail  Always       -       3220
  4 Start_Stop_Count        0x0032   099   099   000    Old_age   Always       -       1416
  5 Reallocated_Sector_Ct   0x0033   252   252   010    Pre-fail  Always       -       0
  7 Seek_Error_Rate         0x002e   252   252   051    Old_age   Always       -       0
  8 Seek_Time_Performance   0x0024   252   252   015    Old_age   Offline      -       0
  9 Power_On_Hours          0x0032   100   100   000    Old_age   Always       -       5161
 10 Spin_Retry_Count        0x0032   252   252   051    Old_age   Always       -       0
 11 Calibration_Retry_Count 0x0032   099   099   000    Old_age   Always       -       1461
 12 Power_Cycle_Count       0x0032   100   100   000    Old_age   Always       -       948
191 G-Sense_Error_Rate      0x0022   100   100   000    Old_age   Always       -       370
192 Power-Off_Retract_Count 0x0022   252   252   000    Old_age   Always       -       0
194 Temperature_Celsius     0x0002   063   059   000    Old_age   Always       -       37 (Min/Max 11/68)
195 Hardware_ECC_Recovered  0x003a   100   100   000    Old_age   Always       -       0
196 Reallocated_Event_Count 0x0032   252   252   000    Old_age   Always       -       0
197 Current_Pending_Sector  0x0032   252   252   000    Old_age   Always       -       0
198 Offline_Uncorrectable   0x0030   252   252   000    Old_age   Offline      -       0
199 UDMA_CRC_Error_Count    0x0036   100   100   000    Old_age   Always       -       3
200 Multi_Zone_Error_Rate   0x002a   100   100   000    Old_age   Always       -       5546
223 Load_Retry_Count        0x0032   099   099   000    Old_age   Always       -       1461
225 Load_Cycle_Count        0x0032   001   001   000    Old_age   Always       -       7858774

SMART Error Log Version: 1
ATA Error Count: 912 (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 912 occurred at disk power-on lifetime: 0 hours (0 days + 0 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
  -- -- -- -- -- -- --
  10 51 40 e7 ff ff ef  Error: IDNF at LBA = 0x0fffffe7 = 268435431

  Commands leading to the command that caused the error were:
  CR FR SC SN CL CH DH DC   Powered_Up_Time  Command/Feature_Name
  -- -- -- -- -- -- -- --  ----------------  --------------------
  c5 05 40 e7 ff ff ef 00      00:00:00.068  WRITE MULTIPLE
  c6 05 10 00 00 00 e0 00      00:00:00.068  SET MULTIPLE MODE
  c5 05 40 e7 ff ff ef 00      00:00:00.068  WRITE MULTIPLE
  c6 05 10 00 00 00 e0 00      00:00:00.068  SET MULTIPLE MODE
  c5 05 40 e7 ff ff ef 00      00:00:00.068  WRITE MULTIPLE

Error 911 occurred at disk power-on lifetime: 0 hours (0 days + 0 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
  -- -- -- -- -- -- --
  10 51 40 e7 ff ff ef  Error: IDNF at LBA = 0x0fffffe7 = 268435431

  Commands leading to the command that caused the error were:
  CR FR SC SN CL CH DH DC   Powered_Up_Time  Command/Feature_Name
  -- -- -- -- -- -- -- --  ----------------  --------------------
  c5 05 40 e7 ff ff ef 00      00:00:00.068  WRITE MULTIPLE
  c6 05 10 00 00 00 e0 00      00:00:00.068  SET MULTIPLE MODE
  c5 05 40 e7 ff ff ef 00      00:00:00.068  WRITE MULTIPLE
  c6 05 10 00 00 00 e0 00      00:00:00.068  SET MULTIPLE MODE
  c5 05 40 e7 ff ff ef 00      00:00:00.067  WRITE MULTIPLE

Error 910 occurred at disk power-on lifetime: 0 hours (0 days + 0 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
  -- -- -- -- -- -- --
  10 51 40 e7 ff ff ef  Error: IDNF at LBA = 0x0fffffe7 = 268435431

  Commands leading to the command that caused the error were:
  CR FR SC SN CL CH DH DC   Powered_Up_Time  Command/Feature_Name
  -- -- -- -- -- -- -- --  ----------------  --------------------
  c5 05 40 e7 ff ff ef 00      00:00:00.068  WRITE MULTIPLE
  c6 05 10 00 00 00 e0 00      00:00:00.068  SET MULTIPLE MODE
  c5 05 40 e7 ff ff ef 00      00:00:00.067  WRITE MULTIPLE
  c6 05 10 00 00 00 e0 00      00:00:00.067  SET MULTIPLE MODE
  c5 05 40 e7 ff ff ef 00      00:00:00.067  WRITE MULTIPLE

Error 909 occurred at disk power-on lifetime: 0 hours (0 days + 0 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
  -- -- -- -- -- -- --
  10 51 40 e7 ff ff ef  Error: IDNF at LBA = 0x0fffffe7 = 268435431

  Commands leading to the command that caused the error were:
  CR FR SC SN CL CH DH DC   Powered_Up_Time  Command/Feature_Name
  -- -- -- -- -- -- -- --  ----------------  --------------------
  c5 05 40 e7 ff ff ef 00      00:00:00.067  WRITE MULTIPLE
  c6 05 10 00 00 00 e0 00      00:00:00.067  SET MULTIPLE MODE
  c5 05 40 e7 ff ff ef 00      00:00:00.067  WRITE MULTIPLE
  c6 05 10 00 00 00 e0 00      00:00:00.067  SET MULTIPLE MODE
  c5 05 40 e7 ff ff ef 00      00:00:00.067  WRITE MULTIPLE

Error 908 occurred at disk power-on lifetime: 0 hours (0 days + 0 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
  -- -- -- -- -- -- --
  10 51 40 e7 ff ff ef  Error: IDNF at LBA = 0x0fffffe7 = 268435431

  Commands leading to the command that caused the error were:
  CR FR SC SN CL CH DH DC   Powered_Up_Time  Command/Feature_Name
  -- -- -- -- -- -- -- --  ----------------  --------------------
  c5 05 40 e7 ff ff ef 00      00:00:00.067  WRITE MULTIPLE
  c6 05 10 00 00 00 e0 00      00:00:00.067  SET MULTIPLE MODE
  c5 05 40 e7 ff ff ef 00      00:00:00.067  WRITE MULTIPLE
  c6 05 10 00 00 00 e0 00      00:00:00.067  SET MULTIPLE MODE
  c5 05 40 e7 ff ff ef 00      00:00:00.067  WRITE MULTIPLE

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 0
Note: revision number not 1 implies that no selective self-test has ever been run
 SPAN  MIN_LBA  MAX_LBA  CURRENT_TEST_STATUS
    1        0        0  Completed [00% left] (0-65535)
    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.

如果有RAID则smartctl将不起作用了,需要查看raid信息,使用对应厂家提供的工具

[root@appsvr etc]# dmesg | grep -i raid
scsi0 : LSI SAS based MegaRAID driver
  Vendor: IBM       Model: ServeRAID M1015   Rev: 2.0.
device-mapper: dm-raid45: initialized v0.2594l
md: Autodetecting RAID arrays.

在这里看到使用了LSI的卡,也可以使用如下命令RAID信息但是没有dmesg完整。

[root@appsvr etc]# cat /proc/scsi/scsi 
Attached devices:
Host: scsi0 Channel: 02 Id: 00 Lun: 00
  Vendor: IBM      Model: ServeRAID M1015  Rev: 2.0.
  Type:   Direct-Access                    ANSI SCSI revision: 05

LSI的卡提供了MegaCli工具可以在网站上想办法找到

[root@appsvr ~]# wget http://docs.avagotech.com/docs-and-downloads/raid-controllers/raid-controllers-common-files/8-07-14_MegaCLI.zip

解压、安装

[root@appsvr ~]# unzip 8-07-14_MegaCLI.zip 
Archive:  8-07-14_MegaCLI.zip
  inflating: 8.07.14_MegaCLI.txt     
  inflating: DOS/MegaCLI.exe         
 extracting: FreeBSD/MegaCLI.zip     
 extracting: FreeBSD/MegaCli64.zip   
  inflating: Linux/MegaCli-8.07.14-1.noarch.rpm  
  inflating: Solaris/MegaCli.pkg     
  inflating: Windows/MegaCli.exe     
  inflating: Windows/MegaCli64.exe   
[root@appsvr ~]# cd Linux/
[root@appsvr Linux]# rpm -ivh MegaCli-8.07.14-1.noarch.rpm 
Preparing...                ########################################### [100%]
   1:MegaCli                ########################################### [100%]

查看信息

[root@appsvr Linux]# /opt/MegaRAID/MegaCli/MegaCli64 -PDlist -aAll

Adapter #0

Enclosure Device ID: 64
Slot Number: 0
Drive's position: DiskGroup: 0, Span: 0, Arm: 0
Enclosure position: N/A
Device Id: 13
WWN: 
Sequence Number: 2
Media Error Count: 0
Other Error Count: 0
Predictive Failure Count: 0
Last Predictive Failure Event Seq Number: 0
PD Type: SAS

Raw Size: 279.396 GB [0x22ecb25c Sectors]
Non Coerced Size: 278.896 GB [0x22dcb25c Sectors]
Coerced Size: 278.464 GB [0x22cee000 Sectors]
Sector Size:  0
Firmware state: Online, Spun Up
Device Firmware Level: B55C
Shield Counter: 0
Successful diagnostics completion on :  N/A
SAS Address(0): 0x5000c5005a41bc8d
SAS Address(1): 0x0
Connected Port Number: 3(path0) 
Inquiry Data: IBM-ESXSST9300605SS     B55C6XP4H9FF0808B55C    
IBM FRU/CRU: 42D0638     
FDE Capable: Not Capable
FDE Enable: Disable
Secured: Unsecured
Locked: Unlocked
Needs EKM Attention: No
Foreign State: None 
Device Speed: 6.0Gb/s 
Link Speed: 6.0Gb/s 
Media Type: Hard Disk Device
Drive:  Not Certified
Drive Temperature :38C (100.40 F)
PI Eligibility:  No 
Drive is formatted for PI information:  No
PI: No PI
Port-0 :
Port status: Active
Port's Linkspeed: 6.0Gb/s 
Port-1 :
Port status: Active
Port's Linkspeed: Unknown 
Drive has flagged a S.M.A.R.T alert : No



Enclosure Device ID: 64
Slot Number: 1
Drive's position: DiskGroup: 0, Span: 0, Arm: 1
Enclosure position: N/A
Device Id: 11
WWN: 
Sequence Number: 2
Media Error Count: 0
Other Error Count: 0
Predictive Failure Count: 0
Last Predictive Failure Event Seq Number: 0
PD Type: SAS

Raw Size: 279.396 GB [0x22ecb25c Sectors]
Non Coerced Size: 278.896 GB [0x22dcb25c Sectors]
Coerced Size: 278.464 GB [0x22cee000 Sectors]
Sector Size:  0
Firmware state: Online, Spun Up
Device Firmware Level: B535
Shield Counter: 0
Successful diagnostics completion on :  N/A
SAS Address(0): 0x5000c5002c174c95
SAS Address(1): 0x0
Connected Port Number: 2(path0) 
Inquiry Data: IBM-ESXSST9300603SS   F B5356SE0XGAR0109B535    
IBM FRU/CRU: 42D0628     
FDE Capable: Not Capable
FDE Enable: Disable
Secured: Unsecured
Locked: Unlocked
Needs EKM Attention: No
Foreign State: None 
Device Speed: 6.0Gb/s 
Link Speed: 6.0Gb/s 
Media Type: Hard Disk Device
Drive:  Not Certified
Drive Temperature :40C (104.00 F)
PI Eligibility:  No 
Drive is formatted for PI information:  No
PI: No PI
Port-0 :
Port status: Active
Port's Linkspeed: 6.0Gb/s 
Port-1 :
Port status: Active
Port's Linkspeed: Unknown 
Drive has flagged a S.M.A.R.T alert : No



Enclosure Device ID: 64
Slot Number: 2
Drive's position: DiskGroup: 0, Span: 0, Arm: 2
Enclosure position: N/A
Device Id: 14
WWN: 
Sequence Number: 4
Media Error Count: 0
Other Error Count: 0
Predictive Failure Count: 0
Last Predictive Failure Event Seq Number: 0
PD Type: SAS

Raw Size: 279.396 GB [0x22ecb25c Sectors]
Non Coerced Size: 278.896 GB [0x22dcb25c Sectors]
Coerced Size: 278.464 GB [0x22cee000 Sectors]
Sector Size:  0
Firmware state: Online, Spun Up
Device Firmware Level: SB28
Shield Counter: 0
Successful diagnostics completion on :  N/A
SAS Address(0): 0x5000039398334ea2
SAS Address(1): 0x0
Connected Port Number: 1(path0) 
Inquiry Data: IBM-ESXSMBF2300RC       SB28EB70M6G5SB28SB28SB28
IBM FRU/CRU: 42D0638     
FDE Capable: Not Capable
FDE Enable: Disable
Secured: Unsecured
Locked: Unlocked
Needs EKM Attention: No
Foreign State: None 
Device Speed: 6.0Gb/s 
Link Speed: 6.0Gb/s 
Media Type: Hard Disk Device
Drive:  Not Certified
Drive Temperature :40C (104.00 F)
PI Eligibility:  No 
Drive is formatted for PI information:  No
PI: No PI
Port-0 :
Port status: Active
Port's Linkspeed: 6.0Gb/s 
Port-1 :
Port status: Active
Port's Linkspeed: Unknown 
Drive has flagged a S.M.A.R.T alert : No



Enclosure Device ID: 64
Slot Number: 3
Drive's position: DiskGroup: 0, Span: 0, Arm: 3
Enclosure position: N/A
Device Id: 9
WWN: 
Sequence Number: 2
Media Error Count: 0
Other Error Count: 0
Predictive Failure Count: 0
Last Predictive Failure Event Seq Number: 0
PD Type: SAS

Raw Size: 279.396 GB [0x22ecb25c Sectors]
Non Coerced Size: 278.896 GB [0x22dcb25c Sectors]
Coerced Size: 278.464 GB [0x22cee000 Sectors]
Sector Size:  0
Firmware state: Online, Spun Up
Device Firmware Level: B535
Shield Counter: 0
Successful diagnostics completion on :  N/A
SAS Address(0): 0x5000c5002c17368d
SAS Address(1): 0x0
Connected Port Number: 0(path0) 
Inquiry Data: IBM-ESXSST9300603SS   F B5356SE0VAWJ0109B535    
IBM FRU/CRU: 42D0628     
FDE Capable: Not Capable
FDE Enable: Disable
Secured: Unsecured
Locked: Unlocked
Needs EKM Attention: No
Foreign State: None 
Device Speed: 6.0Gb/s 
Link Speed: 6.0Gb/s 
Media Type: Hard Disk Device
Drive:  Not Certified
Drive Temperature :37C (98.60 F)
PI Eligibility:  No 
Drive is formatted for PI information:  No
PI: No PI
Port-0 :
Port status: Active
Port's Linkspeed: 6.0Gb/s 
Port-1 :
Port status: Active
Port's Linkspeed: Unknown 
Drive has flagged a S.M.A.R.T alert : No




Exit Code: 0x00
[root@appsvr Linux]# 

[ 编辑 | 历史 ]
最近由“jilili”在“2016-06-29 10:50:01”修改