CentOS下下查看硬盘型号、大小等信息(含Raid)

一、普通模式(该机硬盘没有做磁盘阵列)

1、fdisk -l 查看你的硬盘编号,如sda,sdb 等

2、smartctl --all /dev/sda

[html] view plain copy

 

 

 

  1. smartctl --all /dev/sda #该命令centos自带  

 

[html] view plain copy

 

 

 

  1. [root@localhost ~]# smartctl --all /dev/sda  
  2. smartctl 5.43 2012-06-30 r3573 [x86_64-linux-2.6.32-504.el6.x86_64] (local build)  
  3. Copyright (C) 2002-12 by Bruce Allen, http://smartmontools.sourceforge.net  
  4.   
  5. === START OF INFORMATION SECTION ===  
  6. Device Model:     SanDisk SD6SB1M128G1022I  
  7. Serial Number:    141218410909  
  8. LU WWN Device Id: 5 001b44 becdaed9d  
  9. Firmware Version: X231600  
  10. User Capacity:    128,035,676,160 bytes [128 GB]  
  11. Sector Size:      512 bytes logical/physical  
  12. Device is:        Not in smartctl database [for details use: -P showall]  
  13. ATA Version is:   8  
  14. ATA Standard is:  ATA-8-ACS revision 6  
  15. Local Time is:    Fri Jan 16 08:35:48 2015 CST  
  16. SMART support is: Available - device has SMART capability.  
  17. SMART support is: Enabled  

从上面可以看出,硬盘型号为SanDisk SD6SB1M128G1022I,容量为128GB

 

二、磁盘阵列 RAID模式

如果该机有做磁盘阵列,那么运行上述命令会报错,得不到你要的磁盘信息。可以借助MegaCli命令

MegaCli命令系统不自带,需要额外下载,

下载地址:

http://www.lsi.com/downloads/Public/RAID%20Controllers/RAID%20Controllers%20Common%20Files/8.07.14_MegaCLI.zip

下载之后解压,

unzip CSA1.5-MegaCli_REL80571.zip

cd MegaCLI/MegaCli_Linux

rpm -ivh MegaCli-8.05.71-1.noarch.rpm

 

安装完成

ln -s /opt/MegaRAID/MegaCli/MegaCli64 /usr/bin/

默认安装在/opt下面,建立软链到/usr/bin

[html] view plain copy

 

 

 

  1. [root@localhost bin]# /opt/MegaRAID/MegaCli/MegaCli64 -PDlist -aALL  
  2.   
  3. Adapter #0  
  4.   
  5. Enclosure Device ID: 32  
  6. Slot Number: 0  
  7. Drive's position: DiskGroup: 0, Span: 0, Arm: 0  
  8. Enclosure position: 1  
  9. Device Id: 0  
  10. WWN: 50000C0F02E57BE9  
  11. Sequence Number: 2  
  12. Media Error Count: 0  
  13. Other Error Count: 0  
  14. Predictive Failure Count: 0  
  15. Last Predictive Failure Event Seq Number: 0  
  16. PD Type: SAS  
  17.   
  18. Raw Size: 279.396 GB [0x22ecb25c Sectors]  
  19. Non Coerced Size: 278.896 GB [0x22dcb25c Sectors]  
  20. Coerced Size: 278.875 GB [0x22dc0000 Sectors]  
  21. Sector Size:  0  
  22. Firmware state: Online, Spun Up  
  23. Device Firmware Level: D1S6  
  24. Shield Counter: 0  
  25. Successful diagnostics completion on :  N/A  
  26. SAS Address(0): 0x50000c0f02e57bea  
  27. SAS Address(1): 0x0  
  28. Connected Port Number: 0(path0)  
  29. Inquiry Data: WD      WD3001BKHG      D1S6WX11E83NU249  
  30. FDE Capable: Not Capable  
  31. FDE Enable: Disable  
  32. Secured: Unsecured  
  33. Locked: Unlocked  
  34. Needs EKM Attention: No  
  35. Foreign State: None  
  36. Device Speed: 6.0Gb/s  
  37. Link Speed: 6.0Gb/s  
  38. Media Type: Hard Disk Device  
  39. Drive Temperature :31C (87.80 F)  
  40. PI Eligibility:  No  
  41. Drive is formatted for PI information:  No  
  42. PI: No PI  
  43. Port-0 :  
  44. Port status: Active  
  45. Port's Linkspeed: 6.0Gb/s  
  46. Port-1 :  
  47. Port status: Active  
  48. Port's Linkspeed: Unknown  
  49. Drive has flagged a S.M.A.R.T alert : No  
  50.   
  51.   
  52.   
  53. Enclosure Device ID: 32  
  54. Slot Number: 1  
  55. Drive's position: DiskGroup: 0, Span: 0, Arm: 1  
  56. Enclosure position: 1  
  57. Device Id: 1  
  58. WWN: 50000C0F028F32ED  
  59. Sequence Number: 2  
  60. Media Error Count: 0  
  61. Other Error Count: 0  
  62. Predictive Failure Count: 0  
  63. Last Predictive Failure Event Seq Number: 0  
  64. PD Type: SAS  
  65.   
  66. Raw Size: 279.396 GB [0x22ecb25c Sectors]  
  67. Non Coerced Size: 278.896 GB [0x22dcb25c Sectors]  
  68. Coerced Size: 278.875 GB [0x22dc0000 Sectors]  
  69. Sector Size:  0  
  70. Firmware state: Online, Spun Up  
  71. Device Firmware Level: D1S6  
  72. Shield Counter: 0  
  73. Successful diagnostics completion on :  N/A  
  74. SAS Address(0): 0x50000c0f028f32ee  
  75. SAS Address(1): 0x0  
  76. Connected Port Number: 1(path0)  
  77. Inquiry Data: WD      WD3001BKHG      D1S6WX11E83VD242  
  78. FDE Capable: Not Capable  
  79. FDE Enable: Disable  
  80. Secured: Unsecured  
  81. Locked: Unlocked  
  82. Needs EKM Attention: No  
  83. Foreign State: None  
  84. Device Speed: 6.0Gb/s  
  85. Link Speed: 6.0Gb/s  
  86. Media Type: Hard Disk Device  
  87. Drive Temperature :31C (87.80 F)  
  88. PI Eligibility:  No  
  89. Drive is formatted for PI information:  No  
  90. PI: No PI  
  91. Port-0 :  
  92. Port status: Active  
  93. Port's Linkspeed: 6.0Gb/s  
  94. Port-1 :  
  95. Port status: Active  
  96. Port's Linkspeed: Unknown  
  97. Drive has flagged a S.M.A.R.T alert : No  
  98.   
  99.   
  100.   
  101. Enclosure Device ID: 32  
  102. Slot Number: 2  
  103. Drive's position: DiskGroup: 0, Span: 0, Arm: 2  
  104. Enclosure position: 1  
  105. Device Id: 2  
  106. WWN: 50000C0F02E5B8ED  
  107. Sequence Number: 2  
  108. Media Error Count: 0  
  109. Other Error Count: 0  
  110. Predictive Failure Count: 0  
  111. Last Predictive Failure Event Seq Number: 0  
  112. PD Type: SAS  
  113.   
  114. Raw Size: 279.396 GB [0x22ecb25c Sectors]  
  115. Non Coerced Size: 278.896 GB [0x22dcb25c Sectors]  
  116. Coerced Size: 278.875 GB [0x22dc0000 Sectors]  
  117. Sector Size:  0  
  118. Firmware state: Online, Spun Up  
  119. Device Firmware Level: D1S6  
  120. Shield Counter: 0  
  121. Successful diagnostics completion on :  N/A  
  122. SAS Address(0): 0x50000c0f02e5b8ee  
  123. SAS Address(1): 0x0  
  124. Connected Port Number: 2(path0)  
  125. Inquiry Data: WD      WD3001BKHG      D1S6WX11E83NU081  
  126. FDE Capable: Not Capable  
  127. FDE Enable: Disable  
  128. Secured: Unsecured  
  129. Locked: Unlocked  
  130. Needs EKM Attention: No  
  131. Foreign State: None  
  132. Device Speed: 6.0Gb/s  
  133. Link Speed: 6.0Gb/s  
  134. Media Type: Hard Disk Device  
  135. Drive Temperature :28C (82.40 F)  
  136. PI Eligibility:  No  
  137. Drive is formatted for PI information:  No  
  138. PI: No PI  
  139. Port-0 :  
  140. Port status: Active  
  141. Port's Linkspeed: 6.0Gb/s  
  142. Port-1 :  
  143. Port status: Active  
  144. Port's Linkspeed: Unknown  
  145. Drive has flagged a S.M.A.R.T alert : No  
  146.   
  147.   
  148.   
  149.   
  150. Exit Code: 0x00  



 

从上面可以看出,该机有三块硬盘,型号为,

WD      WD3001BKHG      D1S6WX11E83NU249,容量为300GB。

 

MegaCli常用参数介绍 

MegaCli -adpCount 【显示适配器个数】

MegaCli -AdpGetTime –aALL 【显示适配器时间】

MegaCli -AdpAllInfo -aAll 【显示所有适配器信息】

MegaCli -LDInfo -LALL -aAll 【显示所有逻辑磁盘组信息】

MegaCli -PDList -aAll 【显示所有的物理信息】

MegaCli -AdpBbuCmd -GetBbuStatus -aALL |grep ‘Charger Status’ 【查看充电状态】

MegaCli -AdpBbuCmd -GetBbuStatus -aALL【显示BBU状态信息】

MegaCli -AdpBbuCmd -GetBbuCapacityInfo -aALL【显示BBU容量信息】

MegaCli -AdpBbuCmd -GetBbuDesignInfo -aALL 【显示BBU设计参数】

MegaCli -AdpBbuCmd -GetBbuProperties -aALL 【显示当前BBU属性】

MegaCli -cfgdsply -aALL 【显示Raid卡型号,Raid设置,Disk相关信息】

磁带状态的变化,从拔盘,到插盘的过程中。 

Device |Normal|Damage|Rebuild|Normal

Virtual Drive |Optimal|Degraded|Degraded|Optimal

Physical Drive |Online|Failed –> Unconfigured|Rebuild|Online

posted @ 2023-01-04 16:34  augusite  阅读(5753)  评论(0编辑  收藏  举报