linux 下查看硬碟型號、大小等資訊(含Raid)

來源:互聯網
上載者:User

標籤:

linux 下查看硬碟型號、大小等資訊,機器有沒有做Raid有關係

 

一、普通模式(該機硬碟沒有做磁碟陣列)

1、fdisk -l 查看你的硬碟編號,如sda,sdb 等

2、smartctl --all /dev/sda

smartctl --all /dev/sda #該命令centos內建

 

[[email protected] ~]# smartctl --all /dev/sdasmartctl 5.43 2012-06-30 r3573 [x86_64-linux-2.6.32-504.el6.x86_64] (local build)Copyright (C) 2002-12 by Bruce Allen, http://smartmontools.sourceforge.net=== START OF INFORMATION SECTION ===Device Model:     SanDisk SD6SB1M128G1022ISerial Number:    141218410909LU WWN Device Id: 5 001b44 becdaed9dFirmware Version: X231600User Capacity:    128,035,676,160 bytes [128 GB]Sector Size:      512 bytes logical/physicalDevice is:        Not in smartctl database [for details use: -P showall]ATA Version is:   8ATA Standard is:  ATA-8-ACS revision 6Local Time is:    Fri Jan 16 08:35:48 2015 CSTSMART support is: Available - device has SMART capability.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

[[email protected] bin]# /opt/MegaRAID/MegaCli/MegaCli64 -PDlist -aALLAdapter #0Enclosure Device ID: 32Slot Number: 0Drive's position: DiskGroup: 0, Span: 0, Arm: 0Enclosure position: 1Device Id: 0WWN: 50000C0F02E57BE9Sequence Number: 2Media Error Count: 0Other Error Count: 0Predictive Failure Count: 0Last Predictive Failure Event Seq Number: 0PD Type: SASRaw Size: 279.396 GB [0x22ecb25c Sectors]Non Coerced Size: 278.896 GB [0x22dcb25c Sectors]Coerced Size: 278.875 GB [0x22dc0000 Sectors]Sector Size:  0Firmware state: Online, Spun UpDevice Firmware Level: D1S6Shield Counter: 0Successful diagnostics completion on :  N/ASAS Address(0): 0x50000c0f02e57beaSAS Address(1): 0x0Connected Port Number: 0(path0)Inquiry Data: WD      WD3001BKHG      D1S6WX11E83NU249FDE Capable: Not CapableFDE Enable: DisableSecured: UnsecuredLocked: UnlockedNeeds EKM Attention: NoForeign State: NoneDevice Speed: 6.0Gb/sLink Speed: 6.0Gb/sMedia Type: Hard Disk DeviceDrive Temperature :31C (87.80 F)PI Eligibility:  NoDrive is formatted for PI information:  NoPI: No PIPort-0 :Port status: ActivePort's Linkspeed: 6.0Gb/sPort-1 :Port status: ActivePort's Linkspeed: UnknownDrive has flagged a S.M.A.R.T alert : NoEnclosure Device ID: 32Slot Number: 1Drive's position: DiskGroup: 0, Span: 0, Arm: 1Enclosure position: 1Device Id: 1WWN: 50000C0F028F32EDSequence Number: 2Media Error Count: 0Other Error Count: 0Predictive Failure Count: 0Last Predictive Failure Event Seq Number: 0PD Type: SASRaw Size: 279.396 GB [0x22ecb25c Sectors]Non Coerced Size: 278.896 GB [0x22dcb25c Sectors]Coerced Size: 278.875 GB [0x22dc0000 Sectors]Sector Size:  0Firmware state: Online, Spun UpDevice Firmware Level: D1S6Shield Counter: 0Successful diagnostics completion on :  N/ASAS Address(0): 0x50000c0f028f32eeSAS Address(1): 0x0Connected Port Number: 1(path0)Inquiry Data: WD      WD3001BKHG      D1S6WX11E83VD242FDE Capable: Not CapableFDE Enable: DisableSecured: UnsecuredLocked: UnlockedNeeds EKM Attention: NoForeign State: NoneDevice Speed: 6.0Gb/sLink Speed: 6.0Gb/sMedia Type: Hard Disk DeviceDrive Temperature :31C (87.80 F)PI Eligibility:  NoDrive is formatted for PI information:  NoPI: No PIPort-0 :Port status: ActivePort's Linkspeed: 6.0Gb/sPort-1 :Port status: ActivePort's Linkspeed: UnknownDrive has flagged a S.M.A.R.T alert : NoEnclosure Device ID: 32Slot Number: 2Drive's position: DiskGroup: 0, Span: 0, Arm: 2Enclosure position: 1Device Id: 2WWN: 50000C0F02E5B8EDSequence Number: 2Media Error Count: 0Other Error Count: 0Predictive Failure Count: 0Last Predictive Failure Event Seq Number: 0PD Type: SASRaw Size: 279.396 GB [0x22ecb25c Sectors]Non Coerced Size: 278.896 GB [0x22dcb25c Sectors]Coerced Size: 278.875 GB [0x22dc0000 Sectors]Sector Size:  0Firmware state: Online, Spun UpDevice Firmware Level: D1S6Shield Counter: 0Successful diagnostics completion on :  N/ASAS Address(0): 0x50000c0f02e5b8eeSAS Address(1): 0x0Connected Port Number: 2(path0)Inquiry Data: WD      WD3001BKHG      D1S6WX11E83NU081FDE Capable: Not CapableFDE Enable: DisableSecured: UnsecuredLocked: UnlockedNeeds EKM Attention: NoForeign State: NoneDevice Speed: 6.0Gb/sLink Speed: 6.0Gb/sMedia Type: Hard Disk DeviceDrive Temperature :28C (82.40 F)PI Eligibility:  NoDrive is formatted for PI information:  NoPI: No PIPort-0 :Port status: ActivePort's Linkspeed: 6.0Gb/sPort-1 :Port status: ActivePort's Linkspeed: UnknownDrive has flagged a S.M.A.R.T alert : NoExit 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

 

 

 

 

 

 

 

 

linux 下查看硬碟型號、大小等資訊(含Raid)

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.