NAME
vgmodify — handle physical volume size changes and modify configuration parameters of an existing LVM volume group
SYNOPSIS
Set Specified Parameters
/usr/sbin/vgmodify
[-B
bootable]
[-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
[-B
bootable]
[-r]
[-v]
vg_name
[pv_path...]
Display a Table of Optimized Possible Volume Group Settings
/usr/sbin/vgmodify
-t
[-B
bootable]
[-n]
[-v]
vg_name
[pv_path...]
Remarks
If
vgmodify
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 must used to accomplish this.
To apply the new configuration, 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
The root/boot volume group must be booted into maintenance mode before
making changes (see
boot(1M)).
The volume group must be removed from membership in a high availability
cluster before making changes (see
vgchange(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.
In general, a smaller number of physical volumes allows a larger number
of physical extents.
Likewise, a larger number of physical volumes
constrains to a smaller number of physical extents.
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.
The changing of physical volume type (boot to non-boot and vice versa)
is selected via the
-B
option and by specifying a list of physical volumes.
Otherwise no physical volume type changes are performed.
DESCRIPTION
The
vgmodify
command allows the user to modify an existing volume group
(vg_name).
The following changes can be performed:
Detect and handle physical volume size changes.
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).
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.
All the physical volumes associated with the volume group must
be available for the
vgmodify
command to succeed.
The volume group can be active when reporting the configuration
(-r)
or displaying a table of available settings
(-t).
The volume group must be de-activated before
vgmodify
can perform any configuration changes (see
vgchange(1M)).
If the command is interrupted before it completes, recovery steps
might be required.
See the
Remarks
section for details.
Options and Arguments
The
vgmodify
command recognizes the following options and arguments:
- vg_name
The path name of a volume group.
- pv_path
The character (raw) device path name of a physical volume that will
become bootable or non-bootable based on the
-B
option.
If type changes are not required then the
pv_path
list must be empty and the
-B
option must not be used.
- -B bootable
Make the physical volumes specified in the
pv_paths
list bootable or non-bootable.
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).
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.
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)).
- -e max_pe
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
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
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
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.
- -p max_pv
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
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.
- -t
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.
-t
is normally used to obtain the arguments for future
vgmodify
command
-e
and/or
-p
options.
- -v
Verbose.
Be verbose in reporting.
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
Successful completion.
- >0
Error condition occurred.
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:
Show a table of optimal possible settings for the volume group taking
advantage of extent renumbering if possible:
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:
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
Verbosely review (do not change) the impact of optimizing the volume
group settings:
vgmodify -v -r -o /dev/vg02
Verbosely apply the changes that will result from optimizing the volume
group settings:
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
WARNINGS
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 /etc/lvmconf/VG.conf
to view the settings in the file.
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.
SEE ALSO
boot(1M),
lvlnboot(1M),
mkboot(1M),
pvcreate(1M),
pvmove(1M),
vgcfgbackup(1M),
vgcfgrestore(1M),
vgchange(1M),
vgcreate(1M),
vgdisplay(1M),
vgextend(1M),
vgreduce(1M),
lvm(7).