Friday, 16 September 2011

Redhat Linux – How to dynamically add LUN’s to Qlogic HBA


Redhat Linux – How to dynamically add LUN’s to Qlogic HBA


Dynamically adding LUN’s to Qlogic HBA on Linux:

1. Make sure that newly configured LUN’s are properly configured and mapped to correct HBA’s

2. If you have installed SANsurfer GUI/CLI, make sure newly added LUN’s are visible from these tools


3. For each QLogic HBA installed in the system, do the following:

a) Determine the host ID (H) associated with the HBA. Each installed HBA has a numeric filename that is the host identifier.

# /bin/ls /proc/scsi/qla2300

b) Rescan for all the LUNs on all the ports.
H is the host identifier associated with HBA.

# /bin/echo scsi-qlascan > /proc/scsi/qla2300/H

c) Determine the target ID (T) associated with the new LUN.
This file lists the ID:LUN numbers recognized by the QLA driver. T is the
target ID value.

# /bin/cat /proc/scsi/qla2300/H

d) Add the LUN to HBA.
H is the host identifier associated with the HBA;
T is the target identifier obtained in Step c; and L is the LUN identifier.

# /bin/echo scsi add-single-device H 0 T L > /proc/scsi/scsi

4. Use the command “/sbin/fdisk -l” to verify if the newly added LUN is visible to the OS



5. Partition the disk attached from new lun ( procedure )

Find below example illustrating addition of a newly mapped T4 LUN on Red Hat Linux using QLA driver version 7.07.04

1) Determine host ID

# /bin/ls /proc/scsi/qla2300/2

2) Re-scan for LUN’s on both HBA’s

# /bin/echo scsi-qlascan > /proc/scsi/qla2300/2

3) Verify newly mapped LUN’s

# /bin/cat /proc/scsi/qla2300/2
QLogic PCI to Fibre Channel Host Adapter for QLA2342:
Firmware version: 3.03.19, Driver version 7.07.04
Entry address = f88ae060
HBA: QLA2312 , Serial# F05179
Request Queue = 0x377e0000, Response Queue = 0x377d0000
Request Queue count= 512, Response Queue count= 512
Total number of active commands = 0
Total number of interrupts = 35
Total number of active IP commands = 0
Total number of IOCBs (used/max) = (0/600)
Total number of queued commands = 0
Device queue depth = 0×20
Number of free request entries = 510
Number of mailbox timeouts = 0
Number of ISP aborts = 0
Number of loop resyncs = 2
Number of retries for empty slots = 0
Number of reqs in pending_q= 0, retry_q= 0, done_q= 0, scsi_retry_q= 0
Host adapter:loop state= <READY>, flags= 0×820813
Dpc flags = 0×0
MBX flags = 0×0
SRB Free Count = 4096
Link down Timeout = 000
Port down retry = 030
Login retry count = 030
Commands retried with dropped frame(s) = 0
Configured characteristic impedence: 50 ohms
Configured data rate: 1-2 Gb/sec auto-negotiate
SCSI Device Information:
scsi-qla0-adapter-node=200100e08b275bb5;
scsi-qla0-adapter-port=210100e08b275bb5;
scsi-qla0-target-0=20030003ba27cfa2;

SCSI LUN Information:
(Id:Lun) * – indicates lun is not registered with the OS.
( 0: 0): Total reqs 1, Pending reqs 0, flags 0×0*, 0:0:81,
( 0:15): Total reqs 0, Pending reqs 0, flags 0×0*, 0:0:81,

Note “*” in the above outputs, which indicates LUN as not registered
with OS, hence not visible to OS.



4) Register the new LUN’s with OS

# /bin/echo scsi add-single-device 2 0 0 15 > /proc/scsi/scsi

5) verify from OS using “fdisk -l”

# /sbin/fdisk -l

Disk /dev/sda: 36.4 GB, 36420075008 bytes
255 heads, 63 sectors/track, 4427 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes

Device Boot Start End Blocks Id System
/dev/sda1 * 1 13 104391 83 Linux
/dev/sda2 14 4173 33415200 83 Linux
/dev/sda3 4174 4427 2040255 82 Linux swap

Disk /dev/sdb: 5372 MB, 5372116992 bytes
255 heads, 63 sectors/track, 653 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes

Device Boot Start End Blocks Id System
/dev/sdb1 1 653 5245191 83 Linux

In the above output ‘sdb’ is the new LUN, which was partitioned earlier.

No comments:

Post a Comment

Twitter Bird Gadget