UnixPedia : HPUX / LINUX / SOLARIS: HPUX :How to extend root file system using LVM mirrors in online.

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

No comments:

Post a Comment