Friday, November 29, 2013

CLARiiON Disk reference removal online (using Script) on RHEL5 & 6



List the CLARiiON Disk on Server                                                                             

Logon to Server (the below steps are applicable for RHEL 5 Version)
Check the CLARiiON disks
Check for lsscsi command (if command not installed please install the lsscsi command utility using)
sudo yum install lsscsi
sudo lsscsi | grep DGC
Save the Disk name in a file devremove
sudo sh –c “lsscsi  | grep DGC | awk -F " " '{ print $7 }' > /var/tmp/devremove”

Flush outstanding I/O and remove the CLARiiON Disk’s reference                       

1. If FS is mounted please umount the relavent FS
2. If disk are under logical volume please remove and follow 5 th step.
3. Check the multipath –l output and check the CLARiiON disks are controlled by Multipath
4. If multipath is configured please stop the multipath and remove the CLARiiON disks
5. Flush any outstanding I/O to all paths to the device and Remove any reference to the device's path-based name using the following script
cd /var/tmp
Copy the below script to devscript file
vim devscript
#/bin/bash
for i in `cat devremove`
do
/sbin/blockdev --flushbufs $i
rm -r $i
done
Save the file and run the script for Flush any outstanding I/O to all paths to the device and Remove any reference to the device's path-based name using the following script
sudo sh devscript

Finally, remove each path to the device from the SCSI subsystem            

Finally, remove each path to the device from the SCSI subsystem using following script
Grep for the device names (only like sda, sdb…) and save it to devremove.1
cat devremove | awk -F "/" '{ print $3 }' > /var/tmp/devremove.1
Copy the below script and run
vim devscript.1
#/bin/bash
for i in `cat devremove.1`
do
sh -c "echo 1> /sys/block/$i/device/delete"
done
Save it and run the command.
Sudo sh devscript.1.

Verify all CLARiiON Disks are removed from the system          

Run the lsscsi command and grep for DGC disks (CLARiiON Disks)
sudo lsscsi | grep DGC
sudo /sbin/inq.linux
sudo /usr/sbin/pvs

Start the multipath if stopped. Inform the Storage team for removal of CLARiiON Disks

No comments: