Creating a Virtual Drive with MegaCLI utility

A server with 12 disks attacked to a MegaRAID controller is missing a virtual drive. The first two are mirrored for boot device. The remaining disks are used as single disk volumes. There should be 11 virtual drives but I see only 10.

# lsblk  | grep -w 'sd[a-z]' |  wc -l
10

One is listed as “Unconfigured Good” in the UCS Manager as well MegaRAID webBIOS. This is because it was replaced and a new virtual drive needs to be created.

Virtual Drive can be created from the webBIOS. It can also be created using the MegaCli utility from the command line if the server runs Linux as below:

# ./MegaCli64  -CfgLdAdd -r0 '[38:10]' -a0

Adapter 0: Created VD 8

Adapter 0: Configured the Adapter!!

Exit Code: 0x00

“r0” is the raid level and “38:10” are the Enclosure ID and Slot# which you can find out using this command

# ./MegaCli64 -PDList -aALL | egrep 'Adapter|Enclosure|Slot|Inquiry'
Adapter #0
Enclosure Device ID: 38
Slot Number: 1
Enclosure position: 1
Inquiry Data: xxxxxx      xxxxxxx
Enclosure Device ID: 38
Slot Number: 2
Enclosure position: 1
Inquiry Data: xxxxxxx     xxxxxxx
.
.
.
.

In this example, I knew before hand which disk was replaced. An easy way to identify the disk and Device ID is using the webBIOS. Look at the lines in blue.

megaraid-unconfigured-good

It should be possible identify the “Unconfigured Good” disk from the command line but I do not have a record of it in my note.

After creating the VD, there are now 11 virtual drives as expected

# ./MegaCli64 -LDInfo -Lall -aALL | egrep "^(Virtual|State|Num)"
Virtual Drive: 0 (Target Id: 0)
State               : Optimal
Number Of Drives    : 2
Virtual Drive: 1 (Target Id: 1)
State               : Optimal
Number Of Drives    : 1
Virtual Drive: 2 (Target Id: 2)
State               : Optimal
Number Of Drives    : 1
Virtual Drive: 3 (Target Id: 3)
State               : Optimal
Number Of Drives    : 1
Virtual Drive: 4 (Target Id: 4)
State               : Optimal
Number Of Drives    : 1
Virtual Drive: 5 (Target Id: 5)
State               : Optimal
Number Of Drives    : 1
Virtual Drive: 6 (Target Id: 6)
State               : Optimal
Number Of Drives    : 1
Virtual Drive: 7 (Target Id: 7)
State               : Optimal
Number Of Drives    : 1
Virtual Drive: 9 (Target Id: 9)
State               : Optimal
Number Of Drives    : 1
Virtual Drive: 10 (Target Id: 10)
State               : Optimal
Number Of Drives    : 1
Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s