Linux "vgchange" Command Line Options and Examples
Change volume group attributes

vgchange changes VG attributes, changes LV activation in the kernel, and includes other utilities for VG main‐ tenance.USAGE Change a general VG attribute. For options listed in parentheses, any one is required, after which the others are optional.


Usage:

vgchange option_args position_args
[ option_args ]
[ position_args ]






Command Line Options:

-a|--activate
Change the active state of LVs. An active LV can be used through a block device, allowing data on theLV to be accessed. y makes LVs active, or available. n makes LVs inactive, or unavailable. The blockdevice for the LV is added or removed from the system using device-mapper in the kernel. A symboliclink /dev/VGName/LVName pointing to the device node is also added/removed. All software and scriptsshould access the device through the symbolic link and present this as the name of the device. Thelocation and name of the underlying device node may depend on the distribution, configuration (e.g.udev), or release version. ay specifies autoactivation, in which case an LV is activated only if itmatches an item in lvm.conf activation/auto_activation_volume_list. If the list is not set, all LVsare considered to match, and if if the list is set but empty, no LVs match. Autoactivation should beused during system boot to make it possible to select which LVs should be automatically activated bythe system. See lvmlockd(8) for more information about activation options ey and sy for shared VGs.See clvmd(8) for more information about activation options ey, sy, ly and ln for clustered VGs.
vgchange -a|--activate ...
--activationmode
Determines if LV activation is allowed when PVs are missing, e.g. because of a device failure. com‐plete only allows LVs with no missing PVs to be activated, and is the most restrictive mode. degradedallows RAID LVs with missing PVs to be activated. (This does not include the "mirror" type, see"raid1" instead.) partial allows any LV with missing PVs to be activated, and should only be used forrecovery or repair. For default, see lvm.conf/activation_mode. See lvmraid(7) for more information.
vgchange --activationmode ...
--addtag
Adds a tag to a PV, VG or LV. This option can be repeated to add multiple tags at once. See lvm(8) forinformation about tags.
vgchange --addtag ...
--alloc
Determines the allocation policy when a command needs to allocate Physical Extents (PEs) from the VG.Each VG and LV has an allocation policy which can be changed with vgchange/lvchange, or overriden onthe command line. normal applies common sense rules such as not placing parallel stripes on the samePV. inherit applies the VG policy to an LV. contiguous requires new PEs be placed adjacent to exist‐ing PEs. cling places new PEs on the same PV as existing PEs in the same stripe of the LV. If thereare sufficient PEs for an allocation, but normal does not use them, anywhere will use them even if itreduces performance, e.g. by placing two stripes on the same PV. Optional positional PV args on thecommand line can also be used to limit which PVs the command will use for allocation. See lvm(8) formore information about allocation.
vgchange --alloc ...
-A|--autobackup
Specifies if metadata should be backed up automatically after a change. Enabling this is stronglyadvised! See vgcfgbackup(8) for more information.
vgchange -A|--autobackup ...
-c|--clustered
Change the clustered property of a VG using clvmd. See clvmd(8) for more information about clusteredVGs.
vgchange -c|--clustered ...
--commandprofile
The command profile to use for command configuration. See lvm.conf(5) for more information about pro‐files.
vgchange --commandprofile ...
--config
Config settings for the command. These override lvm.conf settings. The String arg uses the same formatas lvm.conf, or may use section/field syntax. See lvm.conf(5) for more information about config.
vgchange --config ...
-d|--debug
Set debug level. Repeat from 1 to 6 times to increase the detail of messages sent to the log fileand/or syslog (if configured).
vgchange -d|--debug ...
--deltag
Deletes a tag from a PV, VG or LV. This option can be repeated to delete multiple tags at once. Seelvm(8) for information about tags.
vgchange --deltag ...
--detachprofile
Detaches a metadata profile from a VG or LV. See lvm.conf(5) for more information about profiles.
vgchange --detachprofile ...
--driverloaded
If set to no, the command will not attempt to use device-mapper. For testing and debugging.
vgchange --driverloaded ...
-f|--force
Override various checks, confirmations and protections. Use with extreme caution.
vgchange -f|--force ...
-h|--help
Display help text.
vgchange -h|--help ...
-K|--ignoreactivationskip
Ignore the "activation skip" LV flag during activation to allow LVs with the flag set to be activated.
vgchange -K|--ignoreactivationskip ...
--ignorelockingfailure
Allows a command to continue with read-only metadata operations after locking failures.
vgchange --ignorelockingfailure ...
--ignoremonitoring
Do not interact with dmeventd unless --monitor is specified. Do not use this if dmeventd is alreadymonitoring a device.
vgchange --ignoremonitoring ...
--ignoreskippedcluster
Use to avoid exiting with an non-zero status code if the command is run without clustered locking andclustered VGs are skipped.
vgchange --ignoreskippedcluster ...
--lockopt
Used to pass options for special cases to lvmlockd. See lvmlockd(8) for more information.
vgchange --lockopt ...
--lockstart
Start the lockspace of a shared VG in lvmlockd. lvmlockd locks becomes available for the VG, allowingLVM to use the VG. See lvmlockd(8) for more information.
vgchange --lockstart ...
--lockstop
Stop the lockspace of a shared VG in lvmlockd. lvmlockd locks become unavailable for the VG, prevent‐ing LVM from using the VG. See lvmlockd(8) for more information.
vgchange --lockstop ...
--locktype
Change the VG lock type to or from a shared lock type used with lvmlockd. See lvmlockd(8) for moreinformation.
vgchange --locktype ...
-l|--logicalvolume
Sets the maximum number of LVs allowed in a VG.
vgchange -l|--logicalvolume ...
--longhelp
Display long help text.
vgchange --longhelp ...
-p|--maxphysicalvolumes
Sets the maximum number of PVs that can belong to the VG. The value 0 removes any limitation. Forlarge numbers of PVs, also see options --pvmetadatacopies, and --vgmetadatacopies for improving perfor‐mance.
vgchange -p|--maxphysicalvolumes ...
--metadataprofile
The metadata profile to use for command configuration. See lvm.conf(5) for more information about pro‐files.
vgchange --metadataprofile ...
--monitor
Start (yes) or stop (no) monitoring an LV with dmeventd. dmeventd monitors kernel events for an LV,and performs automated maintenance for the LV in reponse to specific events. See dmeventd(8) for moreinformation.
vgchange --monitor ...
--noudevsync
Disables udev synchronisation. The process will not wait for notification from udev. It will continueirrespective of any possible udev processing in the background. Only use this if udev is not running orhas rules that ignore the devices LVM creates.
vgchange --noudevsync ...
-P|--partial
Commands will do their best to activate LVs with missing PV extents. Missing extents may be replacedwith error or zero segments according to the lvm.conf missing_stripe_filler setting. Metadata may notbe changed with this option.
vgchange -P|--partial ...
-s|--physicalextentsize
Sets the physical extent size of PVs in the VG. The value must be either a power of 2 of at least 1sector (where the sector size is the largest sector size of the PVs currently used in the VG), or atleast 128KiB. Once this value has been set, it is difficult to change without recreating the VG,unless no extents need moving. Before increasing the physical extent size, you might need to use lvre‐size, pvresize and/or pvmove so that everything fits. For example, every contiguous range of extentsused in a LV must start and end on an extent boundary.
vgchange -s|--physicalextentsize ...
--poll
When yes, start the background transformation of an LV. An incomplete transformation, e.g. pvmove orlvconvert interrupted by reboot or crash, can be restarted from the last checkpoint with --poll y.When no, background transformation of an LV will not occur, and the transformation will not complete.It may not be appropriate to immediately poll an LV after activation, in which case --poll n can beused to defer polling until a later --poll y command.
vgchange --poll ...
--profile
An alias for --commandprofile or --metadataprofile, depending on the command.
vgchange --profile ...
--pvmetadatacopies
The number of metadata areas to set aside on a PV for storing VG metadata. When 2, one copy of the VGmetadata is stored at the front of the PV and a second copy is stored at the end. When 1, one copy ofthe VG metadata is stored at the front of the PV (starting in the 5th sector). When 0, no copies ofthe VG metadata are stored on the given PV. This may be useful in VGs containing many PVs (this placeslimitations on the ability to use vgsplit later.)
vgchange --pvmetadatacopies ...
-q|--quiet
Suppress output and log messages. Overrides --debug and --verbose. Repeat once to also suppress anyprompts with answer 'no'.
vgchange -q|--quiet ...
--refresh
If the LV is active, reload its metadata. This is not necessary in normal operation, but may be usefulif something has gone wrong, or if some form of manual LV sharing is being used.
vgchange --refresh ...
--reportformat
Overrides current output format for reports which is defined globally by the report/output_format set‐ting in lvm.conf. basic is the original format with columns and rows. If there is more than onereport per command, each report is prefixed with the report name for identification. json producesreport output in JSON format. See lvmreport(7) for more information.
vgchange --reportformat ...
-x|--resizeable
Enables or disables the addition or removal of PVs to/from a VG (by vgextend/vgreduce).
vgchange -x|--resizeable ...
-S|--select
Select objects for processing and reporting based on specified criteria. The criteria syntax isdescribed by --select help and lvmreport(7). For reporting commands, one row is displayed for eachobject matching the criteria. See --options help for selectable object fields. Rows can be displayedwith an additional "selected" field (-o selected) showing 1 if the row matches the selection and 0 oth‐erwise. For non-reporting commands which process LVM entities, the selection is used to choose itemsto process.
vgchange -S|--select ...
--sysinit
Indicates that vgchange/lvchange is being invoked from early system initialisation scripts (e.g.rc.sysinit or an initrd), before writable filesystems are available. As such, some functionality needsto be disabled and this option acts as a shortcut which selects an appropriate set of options. Cur‐rently, this is equivalent to using --ignorelockingfailure, --ignoremonitoring, --poll n, and settingenv var LVM_SUPPRESS_LOCKING_FAILURE_MESSAGES. When used in conjunction with lvmetad enabled and run‐ning, vgchange/lvchange skip autoactivation, and defer to pvscan autoactivation.
vgchange --sysinit ...
--systemid
Changes the system ID of the VG. Using this option requires caution because the VG may become foreignto the host running the command, leaving the host unable to access it. See lvmsystemid(7) for moreinformation.
vgchange --systemid ...
-t|--test
Run in test mode. Commands will not update metadata. This is implemented by disabling all metadatawriting but nevertheless returning success to the calling function. This may lead to unusual error mes‐sages in multi-stage operations if a tool relies on reading back metadata it believes has changed buthasn't.
vgchange -t|--test ...
-u|--uuid
Generate new random UUID for specified VGs.
vgchange -u|--uuid ...
-v|--verbose
Set verbose level. Repeat from 1 to 4 times to increase the detail of messages sent to stdout andstderr.
vgchange -v|--verbose ...
--version
Display version information.
vgchange --version ...
--[vg]metadatacopies
Number of copies of the VG metadata that are kept. VG metadata is kept in VG metadata areas on PVs inthe VG, i.e. reserved space at the start and/or end of the PVs. Keeping a copy of the VG metadata onevery PV can reduce performance in VGs containing a large number of PVs. When this number is set to anon-zero value, LVM will automatically choose PVs on which to store metadata, using the metadataignoreflags on PVs to achieve the specified number. The number can also be replaced with special string val‐ues: unmanaged causes LVM to not automatically manage the PV metadataignore flags. all causes LVM tofirst clear the metadataignore flags on all PVs, and then to become unmanaged.
vgchange --[vg]metadatacopies ...
-y|--yes
Do not prompt for confirmation interactively but always assume the answer yes. Use with extreme cau‐tion. (For automatic no, see -qq.)VARIABLESVGVolume Group name. See lvm(8) for valid names.TagTag name. See lvm(8) for information about tag names and using tags in place of a VG, LV or PV.SelectSelect indicates that a required positional parameter can be omitted if the --select option is used.No arg appears in this position.StringSee the option description for information about the string content.Size[UNIT]Size is an input number that accepts an optional unit. Input units are always treated as base two val‐ues, regardless of capitalization, e.g. 'k' and 'K' both refer to 1024. The default input unit isspecified by letter, followed by |UNIT. UNIT represents other possible input units: bBsSkKmMgGtTpPeE.b|B is bytes, s|S is sectors of 512 bytes, k|K is kilobytes, m|M is megabytes, g|G is gigabytes, t|T isterabytes, p|P is petabytes, e|E is exabytes. (This should not be confused with the output control
vgchange -y|--yes ...
--units,
ENVIRONMENT VARIABLESSee lvm(8) for information about environment variables used by lvm. For example, LVM_VG_NAME can generally besubstituted for a required VG parameter.NOTESIf vgchange recognizes COW snapshot LVs that were dropped because they ran out of space, it displays a messageinforming the administrator that the snapshots should be removed.EXAMPLESActivate all LVs in all VGs on all existing devices.vgchange -a yChange the maximum number of LVs for an inactive VG.vgchange -l 128 vg00
vgchange --units, ...