This project provides a way to access drives exposed from a LSI/Avago/Broadcom
MegaRAID storage adapter using the same terminology used by those adapters
(i.e., controller, enclosures, slots, virtual drives, etc). Symlinks are added
under /dev/megaraid
that point to the actual OS devices.
- Python3 (tested with Python 3.11)
- StorCli tool -- Latest version can be found at Broadcom's web site:
- Visit https://www.broadcom.com/support/download-search (or click "Support and Services" -> "Document, Downloads and Support" -> "Support Documents and Downloads")
- In the search form, do this:
- Check the Include Legacy Products checkbox
- Under Product Group, select Storage Adapters, Controllers, and ICs
- Under Product Family, select Host Bus Adapters
- Under Product Name, type storcli
- Leave Asset Type empty
- Click Search
- Look for Management Software and Tools node and expand it
- Under that node, look for the most recent StorCli download available for
your adapter
- For SAS 3.5 adapters (SAS31xx-based, e.g.: 9361-8i), as of Sep/2024, the
latest StorCli available is the Phase32 release (
STORCLI_SAS3.5_P32.zip
), version 007.3103.0000.0000. Direct link here.
- For SAS 3.5 adapters (SAS31xx-based, e.g.: 9361-8i), as of Sep/2024, the
latest StorCli available is the Phase32 release (
- Download the zip file, extract it and follow the instructions. For
Debian-based systems install the
.deb
package found under the Ubuntu folder.
Note: newer adapters use a newer StorCli2 tool which hasn't been tested.
- Ensure udev is installed and running on your system (it should be as it's pretty common)
- Copy the contents of the
/etc
directory to your device - Ensure
/etc/udev/megaraid_id
script is executable
sudo chmod 755 /etc/udev/megaraid_id
- Trigger udev to read the new rules
sudo udevadm trigger
In this example, there's only a single drive set as JBOD attached to controller 0:
root@host:~# /opt/MegaRAID/storcli/storcli64 /c0 /eall /sall show jbod
[...]
------------------------------------------------------------------------------------------
EID:Slt DID State Intf Med Size SeSz Model Vendor Port
------------------------------------------------------------------------------------------
252:4 23 JBOD SATA SSD 931.512 GB 512B Samsung SSD 860 EVO 1TB ATA Port 4 - 7 x1
------------------------------------------------------------------------------------------
[...]
root@host:~# ls -l /dev/megaraid/c0/e252
total 0
lrwxrwxrwx 1 root root 12 Sep 30 11:39 s4 -> ../../../sdb
In the example below, there are 3 virtual drives attached to controller 0:
[...]
------------------------------------------------------------------------
DG/VD TYPE State Access Consist Cache Cac sCC Size Name
------------------------------------------------------------------------
1/0 RAID1 Optl RW Yes RWBD - ON 931.000 GB VM Store
2/1 RAID1 Optl RW Yes RWBD - ON 931.000 GB Backup
0/2 RAID1 Optl RW Yes RWBD - ON 1.818 TB New VM Store
------------------------------------------------------------------------
[...]
root@host:~# ls -l /dev/megaraid/c0
total 0
drwxr-xr-x 2 root root 60 Sep 30 11:39 e252
lrwxrwxrwx 1 root root 9 Sep 30 11:39 v0 -> ../../sda
lrwxrwxrwx 1 root root 9 Sep 30 11:39 v1 -> ../../sdc
lrwxrwxrwx 1 root root 9 Sep 30 11:39 v2 -> ../../sdd