linux hard disk management raid

  The server has some hard disk alarms that need to be replaced. I just took over the server. I don't know the specific situation. Baidu has some tutorials that are not satisfactory. The query results are not what I want. 

After I found an article address http://blog.csdn.net/msdnchina/article/details/52475383 I only write here where there is a discrepancy with my actual operation for review 
cat /proc/scsi/scsi 
dmesg | grep -i raid

lsi MegaRAID raid card management tool can check the following information:
raid level,
raid is composed of several physical hard disks, and
the manufacturer of the physical hard disk.

Software raid: Check the raid level, status and other information
#cat /proc/mdstat
Hardware raid: Check the manufacturer, model, and level of the raid
#cat /proc/scsi/scsi
dmesg | grep -i raid

dracut: rd_NO_MD: removing MD RAID activation
megaraid_sas 0000:03:00.0: PCI INT A -> GSI 42 (level, low) -> IRQ 42
megaraid_sas 0000:03:00.0: setting latency timer to 64
megaraid_sas 0000:03:00.0: FW now in Ready state
megaraid_sas 0000:03:00.0: irq 107 for MSI/MSI-X
megaraid_sas 0000:03:00.0: irq 108 for MSI/MSI-X
megaraid_sas 0000:03:00.0: irq 109 for MSI/MSI-X
megaraid_sas 0000:03:00.0: irq 110 for MSI/MSI-X
megaraid_sas 0000:03:00.0: irq 111 for MSI/MSI-X
megaraid_sas 0000:03:00.0: irq 112 for MSI/MSI-X
megaraid_sas 0000:03:00.0: irq 113 for MSI/MSI-X
megaraid_sas 0000:03:00.0: irq 114 for MSI/MSI-X
megaraid_sas 0000:03:00.0: firmware supports msix    : (16)
megaraid_sas 0000:03:00.0: current msix/online cpus    : (8/8)
megaraid_sas 0000:03:00.0: RDPQ mode    : (disabled)
megaraid_sas 0000:03:00.0: Current firmware maximum commands: 1008     LDIO threshold: 0
megaraid_sas 0000:03:00.0: Init cmd success
megaraid_sas 0000:03:00.0: firmware type    : Legacy(64 VD) firmware
megaraid_sas 0000:03:00.0: controller type    : MR(512MB)
megaraid_sas 0000:03:00.0: Online Controller Reset(OCR)    : Enabled
megaraid_sas 0000:03:00.0: Secure JBOD support    : No
megaraid_sas 0000:03:00.0: INIT adapter done
megaraid_sas 0000:03:00.0: Jbod map is not supported megasas_setup_jbod_map 4967
megaraid_sas 0000:03:00.0: pci id        : (0x1000)/(0x005b)/(0x1028)/(0x1f38)
megaraid_sas 0000:03:00.0: unevenspan support    : no
megaraid_sas 0000:03:00.0: firmware crash dump    : no
megaraid_sas 0000:03:00.0: jbod sync map        : no
scsi0 : Avago SAS based MegaRAID driver
megaraid_sas 0000:03:00.0: scanning for scsi0...
megaraid_sas 0000:03:00.0: 4145 (529973269s/0x0001/CRIT) - VD 00/0 is now DEGRADED
megaraid_sas 0000:03:00.0: scanning for scsi0...
软件下载地址http://www.avagotech.com/support/download-search

Search for "megacli" in the search box, click OK, find MegaCLI 5.5 P2 (this is a command line tool) under Management Software and Tools (22), and: lsi has been acquired by avago.

[root@F11 ~]# mv 8-07-14_MegaCLI.zip 123/
[root@F11 ~]# cd 123/
[root@F11 123]# 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@F11 123]# ls -lrt
total 7824
-rw-r--r-- 1 root root   48298 Jan 19  2014 8.07.14_MegaCLI.txt
-rw-r--r-- 1 root root 7939395 Dec  8 10:34 8-07-14_MegaCLI.zip
drwxr-xr-x 2 root root    4096 Dec  8 10:36 DOS
drwxr-xr-x 2 root root    4096 Dec  8 10:36 FreeBSD
drwxr-xr-x 2 root root    4096 Dec  8 10:36 Linux
drwxr-xr-x 2 root root    4096 Dec  8 10:36 Solaris
drwxr-xr-x 2 root root    4096 Dec  8 10:36 Windows
[root@F11 123]# cd Linux/
[root@F11 Linux]# LS -L
-bash: LS: command not found
[root@F11 Linux]# ls -l
total 1516
-rw-r--r-- 1 root root 1549650 Dec 16  2013 MegaCli-8.07.14-1.noarch.rpm
[root@F11 Linux]# rpm -ivh MegaCli-8.07.14-1.noarch.rpm 
Preparing...                ########################################### [100%]
   1:MegaCli                ########################################### [100%]
[root@F11 Linux]# cd /opt/MegaRAID/MegaCli/ 
[root@F11 MegaCli]# ls -l
total 3188
-rw-r--r-- 1 root root       0 Dec  8 10:37 install.log
lrwxrwxrwx 1 root root      48 Dec  8 10:37 libstorelibir-2.so -> /opt/MegaRAID/MegaCli/libstorelibir-2.so.14.07-0
-rwx------ 1 root root  540512 Dec 16  2013 libstorelibir-2.so.14.07-0
-rwxr-xr-x 1 root root 2720320 Dec 16  2013 MegaCli64

 

The following are the commands used by MegaCli

  1. Command use:  
  2. #/opt/MegaCli -LDInfo -Lall -aALL Check raid level  
  3. #/opt/MegaCli -AdpAllInfo -aALL Check raid card information  
  4. #/opt/MegaCli -PDList -aALL View hard disk information  
  5. #/opt/MegaCli -AdpBbuCmd -aAll View battery information  
  6. #/opt/MegaCli -FwTermLog -Dsply -aALL View raid card logs  
  7. #/opt/MegaCli -adpCount [Number of display adapters]  
  8. #/opt/MegaCli -AdpGetTime -aALL [Display adapter time]  
  9. #/opt/MegaCli -AdpAllInfo -aAll [Display all adapter information]  
  10. #/opt/MegaCli -LDInfo -LALL -aAll [Display all logical disk group information]  
  11. #/opt/MegaCli -PDList -aAll [Show all physical information]  
  12. #/opt/MegaCli -AdpBbuCmd -GetBbuStatus -aALL |grep 'Charger Status' 【Check charging status】  
  13. #/opt/MegaCli -AdpBbuCmd -GetBbuStatus -aALL [Display BBU status information]  
  14. #/opt/MegaCli -AdpBbuCmd -GetBbuCapacityInfo -aALL [Display BBU capacity information]  
  15. #/opt/MegaCli -AdpBbuCmd -GetBbuDesignInfo -aALL [Display BBU design parameters]  
  16. #/opt/MegaCli -AdpBbuCmd -GetBbuProperties -aALL [Display current BBU properties]  
  17. #/opt/MegaCli -cfgdsply -aALL [Display Raid card model, Raid settings, Disk related information] 

[root@F11 MegaCli]# ./MegaCli64 -PDList -aALL  
                                     
Adapter #0

Enclosure Device ID: 32
Slot Number: 0
Enclosure position: 1
Device Id: 0
WWN: 5000CCA03EC7F6AB
Sequence Number: 4
Media Error Count: 4
Other Error Count: 9

These two values ​​are used to determine whether there is a problem with the disk in the array; Medai Error Count indicates that the disk may be wrong, or the disk may have bad sectors. It is worth noting that this value is not 0. The larger the value, the higher the risk factor, and the Other Error Count indicates that the disk There may be looseness and may need to be reinserted. MegaCli can detect all the disks in the array, and we can detect the relevant parameters through the script, so as to notify the administrator.
Predictive Failure Count: 0
Last Predictive Failure Event Seq Number: 0
PD Type: SAS

Raw Size: 2.728 TB [0x15d50a3b0 Sectors]
Non Coerced Size: 2.728 TB [0x15d40a3b0 Sectors]
Coerced Size: 2.728 TB [0x15d400000 Sectors]
Sector Size:  0
Firmware state: Unconfigured(bad)
Device Firmware Level: M440
Shield Counter: 0
Successful diagnostics completion on :  N/A
SAS Address(0): 0x5000cca03ec7f6a9
SAS Address(1): 0x0
Connected Port Number: 0(path0) 
Inquiry Data: HITACHI HUS723030ALS640 M440YVKJZ4YK            
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 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: 32
Slot Number: 1
Drive's position: DiskGroup: 0, Span: 0, Arm: 1
Enclosure position: 1
Device Id: 1
WWN: 5000CCA03EC56C53
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: 2.728 TB [0x15d50a3b0 Sectors]
Non Coerced Size: 2.728 TB [0x15d40a3b0 Sectors]
Coerced Size: 2.728 TB [0x15d400000 Sectors]
Sector Size:  0
Firmware state: Online, Spun Up
Device Firmware Level: M440
Shield Counter: 0
Successful diagnostics completion on :  N/A
SAS Address(0): 0x5000cca03ec56c51
SAS Address(1): 0x0
Connected Port Number: 0(path0) 
Inquiry Data: HITACHI HUS723030ALS640 M440YVKHKV9K            
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 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: 32
Slot Number: 2
Drive's position: DiskGroup: 0, Span: 0, Arm: 2
Enclosure position: 1
Device Id: 2
WWN: 5000CCA03EC7659B
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: 2.728 TB [0x15d50a3b0 Sectors]
Non Coerced Size: 2.728 TB [0x15d40a3b0 Sectors]
Coerced Size: 2.728 TB [0x15d400000 Sectors]
Sector Size:  0
Firmware state: Online, Spun Up
Device Firmware Level: M440
Shield Counter: 0
Successful diagnostics completion on :  N/A
SAS Address(0): 0x5000cca03ec76599
SAS Address(1): 0x0
Connected Port Number: 0(path0) 
Inquiry Data: HITACHI HUS723030ALS640 M440YVKJNHGK            
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 Temperature :36C (96.80 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: 32
Slot Number: 3
Drive's position: DiskGroup: 0, Span: 0, Arm: 3
Enclosure position: 1
Device Id: 3
WWN: 5000CCA03EC8035F
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: 2.728 TB [0x15d50a3b0 Sectors]
Non Coerced Size: 2.728 TB [0x15d40a3b0 Sectors]
Coerced Size: 2.728 TB [0x15d400000 Sectors]
Sector Size:  0
Firmware state: Online, Spun Up
Device Firmware Level: M440
Shield Counter: 0
Successful diagnostics completion on :  N/A
SAS Address(0): 0x5000cca03ec8035d
SAS Address(1): 0x0
Connected Port Number: 0(path0) 
Inquiry Data: HITACHI HUS723030ALS640 M440YVKK005K            
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 Temperature :34C (93.20 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: 32
Slot Number: 4
Drive's position: DiskGroup: 0, Span: 0, Arm: 0
Enclosure position: 1
Device Id: 4
WWN: 5000CCA03EC7FFC7
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: 2.728 TB [0x15d50a3b0 Sectors]
Non Coerced Size: 2.728 TB [0x15d40a3b0 Sectors]
Coerced Size: 2.728 TB [0x15d400000 Sectors]
Sector Size:  0
Firmware state: Online, Spun Up
Device Firmware Level: M440
Shield Counter: 0
Successful diagnostics completion on :  N/A
SAS Address(0): 0x5000cca03ec7ffc5
SAS Address(1): 0x0
Connected Port Number: 0(path0) 
Inquiry Data: HITACHI HUS723030ALS640 M440YVKJZSSK            
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 Temperature :33C (91.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

Too much hard disk content has been omitted

[root @ F11 MegaCli] # ./MegaCli64 -LDInfo -Lall -aALL  
                                     

Adapter 0 -- Virtual Drive Information:
Virtual Drive: 0 (Target Id: 0)
Name                :
RAID Level          : Primary-5, Secondary-0, RAID Level Qualifier-3
Size                : 8.185 TB
Sector Size         : 512
Parity Size         : 2.728 TB
State               : Optimal
Strip Size          : 64 KB
Number Of Drives    : 4
Span Depth          : 1
Default Cache Policy: WriteBack, ReadAdaptive, Direct, No Write Cache if Bad BBU
Current Cache Policy: WriteBack, ReadAdaptive, Direct, No Write Cache if Bad BBU
Default Access Policy: Read/Write
Current Access Policy: Read/Write
Disk Cache Policy   : Disk's Default
Encryption Type     : None
Default Power Savings Policy: Controller Defined
Current Power Savings Policy: None
Can spin up in 1 minute: Yes
LD has drives that support T10 power conditions: Yes
LD's IO profile supports MAX power savings with cached writes: No
Bad Blocks Exist: No
Is VD Cached: Yes
Cache Cade Type : Read Only
 

 

Another valuable reference URL:

http://blog.chinaunix.net/uid-25135004-id-3139293.html

http://blog.csdn.net/smithereensman/article/details/51320499

Guess you like

Origin http://43.154.161.224:23101/article/api/json?id=326070659&siteId=291194637