vgmodify vgmodify

vgmodify(1M)
vgmodify(1M)
NAME
vgmodify - handle physical volume size changes and modify configuration parameters of an existing LVM
volume group
SYNOPSIS
vgmodify Options for Volume Groups Version 1.0
Set Specified Parameters and Account for Dynamic LUN Expansion
/usr/sbin/vgmodify [-a] [-e max_pe ] [-l max_lv ] [-n] [-p max_pv ] [-r] [-v] vg_name
/usr/sbin/vgmodify -B bootable [-a] [-e max_pe ] [-l max_lv ] [-n] [-p max_pv ] [-r] [-v]
vg_name pv_path ...
/usr/sbin/vgmodify -E -a [-e max_pe ] [-l max_lv ] [-n] [-p max_pv ] [-r] [-v] vg_name
[pv_path ...]
Optimize the Volume Group Settings
/usr/sbin/vgmodify -o [-a] [-r] [-v] vg_name
/usr/sbin/vgmodify -o -B bootable [-a] [-r] [-v] vg_name pv_path ...
/usr/sbin/vgmodify -o -E -a [-r] [-v] vg_name [pv_path ...]
Prepare a Physical Volume for Dynamic LUN Contraction
/usr/sbin/vgmodify [-a] [-r] -C dlc_size vg_name pv_path
Display a Table of Optimized Possible Volume Group Settings
/usr/sbin/vgmodify -t [-n] [-v] vg_name
/usr/sbin/vgmodify -t -B bootable [-n] [-v] vg_name pv_path ...
Recover a Physical Volume from a Previous vgmodify Failure
/usr/sbin/vgmodify -R vg_conf_path vg_name pv_path ...
vgmodify Options for Activated Volume Groups Version 2.0 and Higher
Reconfigure a Volume Group to Account for Dynamic LUN Expansion
/usr/sbin/vgmodify [-r] -a -E vg_name [pv_path ...]
Prepare a Physical Volume for Dynamic LUN Contraction
/usr/sbin/vgmodify [-r] -a -C dlc_size vg_name pv_path
Reconfigure a Volume Group to a New Maximum Volume Group Size
/usr/sbin/vgmodify [-r] [-E] -a -S vg_size vg_name
DESCRIPTION
The vgmodify command allows the user to modify an existing volume group (vg_name ).
A
The modifications that vgmodify can perform depend on the version of the volume group and whether
or not the volume group is activated.
The following changes can be performed for volume groups version 1.0:
•
Detect and handle physical volume size changes.
If the volume group is activated, the -E option of vgmodify must be specified to take advantage of
increased physical volume sizes.
If the volume group is deactivated, vgmodify will implicitly handle increased physical volume sizes.
•
Prepare a physical volume for a LUN contraction (dlc_size setting).
•
Modify the maximum number of physical extents that can be allocated per physical volume (max_pe
setting) (see vgcreate (1M) -e).
•
Modify the maximum number of physical volumes that the volume group can contain (max_pv setting)
(see vgcreate (1M) -p).
HP-UX 11i Version 3: September 2011
−1−
Hewlett-Packard Company
1
vA
vgmodify(1M)
vgmodify(1M)
•
Modify the maximum number of logical volumes that the volume group can contain (max_lv setting)
(see vgcreate (1M) -l).
•
Change a physical volume type from boot to non-boot or vice versa (see pvcreate (1M) -B). Note that
making a physical volume non-bootable will increase the space available on that device for LVM
configuration data. However, even a single bootable physical volume in the volume group will restrict
the max_pv and max_pe settings available.
For volume groups version 1.0, all the physical volumes associated with the volume group must be available for the vgmodify command to succeed. Also, if the command is interrupted before it completes,
recovery steps might be required. See the Remarks section for details.
The following changes can be performed for volume groups version 2.0 and higher:
•
Detect and handle physical volume size changes.
The -E option must be specified to take advantage of increased physical volume size.
•
Prepare a physical volume for a LUN contraction (dlc_size setting).
•
Modify the maximum volume group size (vg_size setting) (see vgcreate (1M) -S).
For volume groups version 2.0 and higher, vgmodify is allowed only when the volume group is in an
activated state.
Options and Arguments
The vgmodify command recognizes the following arguments and options:
vg_name
The path name of a volume group.
pv_path
The character (raw) device path name of a physical volume. Refer to the -B,
-E, -C, and -R options for the physical volume list usage.
-a
Perform volume group reconfiguration when the volume group is activated.
This option is required if the volume group is activated. The command will
fail if this option is used on a deactivated volume group. For version 1.0
volume groups, this option is ignored when used with the -t, -r, and -R
options.
-B bootable
Applicable to volume groups version 1.0 only. Make the physical volumes
specified in the pv_path s list bootable or non-bootable. The -B option is mutually exclusive with the -E and -C options.
bootable can have one of the following values:
y
Change pv_path list from non-bootable to bootable.
n
Change pv_path list from bootable to non-bootable.
See the description of the -B option in pvcreate (1M).
A
Making a physical volume non-bootable will increase the space available on
that device for LVM configuration data. However to fully use that space all
the physical volumes in the volume group should be non-bootable. A single
bootable physical volume in the volume group will restrict the available
configuration settings.
vA
A physical volume can only be made bootable if either all extents on it are
unused or it was previously converted from a bootable device and the space is
still unused.
If a physical volume is being made bootable then use lvlnboot and mkboot
to complete the process (see lvlnboot (1M) and mkboot (1M)).
-C dlc_size
Prepare the physical volume for LUN contraction to dlc_size. Exactly one
pv_path must be specified with the -C option. The -C option cannot be used
in conjunction with any other option except for -a and -r.
The unit for dlc_size is specified as a suffix. The recognized values for the
suffix are m (megabytes), g (gigabytes), t (terabytes), and p (petabytes). If no
suffix is supplied, then m (megabytes) is assumed. A dlc_size of 512 terabytes
would be specified as 512t. Only whole numbers are accepted.
2
Hewlett-Packard Company
−2−
HP-UX 11i Version 3: September 2011
vgmodify(1M)
vgmodify(1M)
The size should be at least 1 megabyte, and no greater than a volume group
version dependent maximum; use the lvmadm command to determine the
maximum size for a physical volume.
-E
Reconfigure an activated volume group to take advantage of physical volume
size increase. This option must be used with the -a option. The -E option
cannot be used in conjunction with the -C and -B options.
If pv_path is not specified, vgmodify will account for size increase of all physical volumes in the volume group.
-e max_pe
Applicable to volume groups version 1.0 only. Set the maximum number of
physical extents that can be allocated from any of the physical volumes in the
volume group (see vgcreate (1M) -e).
The maximum number of physical extents can range from the current highest
physical extent in use on any physical volume in the volume group (1 if none
in use) up to 65535.
The -t option displays a table of possible max_pe values for vg_name .
-l max_lv
Applicable to volume groups version 1.0 only. Set the maximum number of
logical volumes that the volume group is allowed to contain (see vgcreate (1M)
-l).
The maximum number of logical volumes can range from the current highest
logical volume number in use (1 if none in use) to 255.
Note that changing this value has little impact on the size of the LVM
configuration data.
-n
Applicable to volume groups version 1.0 only. Allow renumbering of physical
extents on physical volumes. This only applies to physical volumes that have
allocated extents. By default, physical extent numbers will be unchanged by
vgmodify.
Renumbering physical extents changes the allocation of the first physical
extent, if it is free, from user to LVM configuration data and vice-versa. This
will often have a considerable impact on the space available for the LVM
configuration data on each physical volume and, therefore, the possible settings for the volume group parameters.
No user data is moved during that process, only the LVM numbering of physical extents changes.
When the first extent is being reallocated from user to LVM configuration
data, the physical extent numbers are decreased. This will only occur if the
first extent is free. For example a logical volume using physical extents 10 to
20 from a physical volume that has its first extent reallocated to LVM
configuration data will use the physical extents 9 to 19 after the modification.
User data is not moved.
When the first extent is being reallocated from LVM configuration to user
data, the physical extent numbers are increased. For example a logical
volume using physical extents 10 to 20 from a physical volume that has its
first extent re-allocated to user data will use the physical extents 11 to 21 after
the modification. User data is not moved.
Not all configurations allow renumbering. If this is the case then an error will
be reported and a recommendation to rerun without the -n option will be
given.
-o
Applicable to volume groups version 1.0 only. Optimize the volume group settings. The maximum number of extents and physical volumes are adjusted
upwards, where possible, to make full use of the space reserved on each physical volume for the LVM configuration data.
This option cannot be used in conjunction with -l, -p, -n, -t, or -e.
Note: If renumbering is necessary, then rerun with -e and -p rather than -o.
HP-UX 11i Version 3: September 2011
−3−
Hewlett-Packard Company
3
A
vA
vgmodify(1M)
-p max_pv
vgmodify(1M)
Applicable to volume groups version 1.0 only. Set the maximum number of
physical volumes that the volume group is allowed to contain (see
vgcreate (1M) -p). The maximum number of physical volumes can range from
the current number of physical volumes in the volume group to 255.
The -t option displays a table of possible max_pv values for vg_name .
-R vg_conf_file
Applicable to volume groups version 1.0 only. Recover from a previous vgmodify that either failed or was interrupted. The configuration in the
vg_conf_file will be restored onto the pv_path list given.
-r
Report the effect of the other options being used. No changes will be made to
the volume group.
This option can be used on an active volume group.
-S vg_size
Only applicable to volume groups version 2.0 and higher. Changes the maximum size of the volume group. The unit for vg_size is specified as a suffix.
The recognized values for the suffix are m (megabytes), g (gigabytes), t (terabytes), and p (petabytes). If no suffix is supplied, then m (megabytes) is
assumed. A vg_size of 512 terabytes would be specified as 512t. Only whole
numbers are accepted.
-t
Applicable to volume groups version 1.0 only. Produce a table showing the
optimal possible settings (max_pe , max_pv , and maximum disk size) for the
volume group.
This option can be used with and without -n to see a complete list of possible
optimal settings. In certain cases the optimal settings will not be influenced
by the extent renumbering (-n) and a suitable message will then be reported.
Where adjacent max_pv values allow the same highest max_pe , only the
highest max_pv is displayed; therefore, there may be gaps in the table. It is
still possible to set a lower max_pv or max_pe than shown in the table but
some of the LVM configuration space will not be used.
This option can be used with -a to see a list of optimal settings applicable
when configuration parameters need to be modified while the volume group is
activated. See the Remarks for Volume Groups Version 1.0 section below.
-t is normally used to obtain the arguments for future vgmodify command
-e and/or -p options.
-v
Applicable to volume groups version 1.0 only. Verbose. Be verbose in reporting.
Remarks for Volume Groups Version 1.0
• This command can be run on volume groups version 1.0 that are deactivated or activated in standalone or exclusive mode only. The command will fail on volume groups activated in shared mode.
A
•
vA
If vgmodify of a volume group is interrupted while it is committing the configuration changes onto
the disks, it may be necessary to re-apply the configuration to all the physical volumes. The
/etc/lvmconf/VG_restore script or the -R option must be used to accomplish this. For a deactivated volume group, to apply the new configuration using the restore script enter the following:
/etc/lvmconf/VG_restore /etc/lvmconf/VG.conf
Or to apply the old/original configuration, enter the following:
/etc/lvmconf/VG_restore /etc/lvmconf/VG.conf.old
For an activated volume group, the configuration file used with the restore script, or with the -R
option, should correspond to the configuration of the volume group before vgmodify was run.
4
•
The root/boot volume group must be booted into maintenance mode before making changes (see
boot (1M)).
•
If a volume group has any cluster lock physical volume, all reconfiguration and disk resize operations
will fail, with one exception. A disk resize operation on a physical volume in an activated volume
group will succeed if that specific physical volume does not have a cluster lock.
Hewlett-Packard Company
−4−
HP-UX 11i Version 3: September 2011
vgmodify(1M)
vgmodify(1M)
•
To expand the LVM configuration data to its maximum size, it may be necessary to reallocate the first
physical extent from each physical volume from user to LVM configuration data. This will only be possible if the first extent is made free (see pvmove (1M)) and PE renumbering is enabled via the -n
option.
•
The LVM configuration data size is limited to the volume group extent size. Therefore, a maximum of
one physical extent from each physical volume can be reallocated from user data regardless of how
many times vgmodify is used on the volume group.
•
The attributes of an lvmconf file can be viewed using the -v option of vgcfgrestore (see
vgcfgrestore (1M)).
•
To take advantage of a physical volume size increase, it may be necessary to run vgmodify to
increase the maximum number of physical extents for the volume group. For a deactivated volume
group, the vgmodify command will implicitly consider the physical volume size increase. But for an
activated volume group, the -E option should be used for vgmodify to consider the physical volume
size increase.
•
In general, a smaller number of physical volumes allows a larger number of physical extents. Likewise, a larger number of physical volumes constraints to a smaller number of physical extents.
•
For a deactivated volume group, the detection of physical volume size changes (LUN size expansion or
contraction) is automatic, with the handling taking place unless the -r or -t options have been used.
•
For an activated volume group, the detection of a physical volume size increase (LUN size expansion)
is not automatic. Instead, the -E option should be used for vgmodify to detect and handle the physical volume size increase.
•
When used with the -r option, the -C option reports if the physical volume can be prepared for contraction to the specified size. If not, it displays the number of extents that need to be freed up on physical volume before it can be prepared for contraction to the specified size. In addition, it reports the
smallest size to which the physical volume can be prepared for contraction without performing any
pvmove operations on it, and the smallest size to which the physical volume can be prepared for contraction after compacting all the allocated physical extents on it by moving them up.
•
The changing of physical volume type (boot to non-boot or vice verse) is selected via the -B option and
by specifying a list of physical volumes. Otherwise, no physical volume type changes are performed.
•
For an activated volume group, the -B, -C, and the -E options are mutually exclusive, since the physical volume list for the -B option is the list of the physical volumes to change from boot to non-boot or
vice versa. The physical volume list for the -E and -C options is the list of physical volumes to consider for increase and decrease in disk size, respectively.
•
When used with the -a option, the lower limit of max_pv is one more than the highest pvkey in use.
When holes exist in the used pvkey ranges due to previously executed vgreduce operations and
max_pv needs to be reduced below this lower limit in order to compact the pvkeys , the volume group
will need to be deactivated before running vgmodify. The possible set of values for max_pv when
the volume group is activated can be obtained using the -a option along with -t.
Remarks for Volume Groups Version 2.0 and Higher
• This command can be run on volume groups version 2.0 and higher that are activated in standalone or
exclusive mode. It can also run on volume groups activated in shared mode if they are 2.1 or higher.
In the case of a shared volume group, the command must be issued on the server and the lvmpud
daemon must be running on all the nodes sharing the volume group. See lvmpud (1M).
•
If vgmodify is interrupted while it is reconfiguring the physical volumes, or if the command fails,
then the volume group is left in a consistent state (no special recovery is needed). To retry the vgmodify operation, run the vgmodify command with the desired options, and LVM will continue with
the reconfiguration.
•
vgmodify will fail if the volume group has a cluster lock physical volume.
•
The detection of a physical volume size increase (LUN size expansion) is not automatic. Instead, the
-E option should be used to detect and handle the physical volume size increase.
•
When used with the -r option, the -C option reports if the physical volume can be prepared for contraction to the specified size. If not, it displays the number of extents that need to be freed up on physical volume before it can be prepared for contraction to the specified size. In addition, it reports the
smallest size to which the physical volume can be prepared for contraction by removing all free extents
on the physical volume.
HP-UX 11i Version 3: September 2011
−5−
Hewlett-Packard Company
5
A
vA
vgmodify(1M)
•
vgmodify(1M)
When used with the -r option, the -S option reports if the volume can be reconfigured to the specified
volume group size. If not, it displays the number of extents that need to be freed up on each physical
volume before the volume group size can be reconfigured. In addition it reports the largest volume
group size possible for each physical volume, and the largest volume group size possible when removing free extents.
EXTERNAL INFLUENCES
Environment Variables
LANG determines the language in which messages are displayed.
If LANG is not specified or is null, it defaults to "C" (see lang (5)).
If any internationalization variable contains an invalid setting, all internationalization variables default
to "C" (see environ (5)).
RETURN VALUE
vgmodify returns one of the following values:
0
>0
Successful completion.
Error condition occurred.
EXAMPLES
Examples For a Volume Group Version 1.0
The volume group version 1.0 /dev/vg02 is deactivated in the following examples.
Review the effect of setting a maximum of 6 physical volumes in the volume group:
vgmodify -p 6 -r /dev/vg02
Set a maximum of 4000 physical extents per physical volume and a maximum of 50 physical volumes, and
take advantage of extent renumbering if possible:
vgmodify -p 50 -e 4000 -n /dev/vg02
Show a table of optimal possible settings for the volume group:
vgmodify -t /dev/vg02
Show a table of optimal possible settings for the volume group taking advantage of extent renumbering if
possible:
vgmodify -t -n /dev/vg02
Show a table of optimal possible settings for the volume group, making the physical volume
/dev/rdsk/c1t2d0 non-bootable:
vgmodify -t -B n /dev/vg02 /dev/rdsk/c1t2d0
Review (do not change) the effect of choosing a maximum of 16 physical volumes, 8000 physical extents
per physical volume, while making /dev/rdsk/c1t2d0 non-bootable (these values were selected from
the table above) and be verbose:
A
vA
vgmodify -p 16 -e 8000 -v -r -B n /dev/vg02 /dev/rdsk/c1t2d0
Apply the settings just reviewed:
vgmodify -p 16 -e 8000 -v -B n /dev/vg02 /dev/rdsk/c1t2d0
If the vgmodify command is interrupted, restore the new configuration to all physical volumes in the
volume group by entering:
/etc/lvmconf/vg02_restore /etc/lvmconf/vg02.conf
The volume group version 1.0 /dev/vg02 is activated in the following examples.
Add extents to the physical volume /dev/rdsk/c2t2d0 that has been expanded by dynamic LUN
expansion:
vgmodify -a -E /dev/vg02 /dev/rdsk/c2t2d0
Use the review option to determine if the physical volume /dev/rdsk/c2t2d0 can be prepared for
LUN contraction to 4000 MB:
vgmodify -a -r -C 4000 /dev/vg02 /dev/rdsk/c2t2d0
6
Hewlett-Packard Company
−6−
HP-UX 11i Version 3: September 2011
vgmodify(1M)
vgmodify(1M)
Apply the LUN contraction setting that was just reviewed:
vgmodify -a -C 4000 /dev/vg02 /dev/rdsk/c2t2d0
Examples For a Volume Group Version 2.0 or Higher
The volume group version 2.0 /dev/vg03 is activated in the following examples.
Add extents to the physical volume /dev/rdisk/disk10 that has been expanded by dynamic LUN
expansion:
vgmodify -a -E /dev/vg03 /dev/rdisk/disk10
Prepare physical volume /dev/rdisk/disk10 for LUN contraction to size 4000 MB:
vgmodify -a -C 4000 /dev/vg03 /dev/rdisk/disk10
Use the review option to determine if the volume group size can be increased to 256 terabytes:
vgmodify -a -r -S 256t /dev/vg03
Apply the volume group size increase that was just reviewed:
vgmodify -a -S 256t /dev/vg03
Increase the maximum size of the volume group to 256 terabytes, and also check if any physical volumes
have been expanded by a dynamic LUN expansion:
vgmodify -a -E -S 256t /dev/vg03
Decrease the volume group size to 2 terabytes, to free up extents on the physical volumes:
vgmodify -a -S 2t /dev/vg03
WARNINGS
• Applicable to volume group version 1.0 only. Changing the type of a bootable physical volume will
prevent booting from this device and, therefore, may create an unbootable system.
•
Do not restore a physical volume from a backup file (lvmconf) produced prior to the latest vgmodify changes. Doing so will result in attempts to attach the device to the volume group failing and
may lead to activation failures. If there is any doubt about the configuration in the lvmconf file, use
vgcfgrestore -lv -f lvmconf_file_path to view the settings in the file.
•
Applicable to volume group version 1.0 only. If the vgmodify command is interrupted prior to completing its operation, then restoration to all physical volumes in the volume group may be required.
Use the restore script to accomplish this (see the Remarks section for more information).
FILES
/etc/lvmconf/VG.conf
Holds the latest (new) configuration for the volume group.
/etc/lvmconf/VG.conf.old
If vgmodify completes successfully, this file contains the same new configuration as
/etc/lvmconf/VG.conf. If vgmodify was interrupted, this file contains the previous (old)
configuration.
/etc/lvmconf/VG_restore
A script created by vgmodify before making any update, to be used if the vgmodify command is
interrupted while committing the configuration changes to the physical volumes. See the Remarks
section for its usage.
Notes
By default, lvmconf files are stored in the /etc/lvmconf path. However this default path can be
altered by the LVMP_CONF_PATH_NON_BOOT variable in the /etc/lvmrc file for non-bootable volume
groups, with version 2.0 or greater. See vgcfgbackup (1M) for more details.
SEE ALSO
boot(1M), lvlnboot(1M), lvmpud(1M), mkboot(1M), pvcreate(1M), pvmove(1M), vgcfgbackup(1M),
vgcfgrestore(1M), vgchange(1M), vgcreate(1M), vgdisplay(1M), vgextend(1M), vgreduce(1M), lvm(7).
HP-UX 11i Version 3: September 2011
−7−
Hewlett-Packard Company
7
A
vA
(Notes)
A
(Notes)
vA
8
Hewlett-Packard Company
−1−
HP-UX 11i Version 3: September 2011