Archive for September, 2006

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:

<Snip>

.

.

</Snip>

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 🙂

RHEL 4 32bit on Tyan Thunder K8QE

Saturday, September 9th, 2006

It’s sort of a relationship between myself and this Tyan. Same server, changing demands. This time, we’ve had to install on this server RHEL4 32bit.

Net-installing RHEL4 Update 3 was impossible. See here, so we’ve installed it from CDs (didn’t have PCI-X network card handy).

When booting the server, it showed us only a single CPU. Since this machine has four dual-core CPUs, this number – one – was rather unexpected.

We’ve tried booting the system with additional parameters. We’ve tried, per RH tips, to allow “apic=bigsmp” parameter, however, when booting the server with these parameters, the server entered into reset loop. We’ve tried playing with other parameters, such as “apic acpi=noirq iommu=memaper=3 swiotlb=65536” (obtained for Google cache for a forum site which I cannot find again now), but for no avail. Finally, we’ve decided to upgrade the kernel to the one in Update4.

Doing so had special effects. When using it without any special parameters, the server entered a reboot loop, however, when we’ve added the parameter “apic=bigsmp” the server booted correcly and showed all eight CPUs.