Find it

Monday, August 31, 2009

Adding LUN/External disk to HP-UX, Expand VG and LV.

Adding LUN/External disk to HP-UX, Expand VG and LV.

#ioscan -fnCdisk > /tmp/ioscan1.txt
#insf -eCdisk
#ioscan -fnCdisk > /tmp/ioscan2.txt
#diff /tmp/ioscan1.txt /tmp/ioscan2.txt
#ioscan -fnC disk

Now execute SAM and check for "unused" hardware path, you will see something like below -

Hardware Path Number of Paths Use Volume Group Total MB DES
1/10/0/0.115.10.19.98.1.3 2 Unused -- 8192 IBM

# diskinfo /dev/rdsk/c33t1d3
SCSI describe of /dev/rdsk/c33t1d3:
vendor: IBM
product id: 2107900
type: direct access
size: 8388608 Kbytes
bytes per sector: 512

# vgdisplay -v vg01
--- Volume groups ---
VG Name /dev/vg01
VG Write Access read/write
VG Status available
Max LV 255
Cur LV 10
Open LV 10
Max PV 32
Cur PV 4
Act PV 4
Max PE per PV 4160
VGDA 8
PE Size (Mbytes) 32
Total PE 1020
Alloc PE 941
Free PE 79
Total PVG 0
Total Spare PVs 0
Total Spare PVs in use 0

--- Logical volumes ---
..... Logical Volumes Details

--- Physical volumes ---
....... Physical Volumes Details

Okay, now we have just added new LUN/Disk to system so next task is to - Add disk to VG

1. Open SAM -->
2. Disks and File Systems -->
3. Volume Groups -->
4. Arrow down to the volume group you want to extend (from bdf) and hit the space bar to select it
-->
5. Tab once to get to the menu at the top and then arrow over to "Actions" and hit enter -->
6. Select "Extend" from the Actions menu -->
7. Select "Select Disk(s)..." and hit enter
-->
8. Select the appropriate disk to add with the space bar and select OK --> Select OK which will expand the volume -->
9. Exit SAM

If you dont like to use SAM then -

#pvcreate -f /dev/rdsk/c0t4d0
#vgextend vg01 /dev/dsk/c0t4d0


Verify with # vgdisplay -v vg01

Here we go, new disk added to exsiting VG so next task is to extend LV.

NOTE: YOU CAN INCREASE FS ON THE FLY PROVIDED THAT YOU HAVE ON-LINE JFS SUPPORT. TO CHECK IT EXECUTE # swlist -l product '*JFS'

# bdf /oradata
Filesystem kbytes used avail %used Mounted on
/dev/vg01/lvol3 6815744 6377253 411091 94% /oradata

current kbytes / 1024 = current MB
i.e. - 6815744 / 1024 = 6656 MB

Here is a trick - add current MB to MB adding to get the new size in MB, So here I want to extend LV by 5G i.e. 5120MB. so here I need to pass 11776M


# lvextend -L 11776 /dev/vg01/lvol3

# fsadm -F vxfs -b 11776M /oradata

# bdf /oradata
Filesystem kbytes used avail %used Mounted on
/dev/vg01/lvol3 12058624 6378538 5325086 55% /oradata

Here is a small tip on getting HP Fiber Card Info -

#print_manifest | grep -i Fibre
fc 8/8/1/0 td HP Tachyon TL/TS Fibre Channel Mass Storage Adapter
fc 8/12/1/0 td HP Tachyon TL/TS Fibre Channel Mass Storage Adapter
FibrChanl-00 B.11.11.09 PCI/HSC FibreChannel;Supptd HW=A6684A,A6685A,A5158A,A6795A

4 comments:

  1. Thank you very much for your contribution.

    ReplyDelete
  2. Never ever used -f with pvcreate command. If Storage team confirmed they assigned used disk then only run pvcreate -f

    ReplyDelete