Linux

Adding a new SSD to already Mega LSI RAID controller

I had asked Hetzner for the installation of an extra SSD(‘960 GB SATA SSD Datacenter Edition’) to an already existing RAID 1 array which is where the system is installed in a dedicated Linux server.

All I want is to be able to access the drive separately from the already existing RAID drives.
I got the instruction on how to install megacli and I did so.
https://community.hetzner.com/tutorials/lsi-raid-controller?title=LSI_RAID_Controller/en

But I was confused as to how to create a new virtual drive made of only the newly installed SSD without disturbing the already existing RAID drives which would be catastrophic. It was written in other sites that the megacli is a bit complex to use.

After doing some reading I understood that I need to create a new Virtual disk (RAID 0 array) composed of only the physical SSD.
In order to do that I need to know the Enclosure ID and Slot Number of the SSD.
Here is the output of the following command to get that:

megacli -PDlist -a0 | grep -e '^Enclosure Device ID:' -e '^Slot Number:'

Result:
Enclosure Device ID: 252
Slot Number: 0
Enclosure Device ID: 252
Slot Number: 1
Enclosure Device ID: 252 (the SSD)
Slot Number: 2

So here is the command for building a new RAID 0 virtual drive using the
Enclosure Device ID: 252 Slot Number: 2:

megacli -CfgLdAdd -r0 [252:2] -a0

Result:
Adapter 0: Created VD 1
Adapter 0: Configured the Adapter!!
Exit Code: 0x00

Now to see if the new virtual drive is visible from the system:

fdisk -l

Result:
(Among the already existing drives here the new SSD drive)
.........
Disk /dev/sdb: 893.8 GiB, 959656755200 bytes, 1874329600 sectors
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 4096 bytes
I/O size (minimum/optimal): 4096 bytes / 4096 bytes
.........

Bingo!!

Leave a Reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.