How to Find what HBA is configured on Linux?

Hi

I am working in an environment where there are many redhat physical and virtual machines, mostly Redhat 4. These servers have LUNs attached. The external storage can be EMC, NetApp or Par3.
My question is that when Storage Administrator informs that a new LUN has been presented to a particular Redhat Linux server
(1) how do I know what is the LUN ID.
(2) how do I know what kind of HBA is attached to my server.
(3) how do I scan for new LUNs.

Please guide me I have searching over the net for a while, lastly is there a guide/doc on this, the storage guide from Redhat are not in to much detail.

Thanks and regards

The LUN number is a harder one, but here's what you can do:

You can scan for new luns the following way:

for i in /sys/class/scsi_host/host*
do
echo '- - -' > $i
done

for the type of HBA:

for i in /sys/class/scsi_host/host*
do
cat $i/model_name; cat $i/model_desc; cat $i/
done
1 Like

Here is little info, hope it helps:
(1) how do I know what is the LUN ID.
-> Depands on the driver which you are using.
for example: if using linux native multipathing then "multipath -ll" will show you the Lun & their details.
If using, third party drivers related to SAN:
for example - Rdac/mpp from IBM then u can use mppUtil -a <storage name>, will show u all the details of Luns...

(3) how do I scan for new LUNs.
again if using linux native multipath then run "rescan-scsi-bus.sh" avaialbe from sg3_utils rpm.
If using third party, for example Rdac of IBM: run "mppBusScan" and it will detect the new LUNs.

Hope it helps....

~Titans~

1 Like

actually, you need to add the scan file in this code

for i in /sys/class/scsi_host/host*
do
echo '- - -' > ${i}/scan
done

Without the scan part, you are echoing the --- into the directory and it will not scan the luns.

1 Like

sorry, I had meant to add that. I think my copy/pasta didn't work so well

1 Like