MegaCli64: unconfigured good to JBOD
Today's task is to add a JBOD drive back into a live Dell PERC H730 with BBU using the MegaCLI64 application. Every man jack has a page on adding a drive back into an array (including myself).
A drive has been chucked out as MISSING by a replacement and some rather intensive IO operation rebuilding software based distributed storage - engineers pulling the "not me" body language.
It is not being picked up by fdisk -l or diskhotswap list - but showing as UNCONFIGURED GOOD and on closer inspection - also showing FOREIGN on some pages. I can heart the Brexiteers & Daily Mail readers eyes narrowing and sweating forming from here.
Having installed the MegCli64 tool and floundered around with existing rules - it is, of course, a passthrough or JBOD drive (albeit with adaptive WB cache with BBU and so on) - I listed out the drives and identified the one that was considered foreign. So let's solve this:
[root@123.123.123.123 MegaCli]# ./MegaCli64 -PDList -aAL
As you can see from the below it doesn't like drive very much at all.
Enclosure Device ID: 32
Slot Number: 5
Enclosure position: 1
Device Id: 5
WWN: 500a075115ba298f
Sequence Number: 12
Media Error Count: 0
Other Error Count: 6
Predictive Failure Count: 0
Last Predictive Failure Event Seq Number: 0
PD Type: SATA
Raw Size: 978.087 GB [0x7a42d570 Sectors]
Non Coerced Size: 977.587 GB [0x7a32d570 Sectors]
Coerced Size: 977.5 GB [0x7a300000 Sectors]
Sector Size: 512
Logical Sector Size: 512
Physical Sector Size: 512
Firmware state: Unconfigured(good), Spun Up
Device Firmware Level: R040
Shield Counter: 0
Successful diagnostics completion on : N/A
SAS Address(0): 0x4433221101000000
Connected Port Number: 1(path0)
Inquiry Data: 170615BA298FCrucial_CT1050MX300SSD1 M0CR040
FDE Capable: Capable
FDE Enable: Disable
Secured: Unsecured
Locked: Unlocked
Needs EKM Attention: No
Foreign State: Foreign
Foreign Secure: Drive is not secured by a foreign lock key
Device Speed: 6.0Gb/s
Link Speed: 6.0Gb/s
Media Type: Solid State Device
Drive: Not Certified
Drive Temperature :26C (78.80 F)
PI Eligibility: No
Drive is formatted for PI information: No
PI: No PI
Drive's NCQ setting : N/A
Port-0 :
Port status: Active
Port's Linkspeed: 6.0Gb/s
Drive has flagged a S.M.A.R.T alert : No
So looking over that extract above I can see that this is ENCLOSURE 32 and SLOT 5.
*I think* - so let's remove the think and ask for it specifically:
[root@123.123.123.123 MegaCli]# ./MegaCli64 -PDInfo -PhysDrv [32:5] -aALL
For me - sure enough - same drive - same foreign setting. I HAVE YOU NOW!
So lets scan and find the drive...
[root@123.123.123.123 MegaCli]# ./MegaCli64 -CfgForeign -Scan -a0
There are 1 foreign configuration(s) on controller 0.
Exit Code: 0x00
Excellent - now let's remove that FOREIGN status as its now 'local people':
[root@123.123.123.123 MegaCli]# ./MegaCli64 -CfgForeign -Clear -a0
Foreign configuration 0 is cleared on controller 0.
Exit Code: 0x00
Then - the bit which funnily enough I had issue finding as everyone wants to use these fancy controllers with complex RAID configurations - the adding of a JBOD drive and bringing it online.
[root@123.123.123.123 MegaCli]# ./MegaCli64 -PDMakeJBOD -PhysDrv[32:5] -a0
Adapter: 0: EnclId-32 SlotId-5 state changed to JBOD.
Exit Code: 0x00
This brings this in line with my other JBOD drives within this host (fancy software based distributed storage with 10GigE interconnects and SSDs).
[root@123.123.123 MegaCli]# ./lsi.sh drives
Slot Number: 0 - JBOD
Slot Number: 1 - JBOD
Slot Number: 2 - JBOD
Slot Number: 3 - JBOD
Slot Number: 4 - JBOD
Slot Number: 5 - Unconfigured(good), Spun Up
Slot Number: 6 - JBOD
Slot Number: 7 - JBOD
...becomes...
[root@123.123.123.123 MegaCli]# ./lsi.sh drives
Slot Number: 0 - JBOD
Slot Number: 1 - JBOD
Slot Number: 2 - JBOD
Slot Number: 3 - JBOD
Slot Number: 4 - JBOD
Slot Number: 5 - JBOD
Slot Number: 6 - JBOD
Slot Number: 7 - JBOD
Great Success! Achievement Unlocked! TAKE THAT FRIDAY!
Note:
Oooo. Credit where credit due:
This page has Python! But if you scroll down there is a handy script to use there to help it be less painful to deal with: https://calomel.org/megacli_lsi_commands.html
This page has the bit I was missing in terms of clue for adding a JBOD drive (although it was adding loads and I just wanted one) - every man jack has links to configuring various RAID arrays and adding in drives and so such, and a fair few on changing all to JBOD but I was super failing on finding a means to add a single drive. So yay person who owns this: https://danielparker.me/til/megacli/megaraid/mega-cli-TIL/