Archive for the ‘Scan Disk’ Category


Script : scandisk.sh

#!/bin/bash

echo -e ” \nScan and Detect newly connected SCSI LUN\n”

host=`ls -l /sys/class/scsi_host/ | grep -v total | awk ‘{print $9}’ | awk -F “host” ‘{print $2}’`

for i in $host

do

echo “Rescaning scsi host /sys/class/scsi_host/host$i”

echo “- – -” > /sys/class/scsi_host/host$i/scan

done

echo -e “\n All the SCSI LUN scanned Successfully‚Ķ..\n”

 

Output : 

[root@autel ~]# ./scandisk.sh

Scan and Detect newly connected SCSI LUN

Rescaning scsi host /sys/class/scsi_host/host0
Rescaning scsi host /sys/class/scsi_host/host1
Rescaning scsi host /sys/class/scsi_host/host2

All the SCSI LUN scanned Successfully…..

[root@autel ~]#