Sie sind auf Seite 1von 8

vgmodify(1M)

vgmodify(1M)

NAME vgmodify - handle physical volume size changes and modify conguration parameters of an existing LVM volume group SYNOPSIS vgmodify Options for Volume Groups Version 1.0 Set Specied 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 Recongure 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


Recongure 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 ). The modications 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 specied 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). 1 Hewlett-Packard Company 1

HP-UX 11i Version 3: September 2010

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 conguration 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 specied 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 pv_path The path name of a volume group. 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. Perform volume group reconguration 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. Applicable to volume groups version 1.0 only. Make the physical volumes specied 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:

-a

-B bootable

y n

Change pv_path list from non-bootable to bootable. 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 conguration 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 conguration 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)).

-C dlc_size

Prepare the physical volume for LUN contraction to dlc_size. Exactly one pv_path must be specied 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 specied as a sufx. The recognized values for the sufx are m (megabytes), g (gigabytes), t (terabytes), and p (petabytes). If no sufx is supplied, then m (megabytes) is assumed. A dlc_size of 512 terabytes would be specied as 512t. Only whole numbers are accepted.

Hewlett-Packard Company

HP-UX 11i Version 3: September 2010

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

Recongure 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 specied, 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 conguration 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 rst physical extent, if it is free, from user to LVM conguration data and vice-versa. This will often have a considerable impact on the space available for the LVM conguration 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 rst extent is being reallocated from user to LVM conguration data, the physical extent numbers are decreased. This will only occur if the rst extent is free. For example a logical volume using physical extents 10 to 20 from a physical volume that has its rst extent reallocated to LVM conguration data will use the physical extents 9 to 19 after the modication. User data is not moved. When the rst extent is being reallocated from LVM conguration 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 rst extent re-allocated to user data will use the physical extents 11 to 21 after the modication. User data is not moved. Not all congurations 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 conguration 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 2010

Hewlett-Packard Company

vgmodify(1M)

vgmodify(1M)

-p max_pv

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 conguration in the vg_conf_le will be restored onto the pv_path list given. 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.

-r

-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 specied as a sufx. The recognized values for the sufx are m (megabytes), g (gigabytes), t (terabytes), and p (petabytes). If no sufx is supplied, then m (megabytes) is assumed. A vg_size of 512 terabytes would be specied as 512t. Only whole numbers are accepted. 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 inuenced 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 conguration space will not be used.

-t

-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. If vgmodify of a volume group is interrupted while it is committing the conguration changes onto the disks, it may be necessary to re-apply the conguration 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 conguration using the restore script enter the following:

/etc/lvmconf/VG_restore /etc/lvmconf/VG.conf
Or to apply the old/original conguration, enter the following:

/etc/lvmconf/VG_restore /etc/lvmconf/VG.conf.old
For an activated volume group, the conguration le used with the restore script, or with the -R option, should correspond to the conguration of the volume group before vgmodify was run. 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 reconguration 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 specic physical volume does not have a cluster lock. To expand the LVM conguration data to its maximum size, it may be necessary to reallocate the rst physical extent from each physical volume from user to LVM conguration data. This will only be possible if the rst extent is made free (see pvmove (1M)) and PE renumbering is enabled via the -n option. 4 HP-UX 11i Version 3: September 2010

Hewlett-Packard Company

vgmodify(1M)

vgmodify(1M)

The LVM conguration 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 le 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 specied 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 specied 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.

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 reconguring 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 reconguration.

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 specied 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 specied 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. When used with the -r option, the -S option reports if the volume can be recongured to the specied 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 recongured. 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

HP-UX 11i Version 3: September 2010

Hewlett-Packard Company

vgmodify(1M)

vgmodify(1M)

Environment Variables LANG determines the language in which messages are displayed. If LANG is not specied 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:

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 conguration 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


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: 6 Hewlett-Packard Company 6 HP-UX 11i Version 3: September 2010

vgmodify(1M)

vgmodify(1M)

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 le (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 conguration in the lvmconf le, use vgcfgrestore -lv -f lvmconf_le_path to view the settings in the le. 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) conguration for the volume group.

/etc/lvmconf/VG.conf.old If vgmodify completes successfully, this le contains the same new conguration as /etc/lvmconf/VG.conf. If vgmodify was interrupted, this le contains the previous (old)
conguration.

/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 conguration changes to the physical volumes. See the Remarks section for its usage. Notes By default, lvmconf les 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 le 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 2010

Hewlett-Packard Company

(Notes)

(Notes)

Hewlett-Packard Company

HP-UX 11i Version 3: September 2010

Das könnte Ihnen auch gefallen