DevOps

Sunday, 27 October 2013

How To Add New Disk To The Hardware Raid Controller Without Rebooting The Server In Linux


First find out your RAID hardware as we will need appropriate OS utility to manage the samefrom the same vendor. In our case it was lsi which can be managed via Megacli utility.
[root@server 8.02.21_Linux_MegaCLI]# lspci | grep -i raid
07:00.0 RAID bus controller: LSI Logic / Symbios Logic MegaRAID SAS 2108 [Liberator] (rev 05)
Lets first install the utilty :To do this we need to install the Megacli utility on our server Centos 6.2.

Step:1. Install the below two packages.(downlaod from http://www.lsi.com/downloads/Public/MegaRAID%20Common%20Files/8.02.21_MegaCLI.zip) .

#rpm -ivh Lib_Utils-1.00-09.noarch.rpm
#rpm -ivh MegaCli-8.02.21-1.noarch.rpm

Step:2. By default the utility is placed at location as below..

[root@server 8.02.21_Linux_MegaCLI]# cd /opt/MegaRAID/MegaCli/
[root@server MegaCli]# lsinstall.log MegaCli64 MegaSAS.log

Step:3. Run the below command before adding the brand new disk drive.[root@server MegaCli]# /opt/MegaRAID/MegaCli/MegaCli64 -PDList -aAll | grep -e “Enclosure Device ID” -e SlotEnclosure Device ID: 252Slot Number: 0Enclosure Device ID: 252Slot Number: 1

Step:4. Run the command again after injecting the new HDD in drive slot.[root@server MegaCli]# /opt/MegaRAID/MegaCli/MegaCli64 -PDList -aAll | grep -e “Enclosure Device ID” -e SlotEnclosure Device ID: 252Slot Number: 0Enclosure Device ID: 252Slot Number: 1Enclosure Device ID: 252Slot Number: 3

Step:5. Now you have the following information the Enclosure Device ID: 252 and Slot Number: 3 for the newly added drive.

 Step:6. Once added the new drive will be in foreign state. Give the below command to clear the foreign status.[root@server MegaCli]#/opt/MegaRAID/MegaCli/MegaCli64 -CfgForeign -Clear -aALL

Step:7. Add the new drive to the desired RAID level by running below command.#/opt/MegaRAID/MegaCli/MegaCli64 -CfgLdAdd -r0 [252:3] -a0Options:-r1 = RAID1252 = Enclosure Device ID2 and 3 = Slot Number-a0 = AdapterIn our case :-r0 = RAID0252 = Enclosure Device ID3 = Slot Number-a0 = Adapter

Step:8. tail the /var/log/messages for the new disksd 0:2:1:0: [sdb] Mode Sense: 1f 00 00 08sd 0:2:1:0: [sdb] Write cache: enabled, read cache: enabled, doesn’t support DPO or FUAsdb: sdb1 sdb2sd 0:2:1:0: [sdb] Attached SCSI disk

Now you can use the new disk as any other normal drive.

No comments:

Post a Comment