Tuesday, June 12, 2012

Random AIX 5.3 Notes - expanding a logical volume

I've spent the past few days working on getting a PowerPath issue resolved on an AIX 5.3 box.  I rarely touch these things so my familiarity is abysmal making this much more difficult than it probably needs to be.  So I thought I'd just scribble down a few random things that I've worked through in hopes that it'll help someone else.


Expanding a logical volume without adding disks for those of us still stuck in the 90s (assumes it has already been expanded at the SAN level):


# Unmount, varyoff and export the volume group
bash-2.05b# umount /mountpoint
bash-2.05b# cfgmgr
bash-2.05b# varyoffvg thisvg
bash-2.05b# exportvg thisvg


# Deal with pv weirdness
bash-2.05b# chdev -l hdiskdevice# -a pv=clear
hdiskdevice# changed
bash-2.05b# chdev -l hdiskdevice# -a pv=yes
hdiskdevice# changed


# Recreate the volume group | -Y NA means don’t automatically rename the logical volumes
bash-2.05b# recreatevg -Y NA -y thisvg hdiskdevice#
0516-1434 varyonvg: Following physical volumes appear to be grown in size.
        Run chvg command to activate the new space.
        hdiskdevice#
thisvg
0516-1434 varyonvg: Following physical volumes appear to be grown in size.
        Run chvg command to activate the new space.
        hdiskdevice#


# check and grow vg - hello free PPs!
bash-2.05b# chvg -g thisvg
0516-1164 chvg: Volume group thisvg changed.  With given characteristics thisvg
        can include upto 7 physical volumes with 4064 physical partitions each.
bash-2.05b# lsvg thisvg | grep "FREE PPs" 
MAX LVs:            256                      FREE PPs:       856 (54784 megabytes)


# Take care of the filesystem - /fs is automatically added to the mountpoint when it’s recreated
bash-2.05b# chfs -m /mountpoint /fs/mountpoint
bash-2.05b# mount /mountpoint


# if needed, increase allowed LPs in LV
bash-2.05b# chlv -x 4686 thislv 


# Grow the filesystem, confirm the change
bash-2.05b# chfs -a size=+54784M /mountpoint
Filesystem size changed to 419299328
bash-2.05b# df -k /mountpoint
Filesystem    1024-blocks      Free %Used    Iused %Iused Mounted on
/dev/thislv   209649664  74832836   65%      228     1% /mountpoint

No comments:

Post a Comment