Wednesday, January 6, 2016

Using attached LUNs in the server


1. Gathering information for the FC card/HBA card:

A). Getting details:
1. To Get WWN of HBA card:
# systool –c fc_host –v
Or
# systool –c fc_transport –v
OR
For Qlogic HBA:
# cat /sys/class/fc_host/hostX/port_name

In older version like RHEL 4:
# cat /proc/scsi/qlx2xx/0
Or
# egrep [node|port] /proc/scsi/qlx2xx/0

2. HBA BIOS and driver version,
hbsvsdrdb kernel: qla2xxx [0000:00:00.0]-0005: : QLogic Fibre Channel HBA Driver: 8.04.00.11.39.0-k.
kernel: qla2xxx [0000:1b:00.0]-00fc:1: ISP2532: PCIe (5.0GT/s x4) @ 0000:1b:00.0 hdma+ host#=1 fw=5.08.00 (90d5).

3. Make model of HBA
[root@test]# lspci |grep -i -e fib -e hba
1b:00.0 Fibre Channel: QLogic Corp. ISP2532-based 8Gb Fibre Channel to PCI Express HBA (rev 02)
1b:00.1 Fibre Channel: QLogic Corp. ISP2532-based 8Gb Fibre Channel to PCI Express HBA (rev 02)
20:00.0 Fibre Channel: QLogic Corp. ISP2532-based 8Gb Fibre Channel to PCI Express HBA (rev 02)
20:00.1 Fibre Channel: QLogic Corp. ISP2532-based 8Gb Fibre Channel to PCI Express HBA (rev 02)


B). Detecting/scanning the attaching LUNs:

If FC exists, then do this:
# echo “1” > /sys/class/fc_host/hsotX/issue_lip

If SCSI exists, then do this:
# echo “- - -“ > /sys/class/scsi_host/hsotX/scan

Now you can see newly attached LUNs using fdisk command
# fdisk –l

C). Configuration:

Reload multipathd service
# service multipathd reload

Now multipath device can be seen by multipath –ll command
# multipath –ll

D). Start using the LUNs:

Now you can create Physical Volume of newly created multipath device
# pvcreate /dev/mapper/mpathX
# vgcreate datavg /dev/mapper/mpathX
# lvcreate –L 100G –n datalv datavg

Create filesystem on LV
# mkfs.ext3 –m 0 /dev/datavg/datalv

Mount filesystem
# mkdir –p /data
# mount /dev/datavg/datalv /data

Edit /etc/fstab file and add new mount.
# vi /etc/fstab

Add below lines
/dev/datavg/datalv /data ext32 default 0 0

No comments:

Post a Comment