Using the vgmodify command to perform LVM Volume Group Dynamic LUN Expansion (DLE) and Contraction (DLC) Abstract.............................................................................................................................................. 3 Introduction......................................................................................................................................... 4 Overview.............................................................................................
Command line options.................................................................................................................... 50 Command usage ........................................................................................................................... 51 Online DLE to increase the space available for user data ................................................................ 51 Online DLE to increase the space available for LVM configuration data ....................................
Abstract The Logical Volume Manager (LVM) vgmodify command enables you to change attributes that previously were set at creation time (for example, increasing the maximum number of physical volumes or the maximum number of extents). It also enables you to resize disks either through Dynamic LUN Expansion (DLE) or Dynamic LUN Contraction (DLC). The ability to resize disks is a feature commonly provided by disk arrays. This paper explains the benefits of vgmodify and how to use it.
Introduction LVM and MirrorDisk/UX now support the following volume groups: Version 1.0 — Supported on all current and previous versions of HP-UX 11i. Version 2.x — Version 2.0 volume groups are supported starting with the HP-UX 11i v3 March 2008 Update. Version 2.1 volume groups are supported starting with the HP-UX 11i v3 September 2008 Update. The vgmodify command is supported on Version 1.0 and Version 2.x volume groups. Version 2.x support is provided starting with the HP-UX 11i v3 March 2009 Update.
• Change a disk type (boot to non-boot or vice versa). • Change the maximum number of logical volumes in the volume group. For Version 2.x volume groups, use vgmodify to do the following tasks: • Make full use of the space available on a disk that is larger than the current configuration. • Contract a physical volume to a size smaller than the current configuration. • Change the maximum size. vgmodify for Version 1.
Typically, you perform these in the preceding sequence. For offline mode, if the volume group is deactivated, it is activated by vgmodify and vgcfgbackup called. The vgmodify command rejects starting on an active volume group if it is invoked in change mode. This is necessary as vgmodify must be in full control of the volume group, it must be able to choose the options used to activate it, and have the ability to deactivate it as necessary.
• For online DLE, you must use the –a and –E options to indicate that a DLE at the device side must be handled by LVM. • DLE might require that the max_pe value is increased so that all the space can be allocated to physical extents. This can be achieved by including the –e option and an increased max_pe setting. • You can perform an online disk resize operation while user I/Os to the physical volumes belonging to the volume group is question are in progress.
How the volume group parameter settings affect the metadata size The choice of volume group settings is affected by the LVM metadata size. While the max_lv setting has only a small impact on the VGRA size (by default vgcreate has already set max_lv to the maximum possible value), the max_pv and max_pe settings are a major factor. As a general rule, if you reduce either the max_pe or max_pv values, you can increase the other (max_pe or max_pv).
max_pv • 16 max_pe 1016 max_lv 255 vg_version 1.0 Without the –v option: # vgcfgrestore -l -n vg01 Volume Group Configuration information in "/etc/lvmconf/vg01.
• Physical extent renumbering enables more flexibility for picking max_pv and max_pe. If the -t output does not provide suitable values, check the -tn output. Offline vgmodify This section discusses the use of the vgmodify command on a deactivated volume group. Prerequisites • The volume group must be deactivated when changes are being made (for the root volume group this means booting into maintenance mode). • The volume group must be cluster unaware (vgchange –c n) before changes are made.
For a root volume group: Boot into maintenance mode): # cd / ; shutdown –r now Interact with boot process: ISL> hpux -lm # vgmodify -v –e 2000 –p 150 vg02 # Same options and arguments as in the previous step but without –r. # vgchange –a y –s vg02 # Verify the volume group activates with the new settings # vgchange –a n vg02 # Deactivate volume group # reboot Performing an offline DLC For an offline DLC, you must specify the size to which the physical volume must be reduced along with –C option.
# vgmodify –a n vg02 For handling the root and non-root volume groups, see the preceding Performing an offline DLE section. Online vgmodify This section discusses the use of the vgmodify command on an activated volume group. Online vgmodify is supported starting with the HP-UX 11i v3 September 2008 Update release. Beginning with the HP-UX 11iv3 September 2008 Update, you can use online vgmodify for Dynamic LUN Expansion.
is the cause of the failure. To overcome this problem, the disk can be replaced and the configuration restored with vgcfgrestore. • The volume group must not have a cluster lock physical volume. The cmviewcl –v command displays the device path name of the disk configured as a cluster lock LUN. • The increase in disk size must be greater than the size of a physical extent on the physical volume.
Changing the volume group configuration 1. Run the vgmodify command with the –t option, which displays the range of values (max_pv, max_pe, and disk size) to which the volume group can be tuned. For example: # vgmodify –t –v vg02 # Table without physical extent renumbering (For more information, see the Physical extent renumbering (-n option) and pvmove enhancement section.) # vgmodify –t –v –n vg02 # Table with physical extent renumbering 2.
# pvdisplay /dev/disk/disk4154 --- Physical volumes --PV Name /dev/disk/disk4154 VG Name /dev/vg1 PV Status available Allocatable yes VGDA 2 Cur LV 1 PE Size (Mbytes) 16 Total PE 19199 Free PE 0 Allocated PE 19199 Stale PE 0 IO Timeout (Seconds) default Autoswitch On Proactive Polling On # diskinfo /dev/rdisk/disk4154 SCSI describe of /dev/rdisk/disk4154: vendor: HP product id: OPEN-V type: direct access size: 314572800 Kbytes bytes per sector: 512 The max_PE per PV for this volume group is 30000. 2.
# vgmodify -v –r –a –E vg1 Volume Group configuration for /dev/vg1 has been saved in /etc/lvmconf/vg1.conf "/dev/rdisk/disk4154" size changed from 314572800 to 492830720kb "/dev/rdisk/disk4154" size is limited by the maximum extents per PV to 491520000. An update to the Volume Group IS required Review complete. Volume group not modified 6. Perform the actual DLE operation in change mode.
# vgmodify –v -r –a -E vg04 Volume Group configuration for /dev/vg1 has been saved in /etc/lvmconf/vg1.conf /dev/rdisk/disk43 Warning: Max_PE_per_PV for the volume group (12900) too small for this PV (17501). Using only 12900 PEs from this physical volume. /dev/rdisk/disk46 Warning: Max_PE_per_PV for the volume group (12900) too small for this PV (17501). Using only 12900 PEs from this physical volume.
2. Use online vgmodify in review mode to review the effect of the change in disk size. # vgmodify –r -a -E vg1 "/dev/rdisk/disk43" size changed from 52428800 to 71687369kb An update to the Volume Group IS required Review complete. Volume group not modified 3. Use online vgmodify to change the disk size. # vgmodify -a -E vg1 "/dev/rdisk/disk43" size changed from 52428800 to 71687369kb 4. Verify the change.
Total Spare PVs in use VG Version VG Max Size VG Max Extents 0 1.0 889600m 222400 There are 12799 extents allocated on this physical volume. 2. Use online vgmodify to review the effect of the change in disk size. # vgmodify –r -a -E vg1 "/dev/rdisk/disk43" size changed from 52428800 to 71687369kb "/dev/rdisk/disk43" size is limited by the maximum extents per PV to 56934400. An update to the Volume Group IS required Review complete. Volume group not modified 3. Use online vgmodify to change the disk size.
VG Name VG Write Access VG Status Max LV Cur LV Open LV Max PV Cur PV Act PV Max PE per PV VGDA PE Size (Mbytes) Total PE Alloc PE Free PE Total PVG Total Spare PVs Total Spare PVs in use VG Version VG Max Size VG Max Extents /dev/vg1 read/write available 255 1 0 16 1 1 12799 2 4 12799 12799 0 0 0 0 1.0 819136m 204784 There are 12799 extents allocated on this physical volume. 2. Use online vgmodify to review the change in disk size.
Volume Group configuration for /dev/vg04 has been saved in /etc/lvmconf/vg04.conf Current Volume Group settings: Max LV 255 Max PV 16 Max PE per PV 1023 PE Size (Mbytes) 4 VGRA Size (Kbytes) 208 /dev/rdsk/c5t0d0 Warning: Max_PE_per_PV for the volume group (1023) too small for this PV (1464). Using only 1023 PEs from this physical volume. /dev/rdsk/c6t0d0 Warning: Max_PE_per_PV for the volume group (1023) too small for this PV (1220). Using only 1023 PEs from this physical volume.
84 1276 5105 * Entries deleted for brevity 5. Review the configuration for a max_pv of 20. The max_pv values up to 70 provide for a sufficient number of max_pes for the current largest disk. # vgmodify -r -p 20 -e 5372 -v vg04 Volume Group configuration for /dev/vg04 has been saved in /etc/lvmconf/vg04.conf Current Volume Group settings: Max LV 255 Max PV 16 Max PE per PV 1023 PE Size (Mbytes) 4 VGRA Size (Kbytes) 208 The current and new Volume Group parameters differ.
New Volume Group configuration for "vg04" has been saved in "/etc/lvmconf/vg04.conf" Old Volume Group configuration for "vg04" has been saved in "/etc/lvmconf/vg04.conf.old" Starting the modification by writing to all Physical Volumes Applying the configuration to all Physical Volumes from "/etc/lvmconf/vg04.
# pvdisplay /dev/dsk/c6t0d0 --- Physical volumes --PV Name VG Name PV Status Allocatable VGDA Cur LV PE Size (Mbytes) Total PE Free PE Allocated PE Stale PE IO Timeout (Seconds) Autoswitch Proactive Polling /dev/dsk/c6t0d0 /dev/vg04 available yes 2 0 4 1220 1220 0 0 default On On The Total PE is now 1220. Online and offline DLC examples The examples in this section are the same for both online and offline, and assume the volume group is already activated.
VG Name PV Status Allocatable VGDA Cur LV PE Size (Mbytes) Total PE Free PE Allocated PE Stale PE IO Timeout (Seconds) Autoswitch Proactive Polling /dev/vg01 available yes 2 1 4 17501 7501 10000 0 default On On --- Distribution of physical volume --LV Name LE of LV PE for LV /dev/vg01/lvol1 10000 10000 --- Physical extents --PE Status LV 00000 current /dev/vg01/lvol1 00001 current /dev/vg01/lvol1 00002 current /dev/vg01/lvol1 00003 current /dev/vg01/lvol1 00004 current /dev/vg01/lvol1 00005 current /dev/v
The physical volume "/dev/rdsk/c4t2d0" is ready to be prepared for contraction to 51200 MB. The physical volume "/dev/rdsk/c4t2d0" can be prepared for contraction to 40003 MB without having to move any physical extents on it. The physical volume "/dev/rdsk/c4t2d0" can be prepared for contraction to a minimum size of 40003 MB after freeing up the last 7501 physical extents. An update to the Volume Group IS required Review complete.
PV Name VG Name PV Status Allocatable VGDA Cur LV PE Size (Mbytes) Total PE Free PE Allocated PE Stale PE IO Timeout (Seconds) Autoswitch Proactive Polling /dev/dsk/c4t2d0 /dev/vg01 available yes 2 1 4 12799 2799 10000 0 default On On After the DLC operation, Total PE is reduced from 17501 to 12799 and Free PE on the volume group is reduced from 7501 to 2799.
Proactive Polling On --- Distribution of physical volume --LV Name LE of LV PE for LV /dev/vg01/lvol1 14000 14000 --- Physical extents --PE Status LV 00000 current /dev/vg01/lvol1 00001 current /dev/vg01/lvol1 00002 current /dev/vg01/lvol1 00003 current /dev/vg01/lvol1 00004 current /dev/vg01/lvol1 00005 current /dev/vg01/lvol1 *Entries deleted for brevity* 13996 current /dev/vg01/lvol1 13997 current /dev/vg01/lvol1 13998 current /dev/vg01/lvol1 13999 current /dev/vg01/lvol1 14000 free 14001 free 14002 fr
# vgmodify -a -r -C 51200 vg01 /dev/rdsk/c4t2d0 #online mode The last 4702 extent(s) on the physical volume "/dev/rdsk/c4t2d0" have to be made free (see pvmove(1M)) to be able to prepare it for contraction to 51200 MB. The physical volume "/dev/rdsk/c4t2d0" can be prepared for contraction to 56003 MB without having to move any physical extents on it. The physical volume "/dev/rdsk/c4t2d0" can be prepared for contraction to a minimum size of 56003 MB after freeing up the last 3501 physical extents .
PV Name VG Name PV Status Allocatable VGDA Cur LV PE Size (Mbytes) Total PE Free PE Allocated PE Stale PE IO Timeout (Seconds) Autoswitch Proactive Polling /dev/dsk/c4t1d0 /dev/vg01 available yes 2 1 4 17501 16300 1201 0 default On On The last 1201 extents were moved from physical volume /dev/dsk/c4t2d0 to /dev/dsk/c4t1d0. 5. Run vgmodify in review mode.
Open LV Max PV Cur PV Act PV Max PE per PV VGDA PE Size (Mbytes) Total PE Alloc PE Free PE Total PVG Total Spare PVs Total Spare PVs in use VG Version VG Max Size VG Max Extents 1 16 2 2 17501 4 4 30300 14000 16300 0 0 0 1.
VG Version VG Max Size VG Max Extents 1.
*Entries deleted for brevity* 11997 current /dev/vg01/lvol1 11998 current /dev/vg01/lvol1 11999 current /dev/vg01/lvol1 12000 free 12001 free *Entries deleted for brevity* 13998 free 13999 free 14000 current /dev/vg01/lvol2 14001 current /dev/vg01/lvol2 14002 current /dev/vg01/lvol2 *Entries deleted for brevity* 15997 current /dev/vg01/lvol2 15998 current /dev/vg01/lvol2 15999 current /dev/vg01/lvol2 16000 free 16001 free *Entries deleted for brevity* 17498 free 17499 free 17500 free 11997 11998 11999 0000
Preview the pvmove operation.
The allocated extents on physical volume /dev/dsk/c4t2d0 were moved to /dev/dsk/c4t1d0. 5. Run vgmodify in review mode. # vgmodify -r -C 51200 vg01 /dev/rdsk/c4t2d0 The physical volume "/dev/rdsk/c4t2d0" is ready to be prepared for contraction to 51200 MB. The physical volume "/dev/rdsk/c4t2d0" can be prepared for contraction to 48003 MB without having to move any physical extents on it.
Online and offline volume group configuration change examples The examples in this section are for both online and offline, and assume the volume group is already activated. In offline mode, this is not a requirement as vgmodify activates the volume group, if needed. If vgmodify activates the volume group, it deactivates it before completion. In offline mode, the volume group can be active in case of review mode, but must be activated during the actual vgmodify operation.
shows that you can increase the VGRA to 896 KB without using the –n argument or 4096 KB (the PE size) with –n. The list of settings is based upon a VGRA no greater than 896 KB in size. 2. Run vgmodify in review mode. There are two optimal settings that allow a 23 GB disk to be part of the volume group with at least 19 physical volumes. The following example uses a max_pv of 19.
VGRA Size (Kbytes) 896 New Volume Group configuration for "vg02" has been saved in "/etc/lvmconf/vg02.conf” Old Volume Group configuration for "vg02" has been saved in "/etc/lvmconf/vg02.conf.old” Starting the modification by writing to all Physical Volumes Applying the configuration to all Physical Volumes from "/etc/lvmconf/vg02.conf" Volume Group configuration has been restored to /dev/rdsk/c0t0d0 Volume Group configuration has been restored to /dev/rdsk/c1t0d0 Completed the modification process.
pvmove, lvreduce, or lvremove. Run vgmodify –r –e max_pe –p max_pv vgname, where max_pe and max_pv are the chosen values. Finally, when a maintenance window is available, deactivate the volume group and run vgmodify with the same options as before but without –r. This example assumes you want to place a disk that is 90 GB in size and increase the number of physical volumes to at least 20. 1. Verify the current configuration.
Summary 896 4096 Physical Extent zero is not free on all PVs.
PE Size (Mbytes) VGRA Size (Kbytes) Review complete. Volume group not modified 4. 4 4064 Run vgmodify in change mode. For offline mode, deactivate the volume before performing the actual operation and run vgmodify without –a option.. # vgchange -a n vg02 # For offline mode only Volume group "vg01" has been successfully changed.
Cur PV Act PV Max PE per PV VGDA PE Size (Mbytes) Total PE Alloc PE Free PE Total PVG Total Spare PVs Total Spare PVs in use VG Version VG Max Size VG Max Extents 3 3 21756 6 4 15354 3000 12354 0 0 0 1.0 2001552m 500388 The Max PV and Max PE per PV are as requested. Optimizing the metadata space Run vgmodify in review mode, with and without the –a option. The -a option enables the vgmodify command to run when the volume group is active (online vgmodify). 1.
VGRA Size (Kbytes) 736 New configuration requires max_pes are increased from 5119 to 6652 The current and new Volume Group parameters differ. An update to the Volume Group IS required New Volume Group settings: Max LV 255 Max PV 16 Max PE per PV 6652 PE Size (Mbytes) 4 VGRA Size (Kbytes) 896 New Volume Group configuration for "vg02" has been saved in "/etc/lvmconf/vg02.conf" Old Volume Group configuration for "vg02" has been saved in "/etc/lvmconf/vg02.conf.
vgmodify –B n –n –t vgname (with–n). vgmodify –B n –t vgname (without –n). vgmodify –B n –o –r vgname . 2. Select the entry from the output of the three commands that meets the requirements. If using a setting from the –tn table and this requires physical extent renumbering lower, run vgmodify –B n –tnv vgname and check that no disks need the first physical extent to be made free.
2. Run vgmodify in table mode with the bootable disk now made non-boot. # vgmodify -tv -B n vg02 /dev/rdsk/c0t0d0 Volume Group configuration for /dev/vg02 has been saved in /etc/lvmconf/vg02.
VGRA Size (Kbytes) Review complete. Volume group not modified 896 4. Make the change. For offline mode, deactivate the volume group before performing the actual operation and run vgmodify without the –a option. # vgchange -a n vg02 # For offline mode only Volume group "vg02" has been successfully changed.
Volume group "vg02" has been successfully changed. For offline mode, activate the volume group. # vgchange -a y vg02 Activated volume group Volume group "vg02" has been successfully changed. 5. Verify the changes.
• Expected 5 Physical Volumes but only found 4 The volume group has five physical volumes, but vgmodify can only locate four. Verify that all five physical volumes are accessible. The vgmodify command cannot continue until it can access all five. • VGRA space (Kbytes) without PE renumbering The amount of space available for the VGRA when physical extent renumbering is left unchanged.
/dev/rdsk/c2t3d0 /dev/rdsk/c3t4d0 Bootable disks (disks created using pvcreate –B or changed type using vgmodify –B y) limit the space available for the VGRA. If this is not a boot volume group, use –B n to change all the disks in the list to non-boot. • Physical Extent zero is not free on all PVs.
vgmodify for Version 2.0 volume groups This section describes how to use the vgmodify command to perform online dynamic LUN expansion (DLE), online dynamic LUN contraction (DLC), and online volume group reprovisioning (changing maximum VG size) for Version 2.x volume groups. The vgmodify command for Version 2.x volume groups is available in the HP-UX 11i v3 March 2009 Update. For information on using vgmodify on Version 1.0 volume groups, see the vgmodify for Version 1.0 volume groups section.
vgmodify -a -C DLC_Size [-r] VolumeGroupName pv_path • Reconfigure physical volumes for a change in the maximum volume group size vgmodify -a [-E] -S Max_VG_Size [-r] VolumeGroupName The –a option is required in all cases because the vgmodify command for Version 2.x volume groups is only supported on activated volume groups. For a complete list of options, see vgmodify(1M). Command usage In the following cases, you can use the vgmodify command to reconfigure a Version 2.x volume group.
Online DLC to decrease the space used by a physical volume A physical volume needs to be reconfigured to prepare the LUN for dynamic contraction. You can use the online vgmodify DLC –C option to prepare the LUN. In some cases, free extents at the end of the PV might need to be removed.
5. Verify the result of the DLE reconfiguration by running the vgdisplay –v command to check the total number of extents for the VG, the total number of free extents for the VG, the number of extents for each PV, and the number of free extents for each PV. Online DLC 1. Determine which physical volume is over-provisioned and decide what the new (smaller) PV size will be.
1. Use the vgmodify review mode to verify there is enough free space on all of the physical volumes to reconfigure them to the desired maximum VG size. The vgmodify command checks for free extents at the ends of the PVs that it can utilize, and also checks for free space resulting from prior LUN expansions. You must provide the –E option and the –S option for review mode to check for LUN expansions.
Online DLE examples Online DLE where all additional disk space can be allocated This example assumes a volume group with three 100 GB disks on which one logical volume with three mirrors has used up all of the extents. You need to double the size of the logical volume to make room for more data. Therefore, you plan to double the size of each of the three LUNs from 100 GB to 200 GB. 1. Review current volume group and LUN attributes.
SCSI describe of /dev/rdisk/disk48: … size: 104857600 Kbytes 2. Runs a storage utility to expand the LUNs from 100 GB to 200 GB. 3. Verify the LUNs are larger with the diskinfo command as follows: # diskinfo /dev/rdisk/disk46 SCSI describe of /dev/rdisk/disk46: … size: 209715200 Kbytes … # diskinfo /dev/rdisk/disk47 SCSI describe of /dev/rdisk/disk47: … size: 209715200 Kbytes … # diskinfo /dev/rdisk/disk48 SCSI describe of /dev/rdisk/disk48: … size: 209715200 Kbytes 4.
Reconfiguration to expand physical volume "/dev/disk/disk48" succeeded. Previous number of extents: 12790 Number of extents after reconfiguration: 25590 Physical volume "/dev/disk/disk48" was changed. Volume Group configuration for /dev/vg1 has been saved in /etc/lvmconf/vg1.conf 6.
Alloc PE Free PE … VG Version VG Max Size VG Max Extents --- Logical volumes --LV Name LV Status LV Size (Mbytes) Current LE Allocated PE Used PV --- Physical volumes --PV Name PV Status Total PE Free PE … 76770 0 2.
Used PV 2 --- Physical volumes --PV Name PV Status Total PE Free PE ... /dev/disk/disk46 available 25598 0 PV Name /dev/disk/disk47 PV Status available Total PE 25598 Free PE 0 2. Run a storage utility to expand the LUNs from 200 GB to 300 GB. 3. Verify the LUN expansion. # diskinfo /dev/rdisk/disk46 SCSI describe of /dev/rdisk/disk46: … size: 314572800 Kbytes … # diskinfo /dev/rdisk/disk47 SCSI describe of /dev/rdisk/disk47: … size: 314572800 Kbytes 4.
LV Name LV Status LV Size (Mbytes) Current LE Allocated PE Used PV /dev/vg1/lvol1 available/syncd 204784 25598 51196 2 --- Physical volumes --PV Name PV Status Total PE Free PE ... /dev/disk/disk46 available 38398 12800 PV Name /dev/disk/disk47 PV Status available Total PE 25598 Free PE 0 7. Run online vgmodify in review mode to verify that the second PV requires reconfiguration for the DLE and to check the number of new extents to be added.
Allocated PE Used PV 51196 2 --- Physical volumes --PV Name PV Status Total PE Free PE ... /dev/disk/disk46 available 38398 12800 PV Name PV Status Total PE Free PE /dev/disk/disk47 available 25602 4 To use the extra space on /dev/disk/disk47, you must increase the maximum VG size from 500 GB to a larger value, as described in the following example.
38396 free 00000 38397 free 00000 2. Run online vgmodify in review mode to verify if the physical volumes can be reconfigured to the new (larger) maximum VG size 8TB. # vgmodify -r -a -E -S 8t vg1 Physical volume "/dev/disk/disk46" requires reconfiguration to be provisioned to the requested maximum volume group size 8388608 MB.
The maximum volume group size for "/dev/vg1" has been increased from 512000 MB to 8388608 MB. Volume Group configuration for /dev/vg1 has been saved in /etc/lvmconf/vg1.conf 4. Run vgdisplay –v to view the results. # vgdisplay –v vg1 --- Volume groups --VG Name ... PE Size (Mbytes) Total PE Alloc PE Free PE ... VG Version VG Max Size VG Max Extents --- Logical volumes --LV Name LV Status LV Size (Mbytes) Current LE Allocated PE Used PV /dev/vg1 8 76792 51196 25596 2.
VG Version VG Max Size VG Max Extents 2.1 8t 1048576 --- Logical volumes --LV Name LV Status LV Size (Mbytes) Current LE Allocated PE Used PV /dev/vg1/lvol1 available/syncd 307168 38396 76792 2 --- Physical volumes --PV Name PV Status Total PE Free PE ...
# diskinfo /dev/rdisk/disk46 SCSI describe of /dev/rdisk/disk46: … size: 419430400 Kbytes … # diskinfo /dev/rdisk/disk47 SCSI describe of /dev/rdisk/disk47: … size: 419430400 Kbytes 4. Run online vgmodify in review mode to verify that the maximum VG size can be increased from 8 TB to 128 TB if reprovisioning (-S) is performed in combination with DLE (-E).
increased from 8388608 MB to 134217728 MB. Volume Group configuration for /dev/vg1 has been saved in /etc/lvmconf/vg1.conf 6. Verify the increased maximum VG size. # vgdisplay –v vg1 --- Volume groups --VG Name ... PE Size (Mbytes) Total PE Alloc PE Free PE ... VG Version VG Max Size VG Max Extents --- Logical volumes --LV Name LV Status LV Size (Mbytes) Current LE Allocated PE Used PV /dev/vg1 8 102332 76792 25540 2.
Physical volume "/dev/disk/disk46" was not changed. Physical volume "/dev/disk/disk47" requires reconfiguration to be provisioned to the requested maximum volume group size 268435456 MB. Current number of extents: 51166 Number of extents after reconfiguration: 51133 The physical volume "/dev/disk/disk47" can be reconfigured to the new maximum volume group size 135712104 MB without removing free extents from the end of the physical volume.
LV Status LV Size (Mbytes) Current LE Allocated PE Used PV available/syncd 307168 38396 76792 2 --- Physical volumes --PV Name PV Status Total PE Free PE ... /dev/disk/disk46 available 51133 12737 PV Name PV Status Total PE Free PE 4. Expand the logical volume to make use of /dev/disk/disk47 available 51133 12737 the additional extents. # lvextend –l 51133 /dev/vg1/lvol1 Logical volume "/dev/vg1/lvol1" has been successfully extended.
example, you want to unmirror the logical volume and use the pvmove command to move half of the extents from the first PV to the second PV to allow both LUNs to be contracted. 1. Unmirror the logical volume. # lvreduce -m 0 /dev/vg1/lvol1 Logical volume "/dev/vg1/lvol1" has been successfully reduced. Volume Group configuration for /dev/vg1 has been saved in /etc/lvmconf/vg1.conf 2. Review the results. # lvdisplay -v /dev/vg1/lvol1 --- Logical volumes --LV Name /dev/vg1/lvol1 ... Mirror copies 0 ...
Free PE ... 0 PV Name PV Status Total PE Free PE /dev/disk/disk47 available 51133 51133 All extents on the second PV are now free. 3. Run online vgmodify in review mode to verify if the first PV can be contracted. # vgmodify -r -a -C 200g vg1 /dev/rdisk/disk46 vgmodify: Error: Cannot prepare physical volume "/dev/rdisk/disk46" for contraction to the requested size 204800 MB without moving extent(s).
00000 00001 00002 *Entries 25530 25531 25532 25533 25534 25535 *Entries 51130 51131 51132 current /dev/vg1/lvol1 current /dev/vg1/lvol1 current /dev/vg1/lvol1 deleted for brevity current /dev/vg1/lvol1 current /dev/vg1/lvol1 current /dev/vg1/lvol1 free free free deleted for brevity free free free 00000 00001 00002 25530 25531 25532 00000 00000 00000 00000 00000 00000 # pvdisplay -v /dev/disk/disk47 --- Physical volumes --PV Name /dev/disk/disk47 VG Name /dev/vg1 ...
LV Size (Mbytes) Current LE Allocated PE Used PV 409064 51133 51133 2 --- Physical volumes --PV Name PV Status Total PE Free PE ... /dev/disk/disk46 available 51133 25600 PV Name /dev/disk/disk47 PV Status available Total PE 51133 Free PE 25533 7. Retry vgmodify in review mode on the first PV to verify that it can now be prepared for contraction to 200 GB.
25530 current 25531 current 25532 current /dev/vg1/lvol1 /dev/vg1/lvol1 /dev/vg1/lvol1 # vgdisplay –v vg1 --- Volume groups --VG Name ... PE Size (Mbytes) Total PE Alloc PE Free PE ... VG Version VG Max Size VG Max Extents 25530 25531 25532 /dev/vg1 8 76666 51133 25533 2.1 256t 33554432 --- Logical volumes --LV Name LV Status LV Size (Mbytes) Current LE Allocated PE Used PV --- Physical volumes --PV Name PV Status Total PE Free PE ... PV Name PV Status Total PE Free PE 10.
Physical volume "/dev/rdisk/disk47" was not changed. 2. Run vgmodify in change mode to prepare the second PV for contraction. # vgmodify -a -C 300g vg1 /dev/rdisk/disk47 Reconfiguration to contract physical volume "/dev/rdisk/disk47" to requested size 307200 MB succeeded. Previous number of extents: 51133 Number of extents after reconfiguration: 38333 Physical volume "/dev/rdisk/disk47" was changed. Volume Group configuration for /dev/vg1 has been saved in /etc/lvmconf/vg1.conf 3. Verify the results.
LV Size (Mbytes) Current LE Allocated PE Used PV 409064 51133 51133 2 --- Physical volumes --PV Name PV Status Total PE Free PE ... /dev/disk/disk46 available 25533 0 PV Name /dev/disk/disk47 PV Status available Total PE 38333 Free PE 12733 4. Run a storage utility to contract the second PV from 400 GB to 300 GB. 5. Verify that the LUN is smaller.
3. Run vgmodify in change mode to decrease the maximum VG size to 64 TB. # vgmodify -a -S 64t vg1 Reconfiguration of physical volume "/dev/disk/disk46" for the requested maximum volume group size 67108864 MB succeeded. Previous number of extents: 25533 Number of extents after reconfiguration: 25582 Physical volume "/dev/disk/disk46" was changed. The maximum volume group size for "/dev/vg1" has been decreased from 268435456 MB to 67108864 MB.
• Physical volume "/dev/disk/disk46" requires reconfiguration for expansion. In review mode, for a DLE operation, vgmodify reports that the physical volume was expanded by at least one extent, and that reconfiguration of the physical volume is required to make use of the extra space • The physical volume "/dev/disk/disk48" does not need to be reconfigured for expansion since the available disk space is less than the size of one extent.
• Reconfiguration of physical volume "/dev/disk/disk46" for the requested maximum volume group size 8388608 MB succeeded. In change mode for either maximum VG size increase or decrease, vgmodify successfully reconfigured the physical volume to the requested size. • The physical volume "/dev/disk/disk46" can be reconfigured to the new maximum volume group size 3623256 MB without removing free extents from the end of the physical volume.
• Physical volume "/dev/rdisk/disk46" requires reconfiguration for contraction to requested size 204800 MB. In review mode, for a DLC operation, vgmodify reports that a physical volume can be prepared for contraction to the specified size. • The physical volume "/dev/rdisk/disk46" can be reconfigured for contraction to a minimum size of 204793 MB by removing free extents from the end of the physical volume.
For More Information To learn more about LVM and HP-UX system administration, refer to the following documents on the HP documentation website (http://docs.hp.com): • HP-UX System Administrator’s Guide: Logical Volume Management http://docs.hp.com/en/5992-4589/5992-4589.pdf • The LVM White Papers listed below are available at the HP documentation website: http://www.docs.hp.