Howto SAN on HP-UX


After create LUN on external storage, we want to connect server through fiber channel to SAN Switch.
First we should plugged FC HBA card to server. View HBA version. Ex: AB379B.
We need to check depot Fiber Channel that contain HBA's driver.
# swlist | grep FibrChanl-01
FibrChanl-01 B.11.11.10 FibreChannel;HW=A6826A,A9782A,A9784A,AB378A/B,AB379A/B,AB465A,AD193A,AD194A

If we don't have any depot installed, we should download depot from HP site.
After this we install that depot.
# swinstall -s /tmp/FibrChanl-01_B.11.11.12_HP-UX_B.11.11_64.depot

Before we plugged the HBA card we should make sure we have it's driver.
After we install driver, it's safe to shutdown server and plugged HBA card.

After start the system, show the system hardware and all list disk device class.
# ioscan -nfCdisk
Class I H/W Path Driver S/W State H/W Type Description
==========================================================================
disk 6 0/2/1/0.1.0.0.0.0.1 sdisk CLAIMED DEVICE HP HSV300
/dev/dsk/c10t0d1 /dev/rdsk/c10t0d1
disk 5 0/2/1/0.1.1.0.0.0.1 sdisk CLAIMED DEVICE HP HSV300
/dev/dsk/c12t0d1 /dev/rdsk/c12t0d1
disk 3 0/3/1/0.2.0.0.0.0.1 sdisk CLAIMED DEVICE HP HSV300
/dev/dsk/c14t0d1 /dev/rdsk/c14t0d1
disk 4 0/3/1/0.2.1.0.0.0.1 sdisk CLAIMED DEVICE HP HSV300
/dev/dsk/c16t0d1 /dev/rdsk/c16t0d1

# diskinfo -b /dev/rdsk/c10t0d1
SCSI describe of /dev/rdsk/c10t0d1:
vendor: HP
product id: HSV300
type: direct access
size: 1027604480 Kbytes
bytes per sector: 512

# diskinfo -b /dev/rdsk/c12t0d1
SCSI describe of /dev/rdsk/c12t0d1:
vendor: HP
product id: HSV300
type: direct access
size: 1027604480 Kbytes
bytes per sector: 512

# diskinfo -b /dev/rdsk/c14t0d1
SCSI describe of /dev/rdsk/c14t0d1:
vendor: HP
product id: HSV300
type: direct access
size: 1027604480 Kbytes
bytes per sector: 512

# diskinfo -b /dev/rdsk/c16t0d1
SCSI describe of /dev/rdsk/c16t0d1:
vendor: HP
product id: HSV300
type: direct access
size: 1027604480 Kbytes
bytes per sector: 512

From our config, we found 4 path through same LUN.
So we only need to create physical volume only on one disk.
# pvcreate -f /dev/rdsk/c10t0d1

Create vgdata partition
# mkdir /dev/vgdata
# mknod /dev/vgdata/group c 64 0x010000
( 0x010000 is the magic number and this number has last 4 digits as 0000. The first two digits have to be unique and the maximum limit is 10 )

Create Volume Group, we need to define pe_size(ex: 64 MB) and max_pe (ex: 35000)
# vgcreate -s 64 -e 35000 /dev/vgdata /dev/dsk/c10t0d1 /dev/dsk/c12t0d1 /dev/dsk/c14t0d1 /dev/dsk/c16t0d1

Display volume group vgdata
# vgdisplay vgdata
--- Volume groups ---
VG Name /dev/vgdata
VG Write Access read/write
VG Status available
Max LV 255
Cur LV 0
Open LV 0
Max PV 16
Cur PV 1
Act PV 1
Max PE per PV 35000
VGDA 2
PE Size (Mbytes) 64
Total PE 15678
Alloc PE 0
Free PE 15678
Total PVG 0
Total Spare PVs 0
Total Spare PVs in use 0

We want to allocate all "Free PE" to logical volume, so we can get max size.
Size = Free PE x PE size.
# expr 15678 \* 64
1003392

Create logical volume on disk
# lvextend -L 1003392 -n datalvol /dev/vgdata

Create file system for logical volume that you created
# newfs -F vxfs -o largefiles /dev/vgdata/datalvol

Mount logical volume
# mkdir /data
# echo "/dev/vgdata/datalvol /data vxfs delaylog 0 2" >> /etc/fstab
# mount /dev/vgdata/datalvol /data

Show final volume group vgdata information.
# vgdisplay -v vgdata
--- Volume groups ---
VG Name /dev/vgdata
VG Write Access read/write
VG Status available
Max LV 255
Cur LV 1
Open LV 1
Max PV 16
Cur PV 1
Act PV 1
Max PE per PV 35000
VGDA 2
PE Size (Mbytes) 64
Total PE 15678
Alloc PE 15678
Free PE 0
Total PVG 0
Total Spare PVs 0
Total Spare PVs in use 0

--- Logical volumes ---
LV Name /dev/vgdata/datalvol
LV Status available/syncd
LV Size (Mbytes) 1003392
Current LE 15678
Allocated PE 15678
Used PV 1


--- Physical volumes ---
PV Name /dev/dsk/c10t0d1
PV Name /dev/dsk/c12t0d1 Alternate Link
PV Name /dev/dsk/c14t0d1 Alternate Link
PV Name /dev/dsk/c16t0d1 Alternate Link
PV Status available
Total PE 15678
Free PE 0
Autoswitch On

Popular posts from this blog

Howto configure boot device order on ILOM

SAN Switch Config Command

Howto cstm on HP-UX