1VGCHANGE(8)                 System Manager's Manual                VGCHANGE(8)
2
3
4

NAME

6       vgchange — Change volume group attributes
7

SYNOPSIS

9       vgchange option_args position_args
10           [ option_args ]
11           [ position_args ]
12
13        -a|--activate y|n|ay
14           --activationmode partial|degraded|complete
15           --addtag Tag
16           --alloc contiguous|cling|cling_by_tags|normal|anywhere|inherit
17           --autoactivation String
18        -A|--autobackup y|n
19           --commandprofile String
20           --config String
21        -d|--debug
22           --deltag Tag
23           --detachprofile
24           --devices PV
25           --devicesfile String
26           --driverloaded y|n
27        -f|--force
28        -h|--help
29        -K|--ignoreactivationskip
30           --ignorelockingfailure
31           --ignoremonitoring
32           --journal String
33           --lockopt String
34           --lockstart
35           --lockstop
36           --locktype sanlock|dlm|none
37        -l|--logicalvolume Number
38           --longhelp
39           --majoritypvs
40        -p|--maxphysicalvolumes Number
41           --metadataprofile String
42           --monitor y|n
43           --nohints
44           --nolocking
45           --noudevsync
46        -P|--partial
47        -s|--physicalextentsize Size[m|UNIT]
48           --poll y|n
49           --profile String
50           --pvmetadatacopies 0|1|2
51        -q|--quiet
52           --readonly
53           --refresh
54           --reportformat basic|json|json_std
55        -x|--resizeable y|n
56        -S|--select String
57           --setautoactivation y|n
58           --sysinit
59           --systemid String
60        -t|--test
61        -u|--uuid
62        -v|--verbose
63           --version
64           --[vg]metadatacopies all|unmanaged|Number
65        -y|--yes
66

DESCRIPTION

68       vgchange  changes  VG  attributes, changes LV activation in the kernel,
69       and includes other utilities for VG maintenance.
70

USAGE

72       Change a general VG attribute.
73       For options listed in parentheses, any one is
74       required, after which the others are optional.
75
76       vgchange
77           ( -l|--logicalvolume Number
78             -p|--maxphysicalvolumes Number
79             -u|--uuid
80             -s|--physicalextentsize Size[m|UNIT]
81             -x|--resizeable y|n
82                --addtag Tag
83                --deltag Tag
84                --alloc contiguous|cling|cling_by_tags|normal|anywhere|inherit
85                --pvmetadatacopies 0|1|2
86                --[vg]metadatacopies all|unmanaged|Number
87                --profile String
88                --detachprofile
89                --metadataprofile String
90                --setautoactivation y|n )
91           [ -A|--autobackup y|n ]
92           [ -S|--select String ]
93           [ -f|--force ]
94           [    --poll y|n ]
95           [    --ignoremonitoring ]
96           [    --noudevsync ]
97           [    --reportformat basic|json|json_std ]
98           [ COMMON_OPTIONS ]
99           [ VG|Tag|Select ... ]
100
101
102
103       Start or stop monitoring LVs from dmeventd.
104
105       vgchange --monitor y|n
106           [ -A|--autobackup y|n ]
107           [ -S|--select String ]
108           [ -f|--force ]
109           [    --sysinit ]
110           [    --ignorelockingfailure ]
111           [    --poll y|n ]
112           [    --ignoremonitoring ]
113           [    --noudevsync ]
114           [    --reportformat basic|json|json_std ]
115           [ COMMON_OPTIONS ]
116           [ VG|Tag|Select ... ]
117
118
119
120       Start or stop processing LV conversions.
121
122       vgchange --poll y|n
123           [ -A|--autobackup y|n ]
124           [ -S|--select String ]
125           [ -f|--force ]
126           [    --ignorelockingfailure ]
127           [    --ignoremonitoring ]
128           [    --noudevsync ]
129           [    --reportformat basic|json|json_std ]
130           [ COMMON_OPTIONS ]
131           [ VG|Tag|Select ... ]
132
133
134
135       Activate or deactivate LVs.
136
137       vgchange -a|--activate y|n|ay
138           [ -K|--ignoreactivationskip ]
139           [ -P|--partial ]
140           [ -A|--autobackup y|n ]
141           [ -S|--select String ]
142           [ -f|--force ]
143           [    --activationmode partial|degraded|complete ]
144           [    --sysinit ]
145           [    --readonly ]
146           [    --ignorelockingfailure ]
147           [    --monitor y|n ]
148           [    --poll y|n ]
149           [    --autoactivation String ]
150           [    --ignoremonitoring ]
151           [    --noudevsync ]
152           [    --reportformat basic|json|json_std ]
153           [ COMMON_OPTIONS ]
154           [ VG|Tag|Select ... ]
155
156
157
158       Reactivate LVs using the latest metadata.
159
160       vgchange --refresh
161           [ -A|--autobackup y|n ]
162           [ -S|--select String ]
163           [ -f|--force ]
164           [    --sysinit ]
165           [    --ignorelockingfailure ]
166           [    --poll y|n ]
167           [    --ignoremonitoring ]
168           [    --noudevsync ]
169           [    --reportformat basic|json|json_std ]
170           [ COMMON_OPTIONS ]
171           [ VG|Tag|Select ... ]
172
173
174
175       Change the system ID of a VG.
176
177       vgchange --systemid String VG|Tag|Select
178           [ -S|--select String ]
179           [    --majoritypvs ]
180           [ COMMON_OPTIONS ]
181
182
183
184       Start the lockspace of a shared VG in lvmlockd.
185
186       vgchange --lockstart
187           [ -S|--select String ]
188           [ COMMON_OPTIONS ]
189           [ VG|Tag|Select ... ]
190
191
192
193       Stop the lockspace of a shared VG in lvmlockd.
194
195       vgchange --lockstop
196           [ -S|--select String ]
197           [ COMMON_OPTIONS ]
198           [ VG|Tag|Select ... ]
199
200
201
202       Change the lock type for a shared VG.
203
204       vgchange --locktype sanlock|dlm|none VG
205           [ COMMON_OPTIONS ]
206
207
208
209       Common options for lvm:
210           [ -d|--debug ]
211           [ -h|--help ]
212           [ -q|--quiet ]
213           [ -t|--test ]
214           [ -v|--verbose ]
215           [ -y|--yes ]
216           [    --commandprofile String ]
217           [    --config String ]
218           [    --devices PV ]
219           [    --devicesfile String ]
220           [    --driverloaded y|n ]
221           [    --journal String ]
222           [    --lockopt String ]
223           [    --longhelp ]
224           [    --nohints ]
225           [    --nolocking ]
226           [    --profile String ]
227           [    --version ]
228

OPTIONS

230       -a|--activate y|n|ay
231              Change the active state of  LVs.   An  active  LV  can  be  used
232              through  a block device, allowing data on the LV to be accessed.
233              y makes LVs active, or available.  n makes LVs inactive, or  un‐
234              available.  The block device for the LV is added or removed from
235              the system using device-mapper in the kernel.  A  symbolic  link
236              /dev/VGName/LVName pointing to the device node is also added/re‐
237              moved.  All  software  and  scripts  should  access  the  device
238              through  the  symbolic  link and present this as the name of the
239              device.  The location and name of the underlying device node may
240              depend  on  the  distribution, configuration (e.g. udev), or re‐
241              lease version.  ay specifies autoactivation, which  is  used  by
242              system-generated  activation  commands.  By default, LVs are au‐
243              toactivated.  An autoactivation property can be set on a  VG  or
244              LV  to  disable  autoactivation,  see --setautoactivation y|n in
245              vgchange, lvchange, vgcreate, and lvcreate.  Display the proper‐
246              ty  with  vgs  or  lvs "-o autoactivation".  The lvm.conf(5) au‐
247              to_activation_volume_list includes names  of  VGs  or  LVs  that
248              should  be autoactivated, and anything not listed is not autoac‐
249              tivated.  When auto_activation_volume_list is undefined (the de‐
250              fault), it has no effect.  If auto_activation_volume_list is de‐
251              fined and empty, no LVs are autoactivated.   Items  included  by
252              auto_activation_volume_list will not be autoactivated if the au‐
253              toactivation property has been disabled.   See  lvmlockd(8)  for
254              more  information  about activation options ey and sy for shared
255              VGs.
256
257       --activationmode partial|degraded|complete
258              Determines if LV activation is allowed  when  PVs  are  missing,
259              e.g. because of a device failure.  complete only allows LVs with
260              no missing PVs to be activated,  and  is  the  most  restrictive
261              mode.   degraded allows RAID LVs with missing PVs to be activat‐
262              ed.  (This does not include the "mirror" type, see  "raid1"  in‐
263              stead.)  partial allows any LV with missing PVs to be activated,
264              and should only be used for recovery or  repair.   For  default,
265              see lvm.conf(5) activation_mode.  See lvmraid(7) for more infor‐
266              mation.
267
268       --addtag Tag
269              Adds a tag to a PV, VG or LV. This option can be repeated to add
270              multiple tags at once. See lvm(8) for information about tags.
271
272       --alloc contiguous|cling|cling_by_tags|normal|anywhere|inherit
273              Determines  the  allocation policy when a command needs to allo‐
274              cate Physical Extents (PEs) from the VG. Each VG and LV  has  an
275              allocation  policy  which can be changed with vgchange/lvchange,
276              or overridden on the command line.  normal applies common  sense
277              rules  such as not placing parallel stripes on the same PV.  in‐
278              herit applies the VG policy to an LV.  contiguous  requires  new
279              PEs be placed adjacent to existing PEs.  cling places new PEs on
280              the same PV as existing PEs in the same stripe of  the  LV.   If
281              there  are sufficient PEs for an allocation, but normal does not
282              use them, anywhere will use them even if it reduces performance,
283              e.g. by placing two stripes on the same PV.  Optional positional
284              PV args on the command line can also be used to limit which  PVs
285              the command will use for allocation.  See lvm(8) for more infor‐
286              mation about allocation.
287
288       --autoactivation String
289              Specify if autoactivation is being used from an event.  This al‐
290              lows  the  command  to apply settings that are specific to event
291              activation, such as device scanning optimizations using  pvs_on‐
292              line files created by event-based pvscans.
293
294       -A|--autobackup y|n
295              Specifies  if metadata should be backed up automatically after a
296              change.  Enabling this is strongly advised!  See  vgcfgbackup(8)
297              for more information.
298
299       --commandprofile String
300              The  command  profile  to  use  for  command configuration.  See
301              lvm.conf(5) for more information about profiles.
302
303       --config String
304              Config settings for the command. These override lvm.conf(5) set‐
305              tings.   The  String arg uses the same format as lvm.conf(5), or
306              may use section/field syntax.  See lvm.conf(5) for more informa‐
307              tion about config.
308
309       -d|--debug ...
310              Set debug level. Repeat from 1 to 6 times to increase the detail
311              of messages sent to the log file and/or syslog (if configured).
312
313       --deltag Tag
314              Deletes a tag from a PV, VG or LV. This option can  be  repeated
315              to  delete  multiple  tags  at  once. See lvm(8) for information
316              about tags.
317
318       --detachprofile
319              Detaches a metadata profile from a VG or  LV.   See  lvm.conf(5)
320              for more information about profiles.
321
322       --devices PV
323              Restricts  the  devices  that  are visible and accessible to the
324              command.  Devices not listed will appear to be missing. This op‐
325              tion  can  be repeated, or accepts a comma separated list of de‐
326              vices. This overrides the devices file.
327
328       --devicesfile String
329              A file listing devices that LVM should use.  The file must exist
330              in  /etc/lvm/devices/ and is managed with the lvmdevices(8) com‐
331              mand.  This overrides the  lvm.conf(5)  devices/devicesfile  and
332              devices/use_devicesfile settings.
333
334       --driverloaded y|n
335              If set to no, the command will not attempt to use device-mapper.
336              For testing and debugging.
337
338       -f|--force ...
339              Override various checks,  confirmations  and  protections.   Use
340              with extreme caution.
341
342       -h|--help
343              Display help text.
344
345       -K|--ignoreactivationskip
346              Ignore  the "activation skip" LV flag during activation to allow
347              LVs with the flag set to be activated.
348
349       --ignorelockingfailure
350              Allows a command to continue with read-only metadata  operations
351              after locking failures.
352
353       --ignoremonitoring
354              Do not interact with dmeventd unless --monitor is specified.  Do
355              not use this if dmeventd is already monitoring a device.
356
357       --journal String
358              Record information in the systemd journal.  This information  is
359              in  addition  to information enabled by the lvm.conf log/journal
360              setting.  command: record information about the  command.   out‐
361              put: record the default command output.  debug: record full com‐
362              mand debugging.
363
364       --lockopt String
365              Used to pass options for special cases to  lvmlockd.   See  lvm‐
366              lockd(8) for more information.
367
368       --lockstart
369              Start  the lockspace of a shared VG in lvmlockd.  lvmlockd locks
370              becomes available for the VG, allowing LVM to use the  VG.   See
371              lvmlockd(8) for more information.
372
373       --lockstop
374              Stop  the  lockspace of a shared VG in lvmlockd.  lvmlockd locks
375              become unavailable for the VG, preventing LVM from using the VG.
376              See lvmlockd(8) for more information.
377
378       --locktype sanlock|dlm|none
379              Change  the VG lock type to or from a shared lock type used with
380              lvmlockd.  See lvmlockd(8) for more information.
381
382       -l|--logicalvolume Number
383              Sets the maximum number of LVs allowed in a VG.
384
385       --longhelp
386              Display long help text.
387
388       --majoritypvs
389              Change the VG system ID if the majority of PVs  in  the  VG  are
390              present (one more than half).
391
392       -p|--maxphysicalvolumes Number
393              Sets  the  maximum number of PVs that can belong to the VG.  The
394              value 0 removes any limitation.  For large numbers of PVs,  also
395              see  options  --pvmetadatacopies, and --vgmetadatacopies for im‐
396              proving performance.
397
398       --metadataprofile String
399              The metadata profile to  use  for  command  configuration.   See
400              lvm.conf(5) for more information about profiles.
401
402       --monitor y|n
403              Start  (yes)  or  stop  (no)  monitoring  an  LV  with dmeventd.
404              dmeventd monitors kernel events for an LV, and performs automat‐
405              ed  maintenance  for the LV in response to specific events.  See
406              dmeventd(8) for more information.
407
408       --nohints
409              Do not use the hints file to locate devices for PVs.  A  command
410              may  read  more devices to find PVs when hints are not used. The
411              command will still perform standard hint file invalidation where
412              appropriate.
413
414       --nolocking
415              Disable  locking. Use with caution, concurrent commands may pro‐
416              duce incorrect results.
417
418       --noudevsync
419              Disables udev synchronization. The process will not wait for no‐
420              tification  from udev. It will continue irrespective of any pos‐
421              sible udev processing in the background. Only use this  if  udev
422              is not running or has rules that ignore the devices LVM creates.
423
424       -P|--partial
425              Commands  will do their best to activate LVs with missing PV ex‐
426              tents.  Missing extents may be replaced with error or zero  seg‐
427              ments according to the  missing_stripe_filler setting.  Metadata
428              may not be changed with this option.
429
430       -s|--physicalextentsize Size[m|UNIT]
431              Sets the physical extent size of PVs in the VG.  The value  must
432              be  either  a  power of 2 of at least 1 sector (where the sector
433              size is the largest sector size of the PVs currently used in the
434              VG),  or  at least 128 KiB.  Once this value has been set, it is
435              difficult to change without recreating the VG, unless no extents
436              need  moving.   Before  increasing the physical extent size, you
437              might need to use lvresize, pvresize and/or pvmove so  that  ev‐
438              erything  fits.  For  example, every contiguous range of extents
439              used in a LV must start and end on an extent boundary.
440
441       --poll y|n
442              When yes, start the background transformation of an LV.  An  in‐
443              complete transformation, e.g. pvmove or lvconvert interrupted by
444              reboot or crash, can be restarted from the last checkpoint  with
445              --poll  y.  When no, background transformation of an LV will not
446              occur, and the transformation will not complete. It may  not  be
447              appropriate to immediately poll an LV after activation, in which
448              case --poll n can be used to defer polling until a later  --poll
449              y command.
450
451       --profile String
452              An alias for --commandprofile or --metadataprofile, depending on
453              the command.
454
455       --pvmetadatacopies 0|1|2
456              The number of metadata areas to set aside on a PV for storing VG
457              metadata.   When 2, one copy of the VG metadata is stored at the
458              front of the PV and a second copy is stored at the end.  When 1,
459              one  copy  of  the VG metadata is stored at the front of the PV.
460              When 0, no copies of the VG metadata are stored on the given PV.
461              This may be useful in VGs containing many PVs (this places limi‐
462              tations on the ability to use vgsplit later.)
463
464       -q|--quiet ...
465              Suppress output and log messages. Overrides --debug  and  --ver‐
466              bose.   Repeat  once  to  also  suppress any prompts with answer
467              'no'.
468
469       --readonly
470              Run the command in a special read-only mode which will read  on-
471              disk  metadata  without  needing  to take any locks. This can be
472              used to peek inside metadata used by  a  virtual  machine  image
473              while the virtual machine is running. No attempt will be made to
474              communicate with the device-mapper kernel driver, so this option
475              is unable to report whether or not LVs are actually in use.
476
477       --refresh
478              If the LV is active, reload its metadata.  This is not necessary
479              in normal operation, but may be useful  if  something  has  gone
480              wrong, or if some form of manual LV sharing is being used.
481
482       --reportformat basic|json|json_std
483              Overrides  current  output  format  for reports which is defined
484              globally by the  report/output_format  setting  in  lvm.conf(5).
485              basic is the original format with columns and rows.  If there is
486              more than one report per command, each report is  prefixed  with
487              the  report name for identification. json produces report output
488              in JSON format. json_std produces report output in  JSON  format
489              which  is  more  compliant with JSON standard.  See lvmreport(7)
490              for more information.
491
492       -x|--resizeable y|n
493              Enables or disables the addition or removal of PVs to/from a  VG
494              (by vgextend/vgreduce).
495
496       -S|--select String
497              Select  objects  for processing and reporting based on specified
498              criteria.  The criteria syntax is described by --select help and
499              lvmreport(7).   For reporting commands, one row is displayed for
500              each object matching the criteria.  See --options help  for  se‐
501              lectable object fields.  Rows can be displayed with an addition‐
502              al "selected" field (-o selected) showing 1 if the  row  matches
503              the selection and 0 otherwise.  For non-reporting commands which
504              process LVM entities, the selection is used to choose  items  to
505              process.
506
507       --setautoactivation y|n
508              Set  the  autoactivation  property  on  a VG or LV.  Display the
509              property with vgs or lvs "-o autoactivation".  When the  autoac‐
510              tivation property is disabled, the VG or LV will not be activat‐
511              ed by a command doing  autoactivation  (vgchange,  lvchange,  or
512              pvscan  using  -aay.)  If autoactivation is disabled on a VG, no
513              LVs will be autoactivated in that VG, and the LV  autoactivation
514              property  has  no effect.  If autoactivation is enabled on a VG,
515              autoactivation can be disabled for individual LVs.
516
517       --sysinit
518              Indicates that vgchange/lvchange is  being  invoked  from  early
519              system  initialisation  scripts  (e.g. rc.sysinit or an initrd),
520              before writable filesystems are available. As such,  some  func‐
521              tionality  needs to be disabled and this option acts as a short‐
522              cut which selects an appropriate set of options. Currently, this
523              is  equivalent to using --ignorelockingfailure, --ignoremonitor‐
524              ing, --poll n, and setting  env  var  LVM_SUPPRESS_LOCKING_FAIL‐
525              URE_MESSAGES.   vgchange/lvchange skip autoactivation, and defer
526              to pvscan autoactivation.
527
528       --systemid String
529              Changes the system ID of the VG.   Using  this  option  requires
530              caution  because  the  VG may become foreign to the host running
531              the command, leaving the host unable to access it.  See  lvmsys‐
532              temid(7) for more information.
533
534       -t|--test
535              Run  in  test  mode. Commands will not update metadata.  This is
536              implemented by disabling all metadata writing  but  nevertheless
537              returning  success to the calling function. This may lead to un‐
538              usual error messages in multi-stage operations if a tool  relies
539              on reading back metadata it believes has changed but hasn't.
540
541       -u|--uuid
542              Generate new random UUID for specified VGs.
543
544       -v|--verbose ...
545              Set  verbose level. Repeat from 1 to 4 times to increase the de‐
546              tail of messages sent to stdout and stderr.
547
548       --version
549              Display version information.
550
551       --[vg]metadatacopies all|unmanaged|Number
552              Number of copies of the VG metadata that are kept.  VG  metadata
553              is  kept  in  VG  metadata areas on PVs in the VG, i.e. reserved
554              space at the start and/or end of the PVs.  Keeping a copy of the
555              VG metadata on every PV can reduce performance in VGs containing
556              a large number of PVs.  When this number is set  to  a  non-zero
557              value, LVM will automatically choose PVs on which to store meta‐
558              data, using the metadataignore flags on PVs to achieve the spec‐
559              ified  number.   The  number  can  also be replaced with special
560              string values: unmanaged causes LVM to not automatically  manage
561              the  PV metadataignore flags.  all causes LVM to first clear the
562              metadataignore flags on all PVs, and then to become unmanaged.
563
564       -y|--yes
565              Do not prompt for confirmation interactively but  always  assume
566              the  answer  yes.  Use with extreme caution.  (For automatic no,
567              see -qq.)
568

VARIABLES

570       VG     Volume Group name.  See lvm(8) for valid names.
571
572       Tag    Tag name.  See lvm(8) for information about tag names and  using
573              tags in place of a VG, LV or PV.
574
575       Select Select  indicates  that  a  required positional parameter can be
576              omitted if the --select option is used.  No arg appears in  this
577              position.
578
579       String See the option description for information about the string con‐
580              tent.
581
582       Size[UNIT]
583              Size is an input number that accepts an  optional  unit.   Input
584              units are always treated as base two values, regardless of capi‐
585              talization, e.g. 'k' and 'K' both refer to  1024.   The  default
586              input unit is specified by letter, followed by |UNIT.  UNIT rep‐
587              resents other possible input units: b|B is bytes, s|S is sectors
588              of  512  bytes,  k|K is KiB, m|M is MiB, g|G is GiB, t|T is TiB,
589              p|P is PiB, e|E is EiB.  (This should not be confused  with  the
590              output  control  --units, where capital letters mean multiple of
591              1000.)
592

ENVIRONMENT VARIABLES

594       See lvm(8) for information about environment  variables  used  by  lvm.
595       For example, LVM_VG_NAME can generally be substituted for a required VG
596       parameter.
597

NOTES

599       If vgchange recognizes COW snapshot LVs that were dropped because  they
600       ran  out  of  space,  it displays a message informing the administrator
601       that the snapshots should be removed.
602

EXAMPLES

604       Activate all LVs in all VGs on all existing devices.
605       vgchange -a y
606
607       Change the maximum number of LVs for an inactive VG.
608       vgchange -l 128 vg00
609

SEE ALSO

611       lvm(8), lvm.conf(5), lvmconfig(8), lvmdevices(8),
612
613       pvchange(8), pvck(8), pvcreate(8), pvdisplay(8), pvmove(8),
614       pvremove(8), pvresize(8), pvs(8), pvscan(8),
615
616       vgcfgbackup(8), vgcfgrestore(8), vgchange(8), vgck(8), vgcreate(8),
617       vgconvert(8), vgdisplay(8), vgexport(8), vgextend(8), vgimport(8),
618       vgimportclone(8), vgimportdevices(8), vgmerge(8), vgmknodes(8),
619       vgreduce(8), vgremove(8), vgrename(8), vgs(8), vgscan(8), vgsplit(8),
620
621       lvcreate(8), lvchange(8), lvconvert(8), lvdisplay(8), lvextend(8),
622       lvreduce(8), lvremove(8), lvrename(8), lvresize(8), lvs(8), lvscan(8),
623
624       lvm-fullreport(8), lvm-lvpoll(8), blkdeactivate(8), lvmdump(8),
625
626       dmeventd(8), lvmpolld(8), lvmlockd(8), lvmlockctl(8), cmirrord(8),
627       lvmdbusd(8), fsadm(8),
628
629       lvmsystemid(7), lvmreport(7), lvmcache(7), lvmraid(7), lvmthin(7),
630       lvmvdo(7), lvmautoactivation(7)
631
632
633
634
635Red Hat, Inc.          LVM TOOLS 2.03.22(2) (2023-08-02)           VGCHANGE(8)
Impressum