UnixPedia : HPUX / LINUX / SOLARIS: HP-UX Unix HPUX
Showing posts with label HP-UX Unix HPUX. Show all posts
Showing posts with label HP-UX Unix HPUX. Show all posts

Thursday, May 8, 2014

HPUX :How to extend root file system using LVM mirrors in online.



How to extend root file system using LVM mirrors in online.
Overview
This article explains how to extend the root (/) file system using LVM Mirror/UX. OnlineJFS is required to extend the file system without going in LVM maintenance mode. This method allows to extend root (/) file system without re-igniting the server.
Procedures
It uses a special "reserve" logical volume as stepping stone to free the required PEs between current lvol3 and lvol4 to comply with lvol3 contiguous policy. This method can be used on HP-UX 11.11 / 11.23 with Legacy Addressing (/dev/dsk/c#t#d#) or with the new HP-UX 11.31 Agile Addressing (/dev/disk/disk#) device special files. In this example I used HP-UX 11.11 with legacy addressing.

Example

Root Lv Contiguous - /dev/vg00/lvol3 ; File system

After root lv is  - /dev/vg00/lvol4 is follow with lvol3 contiguous policy

Primary disk - /dev/dsk/c0t6d0

Alternate disk -  /dev/dsk/c2t6d0


1. Take full backup of ignite

/usr/local/CPR/bin/CreateArchive > /var/adm/log/CreateArchive.log 2>&1

2. Check the current status of your volume groups and logical volumes.

vgdisplay -v vg00

( Ensure that space available in vg00 which we need to extend for root. )

3. Identify the primary disk and secondary disk. In this example the current size of lvol3 is 129 PE or 1032 MB.

The primary disk is /dev/dsk/c0t6d0 and the alternate disk is /dev/dsk/c2t6d0 .

4. Remove mirror from primary disk down to lvol4.

lvreduce -m 0 /dev/vg00/lvol4 /dev/dsk/c0t6d0

5. Remove mirror from alternate disk down to lvol3

lvreduce -m 0 /dev/vg00/lvol3 /dev/dks/c2t6d0

6. Extend the logical volume for lvol3 which you need to add.

lvextend -L <Current Size + Adding Size> <512M+8M> 520M /dev/vg00/lvol3 /dev/dsk/c0t6d0

7. Extend the file system once logical volume extended successfully.

fsadm -F vxfs -b 520M /   ( -b <current size + extending size> = Total size)

8. Re-mirror the lvol4 to primary disk

lvextend -m 1 /dev/vg00/lvol4 /dev/dsk/c0t6d0

9. Reduce the mirror from alternate disk to lvol4

lvreduce -m 0 /dev/vg00/lvol4 /dev/dsk/c2t6d0

10. Re-mirror the alternate disk to lvol3

lvextend -m 1 /dev/vg00/lvol3 /dev/dsk/c2t6d0

11. Re-mirror the alternate disk to lvol4

lvextend -m 1 /dev/vg00/lvol4 /dev/dsk/c2t6d0

12. Verify and validate the extended size in lvol3 (root fs)

 Before extn

/dev/vg00/lvol3     524288  200056  321760   38% /

After extn

/dev/vg00/lvol3     532480  199976  329968   38% /

13. Validate pre and post lvol4 file system size should be matched

Before extn

#-> bdf /home
Filesystem          kbytes    used   avail %used Mounted on
/dev/vg00/lvol4     524288   83120  437752   16% /home

After extn

#-> bdf /home
Filesystem          kbytes    used   avail %used Mounted on
/dev/vg00/lvol4     524288   83120  437752   16% /home
Keywords.
Root FS Extension, root fs, HP-UX, UNIIX

Saturday, May 3, 2014

HPUX : Vgcreation in case of no mapfile.



Vgcreation in case of no mapfile.
Overview
Vgcreatoin in case of no mapfile , but vgheader and lvheader are on disk.
Procedures

1-      Once BCV sync complete or we know the group of disk which are below to same Vg. We can use xd command to find the VGID on DISK. And form a group of disk

Here we know  the group of disk.

[root@systemA:/usr/local/CPR/data/systemA/2014.04.26-02.00]#
#-> pairdisplay -g DXN_DB -IBC5 -fxcd |grep -i s-vol|grep -i flash
DXN_DB  vg_DXN_flashback_000(L)  c158t11d6      0  65760  60c1.S-VOL SSUS,   99    60bd -
DXN_DB  vg_DXN_flashback_001(L)  c158t11d7      0  65760  60c2.S-VOL SSUS,   99    60be -
DXN_DB  vg_DXN_flashback_002(L)  c158t12d0      0  65760  60c3.S-VOL SSUS,   99    60bf -
DXN_DB  vg_DXN_flashback_003(L)  c158t12d1      0  65760  60c4.S-VOL SSUS,   99    60c0 -

[root@systemA:/usr/local/CPR/data/systemA/2014.04.26-02.00]#

2-   Check those disk are part of any VG or present in lvmtab.

#-> strings /etc/lvmtab|grep -iE "c158t11d6|c158t11d7|c158t12d0|c158t12d1"
[root@systemA:/usr/local/CPR/data/systemA/2014.04.26-02.00]#
#-> ll /dev/*/group|grep -i flas
crw-r--r--   1 root       sys         64 0x440000 Aug 27  2013 /dev/vg_DXN_flashback/group
[root@systemA:/usr/local/CPR/data/systemA/2014.04.26-02.00]#

3-   Run vgchgid on set of disk which have same vgid.

#-> vgchgid /dev/rdsk/c158t11d6 /dev/rdsk/c158t11d7 /dev/rdsk/c158t12d0 /dev/rdsk/c158t12d1

[root@systemA:/usr/local/CPR/data/systemA/2014.04.26-02.00]#

4-   Create the directory and provide unique minor number
#-> mkdir /dev/vg_DXN_flashback
[root@systemA:/usr/local/CPR/data/systemA/2014.04.26-02.00]#
#-> mknod /dev/vg_DXN_flashback/group c 64 0x450000

5-   Import the VG without mapfile

[root@systemA:/usr/local/CPR/data/systemA/2014.04.26-02.00]#
#-> vgimport /dev/vg_DXN_flashback /dev/dsk/c158t11d6 /dev/dsk/c158t11d7 /dev/dsk/c158t12d0 /dev/dsk/c158t12d1
Warning: A backup of this volume group may not exist on this machine.
Please remember to take a backup using the vgcfgbackup command after activating the volume group.
[root@systemA:/usr/local/CPR/data/systemA/2014.04.26-02.00]#

6-   Use the name convention as per FS:
#-> cd  /dev/vg_DXN_flashback
[root@systemA:/dev/vg_DXN_flashback]#
#-> ll
total 0
crw-r--r--   1 root       sys         64 0x450000 May  1 08:35 group
brw-r-----   1 root       sys         64 0x450001 May  1 08:36 lvol1
crw-r-----   1 root       sys         64 0x450001 May  1 08:36 rlvol1
[root@systemA:/dev/vg_DXN_flashback]#
#-> mv lvol1 lv_oracleDXNflashback
[root@systemA:/dev/vg_DXN_flashback]#
#-> mv rlvol1 rlv_oracleDXNflashback
[root@systemA:/dev/vg_DXN_flashback]#
#-> cd

7-   Active the VG

[root@systemA:/.root]#
#-> vgdisplay -v /dev/vg_DXN_flashback |grep -i "lv name"
vgdisplay: Volume group not activated.
vgdisplay: Cannot display volume group "/dev/vg_DXN_flashback".
[root@systemA:/.root]#
#-> vgchange -a y /dev/vg_DXN_flashback
Activated volume group
Volume group "/dev/vg_DXN_flashback" has been successfully changed.
[root@systemA:/.root]#
#-> vgdisplay -v /dev/vg_DXN_flashback |grep -i "lv name"
   LV Name                     /dev/vg_DXN_flashback/lv_oracleDXNflashback

8-   Run fsck on the LV

[root@systemA:/.root]#
#-> mount /dev/vg_DXN_flashback/lv_oracleDXNflashback /oracle/DXN/flashback
vxfs mount: /dev/vg_DXN_flashback/lv_oracleDXNflashback is corrupted. needs checking
[root@systemA:/.root]#
#-> fsck /dev/vg_DXN_flashback/lv_oracleDXNflashback
fsck: /etc/default/fs is used for determining the file system type
log replay in progress
replay complete - marking super-block as CLEAN

9-   Mount the FS on mount point.
[root@systemA:/.root]#
#-> mount /dev/vg_DXN_flashback/lv_oracleDXNflashback /oracle/DXN/flashback
[root@systemA:/.root]#
#-> bdf /oracle/DXN/flashback
Filesystem          kbytes    used   avail %used Mounted on
/dev/vg_DXN_flashback/lv_oracleDXNflashback
                   512000000  227665 479786690    0% /oracle/DXN/flashback
Keywords.
Vgimport, vgchgid, mount,mknod