Adding a Fibre Channel disk to a Debian Linux server.

Posted by – Sunday 2012-04-29

Spanish economy is not doing well; actually, it is sinking. Budgets are shrinking and therefore in many organizations reusing old computers has become mandatory for IT staffs.

Giving old computers a new life may raise some curious problems. At my work place we decided to reuse a HP Proliant server which was bought circa year 2005. It has a four-core Itanium processor and a decent amount of RAM memory, making it suitable for a task like serving web pages dynamically generated. The problem is its small storage capacity by today’s standards: only two hard disks, each one having 36 GB of storage.

QLogic Fibre Channel

Fortunately, the server has two HP QLogic ISP2312 Fibre Channel adapters. Thus storage shortage can be solved without buying additional hard disks (assuming they are available for sale). Instead, the needed storage is added via Fibre Channel (FC).

$ lspci -vmm

...

Slot:	40:01.0
Class:	Fibre Channel
Vendor:	QLogic Corp.
Device:	ISP2312-based 2Gb Fibre Channel to PCI-X HBA
SVendor:	Hewlett-Packard Company
SDevice:	2Gb Fibre Channel - Dual port [A6826A]
Rev:	03

Slot:	40:01.1
Class:	Fibre Channel
Vendor:	QLogic Corp.
Device:	ISP2312-based 2Gb Fibre Channel to PCI-X HBA
SVendor:	Hewlett-Packard Company
SDevice:	2Gb Fibre Channel - Dual port [A6826A]
Rev:	03

A Linux Debian 6 operating system was installed on the server. Given our FC adapter’s propietary firmware, the non-free package ‘firmware-qlogic (0.28+squeeze1)‘ had to be installed.

$ wget http://ftp.es.debian.org/debian/pool/non-free/f/firmware-nonfree/firmware-qlogic_0.28+squeeze1_all.deb
--2012-04-18 19:29:31--  http://ftp.es.debian.org/debian/pool/non-free/f/firmware-nonfree/firmware-qlogic_0.28+squeeze1_all.deb
Resolving ftp.es.debian.org... 82.194.78.250
Connecting to ftp.es.debian.org|82.194.78.250|:80... connected.
HTTP request sent, awaiting response... 200 OK
Length: 478982 (468K) [application/x-debian-package]
Saving to: `firmware-qlogic_0.28+squeeze1_all.deb'

100%[=== ... ===>] 478,982     --.-K/s   in 0.1s    

2012-04-18 19:29:31 (3.06 MB/s) - `firmware-qlogic_0.28+squeeze1_all.deb' saved [478982/478982]

$ sudo dpkg --install ./firmware-qlogic_0.28+squeeze1_all.deb 
Selecting previously deselected package firmware-qlogic.
(Reading database ... 26530 files and directories currently installed.)
Unpacking firmware-qlogic (from firmware-qlogic_0.28+squeeze1_all.deb) ...
Setting up firmware-qlogic (0.28+squeeze1) ...
update-initramfs: deferring update (trigger activated)
Processing triggers for initramfs-tools ...
update-initramfs: Generating /boot/initrd.img-2.6.32-5-mckinley
W: Possible missing firmware /lib/firmware/tigon/tg3_tso5.bin for module tg3
W: Possible missing firmware /lib/firmware/tigon/tg3_tso.bin for module tg3
W: Possible missing firmware /lib/firmware/tigon/tg3.bin for module tg3
W: Possible missing firmware /lib/firmware/ql8100_fw.bin for module qla2xxx
ln: creating symbolic link `/tmp/mkinitramfs_3nScMA/bin/sh': File exists
Loaded efivars kernel module to enable use of efibootmgr
elilo: Warning: /vmlinuz.old not found
elilo: Warning: /initrd.img.old not found

After installing the package, we take a look at the log file /var/log/kern.log to check whether the module qla2xxx has been loaded and is working [note 1].

$ sudo grep qla2xxx /var/log/kern.log
... kernel: [   10.789622] scsi1 : qla2xxx
... kernel: [   10.789978] qla2xxx 0000:40:01.1: 
... kernel: [   12.210848] qla2xxx 0000:40:01.1: LOOP UP detected (2 Gbps).
... kernel: [   32.693669] qla2xxx 0000:40:01.0: Cable is unplugged...
... kernel: [   10.179942] qla2xxx 0000:40:01.0: PCI INT A -> GSI 38 (level, low) -> IRQ 54
... kernel: [   10.180061] qla2xxx 0000:40:01.0: Found an ISP2312, irq 54, iobase 0xc0000000a0041000
... kernel: [   10.180302] qla2xxx 0000:40:01.0: Configuring PCI space...
... kernel: [   10.181296] qla2xxx 0000:40:01.0: Configure NVRAM parameters...
... kernel: [   10.274871] qla2xxx 0000:40:01.0: Verifying loaded RISC code...
... kernel: [   10.292828] qla2xxx 0000:40:01.0: firmware: requesting ql2300_fw.bin
... kernel: [   10.392845] qla2xxx 0000:40:01.0: Allocated (412 KB) for firmware dump...
... kernel: [   10.536872] scsi0 : qla2xxx
... kernel: [   10.537337] qla2xxx 0000:40:01.0: 
... kernel: [   10.537928] qla2xxx 0000:40:01.1: PCI INT B -> GSI 39 (level, low) -> IRQ 56
... kernel: [   10.538059] qla2xxx 0000:40:01.1: Found an ISP2312, irq 56, iobase 0xc0000000a0040000
... kernel: [   10.538296] qla2xxx 0000:40:01.1: Configuring PCI space...
... kernel: [   10.539285] qla2xxx 0000:40:01.1: Configure NVRAM parameters...
... kernel: [   10.632935] qla2xxx 0000:40:01.1: Verifying loaded RISC code...
... kernel: [   10.742012] qla2xxx 0000:40:01.1: Allocated (412 KB) for firmware dump...
... kernel: [   10.789978] qla2xxx 0000:40:01.1: LIP reset occurred (f7f7).

After that, we execute the command rescan-scsi-bus.sh (package scsitools) to add the new FC devices:

$ sudo /sbin/rescan-scsi-bus.sh 

...

Host adapter 7 (qla2xxx) found.
Scanning SCSI subsystem for new devices

...

Scanning host 7 for  all SCSI target IDs, all LUNs
Scanning for device 7 0 0 0 ...
NEW: Host: scsi7 Channel: 00 Id: 00 Lun: 00
      Vendor: COMPAQ   Model: MSA1000          Rev: 4.32
      Type:   RAID                             ANSI SCSI revision: 04
Scanning for device 7 0 0 4 ...
NEW: Host: scsi7 Channel: 00 Id: 00 Lun: 04
      Vendor: COMPAQ   Model: MSA1000 VOLUME   Rev: 4.32
      Type:   Direct-Access                    ANSI SCSI revision: 04
Scanning for device 7 0 0 7 ...
NEW: Host: scsi7 Channel: 00 Id: 00 Lun: 07
      Vendor: COMPAQ   Model: MSA1000 VOLUME   Rev: 4.32
      Type:   Direct-Access                    ANSI SCSI revision: 04
3 new device(s) found.               
0 device(s) removed.

By using the command lsscsi (package lsscsi) we can find out the letter assigned to the new disk:

$ sudo lsscsi

...

[1:0:0:0]    storage COMPAQ   MSA1000          4.32  -       
[1:0:0:4]    disk    COMPAQ   MSA1000 VOLUME   4.32  /dev/sdc
[1:0:0:7]    disk    COMPAQ   MSA1000 VOLUME   4.32  /dev/sdd

Unfortunately the needed file system node was not created, so we manually create one. The needed major and minor device node numbers can be found at /proc/partitions:

$ sudo cat /proc/partitions
major minor  #blocks  name

...

   8       48  225277200 sdd
   8       49  225271431 sdd1

$ sudo mknod /dev/sdd1 b 8 49

Now we are ready to use the partition, that is, mounting it and creating the filesystem.


notes

[note 1] Because of the two available FC adapters was not used there is a message warning of an unplugged cable.

1 Comment on Adding a Fibre Channel disk to a Debian Linux server.

Respond

  1. Jeffrey says:

    I also got the disk in lsscsi but how do I create a filesystem on it? fdisk does not work on it ?

  2. Smithe130 says:

    I just ought to tell you which you have written an exceptional and distinctive post that I really enjoyed reading. Im fascinated by how nicely you laid out your material and presented your views. Thank you.

Respond

Comments

Comments