vgchange
change attributes of a volume group
- Provided by: lvm2 (Version: 2.02.133-1ubuntu10)
- Report a bug
change attributes of a volume group
vgchange [--addtag Tag] [--alloc AllocationPolicy] [-A|--autobackup {y|n}] [-a|--activate [a|e|s|l] {y|n}] [--activationmode {complete|degraded|partial}] [-K|--ignoreactivationskip] [--monitor {y|n}] [--poll {y|n}] [-c|--clustered {y|n}] [-u|--uuid] [--commandprofile ProfileName] [-d|--debug] [--deltag Tag] [--detachprofile] [-h|--help] [--ignorelockingfailure] [--ignoremonitoring] [--ignoreskippedcluster] [--sysinit] [--noudevsync] [--lock-start] [--lock-stop] [--lock-type LockType] [-l|--logicalvolume MaxLogicalVolumes] [-p|--maxphysicalvolumes MaxPhysicalVolumes] [--metadataprofile ProfileName] [--[vg]metadatacopies] NumberOfCopies|unmanaged|all] [-P|--partial] [-s|--physicalextentsize PhysicalExtentSize[bBsSkKmMgGtTpPeE]] [-S|--select Selection] [--systemid SystemID] [--refresh] [-t|--test] [-v|--verbose] [--version] [-x|--resizeable {y|n}] [VolumeGroupName...]
vgchange allows you to change the attributes of one or more volume groups. Its main purpose is to activate and deactivate VolumeGroupName, or all volume groups if none is specified. Only active volume groups are subject to changes and allow access to their logical volumes. [Not yet implemented: During volume group activation, if vgchange recognizes snapshot logical volumes which were dropped because they ran out of space, it displays a message informing the administrator that such snapshots should be removed (see lvremove(8)). ]
See lvm(8) for common options.
With -aey, clvmd activates the LV in exclusive mode (with an exclusive lock), allowing a single node to activate the LV.
With -asy, clvmd activates the LV in shared mode (with a shared lock), allowing multiple nodes to activate the LV concurrently. If the LV type prohibits shared access, such as an LV with a snapshot, the 's' option is ignored and an exclusive lock is used.
With -ay (no mode specified), clvmd activates the LV in shared mode if the LV type allows concurrent access, such as a linear LV. Otherwise, clvmd activates the LV in exclusive mode.
With -aey, -asy, and -ay, clvmd attempts to activate the LV on all nodes. If exclusive mode is used, then only one of the nodes will be successful.
With -an, clvmd attempts to deactivate the LV on all nodes.
With -aly, clvmd activates the LV only on the local node, and -aln deactivates only on the local node. If the LV type allows concurrent access, then shared mode is used, otherwise exclusive.
LVs with snapshots are always activated exclusively because they can only be used on one node at once.
For local VGs, -ay, -aey, and -asy are all equivalent.
With -aey, the command activates the LV in exclusive mode, allowing a single host to activate the LV (the host running the command). Before activating the LV, the command uses lvmlockd to acquire an exclusive lock on the LV. If the lock cannot be acquired, the LV is not activated and an error is reported. This would happen if the LV is active on another host.
With -asy, the command activates the LV in shared mode, allowing multiple hosts to activate the LV concurrently. Before activating the LV, the command uses lvmlockd to acquire a shared lock on the LV. If the lock cannot be acquired, the LV is not activated and an error is reported. This would happen if the LV is active exclusively on another host. If the LV type prohibits shared access, such as a snapshot, the command will report an error and fail.
With -an, the command deactivates the LV on the host running the command. After deactivating the LV, the command uses lvmlockd to release the current lock on the LV.
With lvmlockd, an unspecified mode is always exclusive, -ay defaults to -aey.
If --sysinit is used in conjunction with lvmetad(8) enabled and running, autoactivation is preferred over manual activation via direct vgchange call. Logical volumes are autoactivated according to auto_activation_volume_list set in lvm.conf(5).
Before increasing the physical extent size, you might need to use lvresize, pvresize and/or pvmove so that everything fits. For example, every contiguous range of extents used in a logical volume must start and end on an extent boundary.
If the volume group metadata uses lvm1 format, extents can vary in size from 8KiB to 16GiB and there is a limit of 65534 extents in each logical volume. The default of 4 MiB leads to a maximum logical volume size of around 256GiB.
If the volume group metadata uses lvm2 format those restrictions do not apply, but having a large number of extents will slow down the tools but have no impact on I/O performance to the logical volume. The smallest PE is 1KiB.
The 2.4 kernel has a limitation of 2TiB per block device.
To activate all known volume groups in the system:
vgchange -a y
To change the maximum number of logical volumes of inactive volume group vg00 to 128.
vgchange -l 128 /dev/vg00