Installation guide

Chapter 4. LVM Administration with CLI Commands
30
4.3.8. Activating and Deactivating Volume Groups
When you create a volume group it is, by default, activated. This means that the logical volumes in
that group are accessible and subject to change.
There are various circumstances for which you need to make a volume group inactive and thus
unknown to the kernel. To deactivate or activate a volume group, use the -a (--available)
argument of the vgchange command.
The following example deactivates the volume group my_volume_group.
# vgchange -a n my_volume_group
If clustered locking is enabled, add ’e’ to activate or deactivate a volume group exclusively on one
node or ’l’ to activate or/deactivate a volume group only on the local node. Logical volumes with single-
host snapshots are always activated exclusively because they can only be used on one node at once.
You can deactivate individual logical volumes with the lvchange command, as described in
Section 4.4.8, “Changing the Parameters of a Logical Volume Group”, For information on activating
logical volumes on individual nodes in a cluster, see Section 4.7, “Activating Logical Volumes on
Individual Nodes in a Cluster”.
4.3.9. Removing Volume Groups
To remove a volume group that contains no logical volumes, use the vgremove command.
# vgremove officevg
Volume group "officevg" successfully removed
4.3.10. Splitting a Volume Group
To split the physical volumes of a volume group and create a new volume group, use the vgsplit
command.
Logical volumes cannot be split between volume groups. Each existing logical volume must be entirely
on the physical volumes forming either the old or the new volume group. If necessary, however, you
can use the pvmove command to force the split.
The following example splits off the new volume group smallvg from the original volume group
bigvg.
# vgsplit bigvg smallvg /dev/ram15
Volume group "smallvg" successfully split from "bigvg"
4.3.11. Combining Volume Groups
To combine two volume groups into a single volume group, use the vgmerge command. You can
merge an inactive "source" volume with an active or an inactive "destination" volume if the physical