Posts Tagged ‘qlogic’

Hot adding Qlogic LUNs – the new method

Friday, August 8th, 2008

I have demonstrated how to hot-add LUNs to a Linux system with Qlogic HBA. This has become irrelevant with the newer method, available for RHEL4 Update 3 and above.

The new method is as follow:

echo 1 > /sys/class/fc_host/host<ID>/issue_lip
echo “—” > /sys/class/scsi_host/host<ID>/scan

Replace “<ID>” with your relevant HBA ID.

Notice – due to the blog formatting, the 2nd line might appear incorrect – these are three dashes, and not some Unicode specialy formatted dash.

Hot-Adding SAN lun to Linux (RH with Qlogic drivers)

Monday, September 18th, 2006

cat /proc/scsi/qla2xxx/$Z” where Z represents the SCSI interface the Qlogic has taken for itself, you’ll get something like this:





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

Assuming you’ve just added the next LUN, in our case, LUN1, after reboot you would get an additional line below such as:

( 0: 1): Total reqs 1923, Pending reqs 0, flags 0x2, 0:0:81 00

However, on a production server we want to add this line without a reboot.

To achieve this goal, we need to run the following command:

“echo “scsi-qlascan” > /proc/scsi/qla2xxx/$Z” where $Z represents, like before, the SCSI interface.

Then you get the additional line(s) in the file. Now you should help your Linux see them (and attach a module to them). You can do it by using the following convention (taken from here): Using “dmesg“.

you can obtain the required details for the next stage: Controller, Channel, Target and LUN. Example:

Host: scsi2 Channel: 00 Id: 00 Lun: 01
Vendor: IBM Model: 1742 Rev: 0520
Type: Direct-Access ANSI SCSI revision: 03

Obtain the following details:

Controller=2 (scsi2)

Channel=0 (Channel: 00)

Target=0 (Id: 00)

LUN=1 (Lun: 01)

We will ask Linux nicely to reattach the device. Replace the descriptors with the numeric values

echo “scsi add-single-device Controller Channel Target LUN” > /proc/scsi/scsi”

In our example: “echo “scsi add-single-device 2 0 0 1” > /proc/scsi/scsi

To remove a device prior to unmapping it from the SAN, replace add-single-device with “remove-single-device”.

This post’s Qlogic discovery was the insight of a friend of mine, and the credit is his 🙂

Why I don’t like GRUB – RHEL4 on system with local and external storage

Sunday, July 16th, 2006

Installed RHEL4 on a system with both internal storage (HP SmartAray 5i – cciss) and external disks through Qlogic FCS HBA.

During install, the local disks were detected as /dev/cciss/c0d0 while the external disks were detected as /dev/sda and /dev/sdb

After installation was done, Grub started with incorrect mapping. For no apparent reason, Grub searched for its stage2 and date in /dev/sda1 and not in /dev/cciss/c0d0p1.

The quickest way for me to solve it was to replace grub with Lilo (available on the fourth RHEL CD), correct /etc/lilo.conf.anaconda, copy this file to /etc/lilo.conf and run Lilo (with "-v" flag, for safety). It worked like a charm.

Linux, Storage, SANs and stuff. Part one of many

Tuesday, September 13th, 2005

As part of my job, as an Infrastructure and Mr. Fix-it in my company, where it comes to Unix, Windows, HA-Clusters, Storages, etc, I often get to encounter some unpredictable situations.

During the last two days I’ve had to setup a Compaq Proliant ML360G2 with the following configuration (to simulate customer’s environment):


Update level 4

Specific Kernel version

Dual-port Qlogic FC HBA, with multipath access to a SAN storage.

Not that I’ve looked it up too much, as most of it is rather straight forward procedure, I’ve decided I will share in this blog my experience, and some comments regarding this. To make life easier for future attempts, etc.

Stages went like this:

1) Entered into the BIOS, and configured the machine to be a Linux machine.

2) Installed RHES AS 3, release 0. That’s what I had, and I didn’t feel like wasting time and downloading the newer release.

3) Installed the required Kernel and Kernel-Sources packages (RPMs).

4) Installed Proliant ServicePack (PSP). Version 7.11. It’s what I’ve had, and although at the time of this writing, I am aware a newer version exists (7.50, or 7.40), I did not have time to download and install it.
I’ve discovered that during its install, it managed, somehow, to corrupt my RPM DB. Anyhow, it has installed what it had to install.

5) Deleted /var/lib/rpm/__* , and initiated rpm –rebuilddb to fix the RPM DB corruption. Tested with rpm -qa with no segfault on its way.

6) Physically installed the Dual-Port Qlogic HBA. QLA2342 is the model.

7) Downloaded both the driver and the SANSurfer control and management utility.

8) Physically connected the HBAs to the Fibre Switch (defined VSANs, defined the storage – FastT200, dual ported), and managed to view the whole storage.

9) During the installation of the Qlogic driver (./qlinstall) I’ve detected it failed to compile because I lacked the file called modversions.h inside include inside the kernel source tree. The file was supposed to be there, but for some reason, wasn’t. I’ve reinstalled kernel-sources (the correct version, of course), and was able to complete the installation.

10) A new initrd was supposed to be
built by the installation process of the Qlogic driver. For some reason, the file was corrupted, and I’ve had to reboot into another version of the kernel, and rebuild the initrd.

11) The SANSurfer was a great fun, but it refused to define Multi-Path. Well, it actually claimed to have done it, but it didn’t work, and the system detected twice as volumes as it actually had. I’ve changed the file /etc/modules.conf to contain a directive for the driver named "ql2xfailover=1", rebuilt initrd, and rebooted. Not tested yet, but seems to work, so I will test it tomorrow.

I have to understand whether the utilization of the Multi-Path system was done using Qlogic driver, or was it done using any other in-kernel system. I’m not sure yet as to what is Linux MPT, and whether it’s MultiPath, and I would have to use it. I will check it during the coming day. Meanwhile, we’ll just have to do with

Update to come.