View hard disk model, size, and other information (including Raid) in linux)
Check the hard disk model, size, and other information in linux. Whether the machine is Raid
I. Normal Mode (the hard disk is not configured as a disk array)
1. fdisk-l check your hard disk number, such as sda and sdb.
2. smartctl -- all/dev/sda
Smartctl -- all/dev/sda # This command comes with centos
[root@localhost ~]# 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
As shown above, the hard disk model is SanDisk SD6SB1M128G1022I and the capacity is 128 GB.
Ii. Disk Array RAID Mode
If the machine has a disk array, an error will be reported when running the above command, and the disk information you need is not obtained. You can use the MegaCli command
The MegaCli command system is not provided and requires additional downloads,
:
Http://www.lsi.com/downloads/Public/RAID%20Controllers/RAID%20Controllers%20Common%20Files/8.07.14_MegaCLI.zip
Decompress the package after the download,
Unzip CSA1.5-MegaCli_REL80571.zip
Cd MegaCLI/MegaCli_Linux
Rpm-ivh MegaCli-8.05.71-1.noarch.rpm
Installation Complete
Ln-s/opt/MegaRAID/MegaCli/MegaCli64/usr/bin/
By default, it is installed under/opt to establish a soft link to/usr/bin.
[root@localhost 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
We can see from the above that the machine has three hard disks, the model is,
WD WD3001BKHG D1S6WX11E83NU249 with a capacity of 300 GB.
MegaCli common parameters
MegaCli-adpCount [display the number of adapters]
MegaCli-AdpGetTime-aALL [display adapter time]
MegaCli-AdpAllInfo-aAll [show all adapters]
MegaCli-LDInfo-LALL-aAll [display information of all Logical Disk groups]
MegaCli-PDList-aAll [display all physical information]
MegaCli-AdpBbuCmd-GetBbuStatus-aALL | grep 'charger status' [view charging Status]
MegaCli-AdpBbuCmd-GetBbuStatus-aALL [display BBU status information]
MegaCli-AdpBbuCmd-GetBbuCapacityInfo-aALL [display BBU capacity information]
MegaCli-AdpBbuCmd-GetBbuDesignInfo-aALL [display BBU design parameters]
MegaCli-AdpBbuCmd-GetBbuProperties-aALL [display current BBU attributes]
MegaCli-cfgdsply-aALL [display Raid card model, Raid settings, Disk Information]
The change in the tape status, from disk pulling to disk insertion.
Device | Normal | Damage | Rebuild | Normal
Virtual Drive | Optimal | Degraded | Optimal
Physical Drive | Online | Failed-> Unconfigured | Rebuild | Online