ProLiant Servers (ML,DL,SL)
cancel
Showing results for 
Search instead for 
Did you mean: 

Rescan FC disks w/o reboot (Linux, BL20p G2, qla2300 )

Morten Lange
Occasional Advisor

Rescan FC disks w/o reboot (Linux, BL20p G2, qla2300 )

Hi

I run some BL20p boxes with qlogic fibrechannel hostbus adapters (HBAs ), and they seem to work well, except I can't find a way to find new
devices without rebooting. I've tried the trick about poking into proc, but to no avail :
echo "scsi add-single-device 0 1 2 3" >/proc/scsi/scsi
with the numbers replaced accordingly. ( host, channel Id, lun)

This does work in the same FC-environment (XP256/XP1024 diskarrays, FCAL) on an cpqfc HBA , but qla2300 refuses to see anything new until after a reboot. ( rmmod and modprobe
might have done the trick also, but at the moment I don´t have the opurtunity to run it as a module, and besides I would then have to umount other disks on the diskarray first, taking down services depending on it )

I´ll gladly provide more info, if that can help.

Best Regards,
Morten

~~~~~~~~~~
"Attachments:" Some dumps from the /proc hierarchy. Lun 02 only appeared after reboot.

[root@orappt init.d]# cat /proc/scsi/scsi
Attached devices:
Host: scsi0 Channel: 00 Id: 00 Lun: 00
Vendor: HP Model: OPEN-E-CVS Rev: 2103
Type: Direct-Access ANSI SCSI revision: 02
Host: scsi0 Channel: 00 Id: 00 Lun: 01
Vendor: HP Model: OPEN-E*5 Rev: 2103
Type: Direct-Access ANSI SCSI revision: 02
Host: scsi0 Channel: 00 Id: 00 Lun: 02
Vendor: HP Model: OPEN-E*3 Rev: 2103
Type: Direct-Access ANSI SCSI revision: 02
[root@orappt init.d]#


# cat /proc/scsi/qla2300/0
QLogic PCI to Fibre Channel Host Adapter for ISP23xx:
Firmware version: 3.01.18, Driver version 6.04.01
Entry address = f8836060
HBA: QLA2312 , Serial# L26949
(
Its a _N_Iceland
4 REPLIES
Jeff Allen_5
Valued Contributor

Re: Rescan FC disks w/o reboot (Linux, BL20p G2, qla2300 )

# more /proc/scsi/qla2300/n - where n can be 0 or 1


That should do the trick.
Bob_Vance
Esteemed Contributor

Re: Rescan FC disks w/o reboot (Linux, BL20p G2, qla2300 )

Did you ever resolve this?

You need to make the driver re-scan the bus.
Each driver has his own way:

Create new lun
Get Qlogic instance
... ## find /proc/scsi/ql* -name '[0-9]'
........ /proc/scsi/qla2300/2
List LUNs
... ## cat /proc/scsi/qla2300/2
........ <>
Register the new device name with OS
... ## echo scsi add-single-device INST 0 TARGET LUN > /proc/scsi/scsi
........ (where
........ INST= instance number, not full /proc name
........ 0 is the bus# -- generally 0
........ TARGET is from the LUN list
........ LUN is the new LUN number
........ )
List the current LUNs
... ## cat /proc/scsi/qla2300/2
........ <>


Continue with partition creation.


HP provides a command for Qlogic adapters:
.... /opt/hp/hp_fibreutils/hp_rescan
which will re-scan everything, but as part of its operation, it removes all current LUNs and then re-adds them (from Linux' perspective not on the array).
I don't like that.


hth
bv
"The lyf so short, the craft so long to lerne." - Chaucer
Bob_Vance
Esteemed Contributor

Re: Rescan FC disks w/o reboot (Linux, BL20p G2, qla2300 )

Well, that was pretty worthless!
I left out the most important step!!

Should have been:


You need to make the driver re-scan the bus.
Each driver has his own way:

Create new lun
Get Qlogic instance
... ## find /proc/scsi/ql* -name '[0-9]'
........ /proc/scsi/qla2300/2
List current LUNs
... ## cat /proc/scsi/qla2300/2
........ <>

Test next available device name (should fail)
... ## dd if=/dev/sdX of=/tmp/l1 count=100
........ dd: opening `/dev/sdX': No such device or address

Now, here's the first trick:
Force a Qlogic rescan of that instance
(the string that you echo varies from driver to driver and this only works for Qlogic):
... ## echo scsi-qlascan > /proc/scsi/qla2300/2

List the current LUNs
... ## cat /proc/scsi/qla2300/2
........ <>

This is the second trick.
Register the new device name with OS
... ## echo scsi add-single-device INST 0 TARGET LUN > /proc/scsi/scsi
........ (where
........ INST= instance number, not full /proc name
........ 0 is the bus# -- generally 0
........ TARGET is from the LUN list
........ LUN is the new LUN number
........ )
List the current LUNs
... ## cat /proc/scsi/qla2300/2
........ <>

Now test new device name (should work)
... ## dd if=/dev/sdX of=/tmp/l1 count=100
........ 100+0 records in
........ 100+0 records out


Continue with partition creation.


HP provides a command for Qlogic adapters:
.... /opt/hp/hp_fibreutils/hp_rescan
which will re-scan everything, but as part of its operation, it removes all current LUNs and then re-adds them (from Linux' perspective not on the array).
I don't like that.


hth
bv
"The lyf so short, the craft so long to lerne." - Chaucer
Coert Waagmeester
Occasional Visitor

Re: Rescan FC disks w/o reboot (Linux, BL20p G2, qla2300 )

hi there!

this worked for me on RHEL 4.4
but how do I make this permanent?