How to extend Filesystem online on HP-UX?


This Knowledgebase describes how to extend filesystem on HP-UX with lvextendvgextend and fsadm commands.

Active  Node:

Step 1:Check  If OnlineJFS package  installed.

#swlist -l product | grep -i jfs
JFS                           B.11.31        Base VxFS File System 4.1 for HP-UX
OnlineJFS                     B.11.31        Online features of the VxFS File System 

Step 2:If OnlineJFS package  installed then Check For new  LUNID

#ioscan
#inq|grep  <newdiskLUNID>
#inqraid  -fx -CLIWP  /dev/rdisk/*|grep  <newdiskLUNID>
/dev/rdisk/disk110   :HITACHI :OPEN-V          :5001  :19564      :   289407360
#bdf|grep  <mountpointstoextend>
Filesystem          kbytes    used   avail %used Mounted on
/dev/vgx/lvoraarch   67108864 14596577 49230558   23% /oracle/oraarch

Step 3:Create  PV  with new  Disk

#pvcreate /dev/rdisk/disk110

Step 4:Extend  VG  with  new  PV

[shell]#vgextend vg01 /dev/disk/disk110[/shell]

Step 5:Check Vg  for free PV

#vgdisplay -v vg01
— Volume groups —
VG Name                     /dev/vg01
VG Write Access             read/write
VG Status                   available, exclusive
Max LV                      255
Cur LV                      21
Open LV                     21
Max PV                      32
Cur PV                      10
Act PV                      10
Max PE per PV               65535
VGDA                        20
PE Size (Mbytes)            256
Total PE                    10146
Alloc PE                    10129
Free PE                     17
Total PVG                   0
Total Spare PVs             0
Total Spare PVs in use      0
VG Version                  1.0
VG Max Size                 524280g
VG Max Extents              2097120
#lvdisplay  /dev/vg01/lvoraarch
— Logical volumes —
LV Name                     /dev/vg01/lvoraarch
VG Name                     /dev/vg01
LV Permission               read/write
LV Status                   available/syncd
Mirror copies               0
Consistency Recovery        MWC
Schedule                    parallel
LV Size (Mbytes)            347904
Current LE                  1359
Allocated PE                1359
Stripes                     0
Stripe Size (Kbytes)        0
Bad block                   on
Allocation                  strict
IO Timeout (Seconds)        default   [/shell]
Step 6:Extend  LV and also Check Free  PE
[shell]#vgdisplay  vg01
— Volume groups —
VG Name                     /dev/vg01
VG Write Access             read/write
VG Status                   available, exclusive
Max LV                      255
Cur LV                      21
Open LV                     21
Max PV                      32
Cur PV                      10
Act PV                      10
Max PE per PV               65535
VGDA                        20
PE Size (Mbytes)            256
Total PE                    10146
Alloc PE                    10129
Free PE                     17    >> Total  Free  PE.Total Free Size = 17 x 256MB
Total PVG                   0
Total Spare PVs             0
Total Spare PVs in use      0
VG Version                  1.0
VG Max Size                 524280g
VG Max Extents              2097120
#lvdisplay  /dev/vg01/lvoraarch
— Logical volumes —
LV Name                     /dev/vg01/lvoraarch
VG Name                     /dev/vg01
LV Permission               read/write
LV Status                   available/syncd
Mirror copies               0
Consistency Recovery        MWC
Schedule                    parallel
LV Size (Mbytes)            347904
Current LE                  1359
Allocated PE                1359 //Current  PE =1359  And we ‘ll add 17 =1359+17=1376
Stripes                     0
Stripe Size (Kbytes)        0
Bad block                   on
Allocation                  strict
IO Timeout (Seconds)        default
lvextend -l 1376 /dev/vg01/lvoraarch  //we added  17 free PE to lvoraarch[/shell]
-17 PE means  that  17X256MB ;
[shell]#lvdisplay  /dev/vg01/lvoraarch
— Logical volumes —
V Name                     /dev/vg01/lvoraarch
VG Name                     /dev/vg01
LV Permission               read/write
V Status                   available/syncd
Mirror copies               0
Consistency Recovery        MWC
Schedule                    parallel
LV Size (Mbytes)            352256
urrent LE                  1376
Allocated PE                1376
Stripes                     0
tripe Size (Kbytes)        0
Bad block                   on
Allocation                  strict
IO Timeout (Seconds)        default

Step 6:Extend  Filesystem  Online

#fsadm -F vxfs -b 352256M  /oracle/XIP/oraarch

****If you need to perform extend with the offline option you should unmount filesystem then run "extendfs" command for the logical volume.

#umount  /oracle/XIP/oraarch
#extendfs -F vxfs /dev/vg01/lvoraarch

352256M   > this  is  the total LV Size (Mbytes) 

If your server is a  part of  HP-Serviceguard or another cluster solution you need to get map file and import it on the passive node.

#vgexport -pvs -m /tmp/vg01.map vg01

Beginning the export process on Volume Group “vgxip01”.

vgexport: Volume group “vgxip01” is still active.

/dev/disk/disk78

/dev/disk/disk84

/dev/disk/disk85

/dev/disk/disk86

/dev/disk/disk87

/dev/disk/disk105

/dev/disk/disk110

vgexport: Preview of vgexport on volume group “vgxip01” succeeded.

#scp /tmp/vg01.map user@passivenode:/tmp

Passive  Node:

Step 1:Scan For new disks.

#ioscan

Step 2:Check new LUN with inq or Ioscan commands  

#ioscan -funC disk

Step 3:Export  VG and  import  Map File

#vgexport vg01
#vgimport -vs -N -m /tmp/vg01.map vg01
#strings /etc/lvmtab

 

Tagged In:

I'm a IT Infrastructure and Operations Architect with extensive experience and administration skills and works for Turk Telekom. I provide hardware and software support for the IT Infrastructure and Operations tasks.

205 Total Posts
Follow Me

Related Post