msgbartop
Tips and Tricks site for advanced HP-UX Engineers
msgbarbottom

13 Nov 19 Convert LVM volume group from 1.0 to 2.2

# First – show proof that we are currently using VG Version 1.0

# vgdisplay /dev/vgscott01
--- Volume groups ---
VG Name                     /dev/vgscott01
VG Write Access             read/write
VG Status                   available
Max LV                      255
Cur LV                      3
Open LV                     3
Max PV                      32
Cur PV                      16
Act PV                      16
Max PE per PV               40960
VGDA                        32
PE Size (Mbytes)            32
Total PE                    131204
Alloc PE                    65849
Free PE                     65355
Total PVG                   0
Total Spare PVs             0
Total Spare PVs in use      0
VG Version                  1.0   <----- Proof :-)
VG Max Size                 40t
VG Max Extents              1310720

--------------------------------------

# Step #1.  From experience, we *know* that each current disk in the VG will
# need to have at least one free extent at the end to accomodate the transition
# to VG Version 2.x.
#
# But, currently, all extents from all current disks are allocated.  
# We can move off 'N' number of extents from the end of the current 
# disk to a new disk using the "-e" option of the pvmove command.
#

# (note: we use dsf's for all commands)

--------------------------------------

#
# First we need to unmount all filesystems
#

umount /bb/9/dev/mylab
umount /bb/9/dev/venturelab
umount /bb/9/dev

--------------------------------------

#
# Ok, we need to free up at least one extent from the end of
# the original, fully-qualified disks.
#
# We use the "-e" option of the pvmove command to make this happen.

# pvmove -e 2 /dev/disk/disk247 /dev/disk/disk265
# pvmove -e 2 /dev/disk/disk248 /dev/disk/disk265
# pvmove -e 2 /dev/disk/disk251 /dev/disk/disk265
# pvmove -e 2 /dev/disk/disk249 /dev/disk/disk265
# pvmove -e 2 /dev/disk/disk260 /dev/disk/disk265
# pvmove -e 2 /dev/disk/disk259 /dev/disk/disk265
# pvmove -e 2 /dev/disk/disk258 /dev/disk/disk265
# pvmove -e 2 /dev/disk/disk261 /dev/disk/disk265
# pvmove -e 2 /dev/disk/disk262 /dev/disk/disk265
# pvmove -e 2 /dev/disk/disk263 /dev/disk/disk265
# pvmove -e 2 /dev/disk/disk264 /dev/disk/disk265


#
# At this point, a vgdisplay should show at least 2 extents for each physical volume. 
# Check our work
#

# vgdisplay -v /dev/vgscott01



--------------------------------------

# vgversion -r -V 2.1 /dev/vgscott01

#
# We are good to go!
#

#
# We need to deactivate the Volume Group before we can upgrade
#

# vgchange -a n /dev/vgscott01

#
# We are good to go!
#

# vgversion -V 2.1 /dev/vgscott01



--------------------------------------

#
# Check our work
#

# vgchange -a y /dev/vgscott01

# vgdisplay -v /dev/vgscott01



--------------------------------------

#
# Now, we can extend our logical volume
#

# lvdisplay /dev/vgscott01/lvol1

# lvextend -l 98864 /dev/vgscott01/lvol1
# fsadm -F vxfs -b 3163648m /bb/9/dev

--------------------------------------

# lvdisplay /dev/vgscott01/lvol1



--------------------------------------

# vgcfgbackup /dev/vgscott01

--------------------------------------

# mount /bb/9/dev
# mount /bb/9/dev/mylab
# mount /bb/9/dev/venturelab

# bdf /bb/9/dev


Leave a Comment

You must be logged in to post a comment.

sidebarbottom
sidebartop
sidebarbottom
WhatsApp chat