Linux Scroll

Just another WordPress.com site

Category Archives: suse

Rescan new SCSI bus in linux

To detect new SCSI disk/dev in linux:

# echo "- - -" > /sys/class/scsi_host//scan

# fdisk -l

To detect new SCSI fibre channel disk/LUN in linux:

# echo "1" > /sys/class/fc_host/host#/issue_lip

Script similar to hp_rescan:

#!/bin/bash

# $Id: rescan_hba.sh 48 2008-03-11 12:37:48Z ajo $

# This script will rescan all found FC HBAs for (new) LUNs
# Beware that it will generate failover events (in multipathd for
# instance)

if [ -f /usr/sbin/hp_rescan ]
then
echo "hp_rescan found - use that instead"
exit 0
fi


for host in $(ls -d /sys/class/fc_host/host*)
do
echo "Rescanning $host"
echo 1 > /sys/class/fc_host/$host/issue_lip
sleep 5
echo "- - -" > /sys/class/scsi_host/$host/scan
done
Advertisements