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

NAME

6       lvchange - Change the attributes of logical volume(s)
7

SYNOPSIS

9       lvchange option_args position_args
10           [ option_args ]
11
12        -a|--activate y|n|ay
13           --activationmode partial|degraded|complete
14           --addtag Tag
15           --alloc contiguous|cling|cling_by_tags|normal|anywhere|inherit
16        -A|--autobackup y|n
17           --cachemode writethrough|writeback|passthrough
18           --cachepolicy String
19           --cachesettings String
20           --commandprofile String
21           --compression y|n
22           --config String
23        -C|--contiguous y|n
24        -d|--debug
25           --deduplication y|n
26           --deltag Tag
27           --detachprofile
28           --discards passdown|nopassdown|ignore
29           --driverloaded y|n
30           --errorwhenfull y|n
31        -f|--force
32        -h|--help
33        -K|--ignoreactivationskip
34           --ignorelockingfailure
35           --ignoremonitoring
36           --lockopt String
37           --longhelp
38        -j|--major Number
39           --[raid]maxrecoveryrate Size[k|UNIT]
40           --metadataprofile String
41           --minor Number
42           --[raid]minrecoveryrate Size[k|UNIT]
43           --monitor y|n
44           --nolocking
45           --noudevsync
46        -P|--partial
47        -p|--permission rw|r
48        -M|--persistent y|n
49           --poll y|n
50           --profile String
51        -q|--quiet
52        -r|--readahead auto|none|Number
53           --readonly
54           --rebuild PV
55           --refresh
56           --reportformat basic|json
57           --resync
58        -S|--select String
59        -k|--setactivationskip y|n
60           --[raid]syncaction check|repair
61           --sysinit
62        -t|--test
63        -v|--verbose
64           --version
65           --[raid]writebehind Number
66           --[raid]writemostly PV[:t|n|y]
67        -y|--yes
68        -Z|--zero y|n
69

DESCRIPTION

71       lvchange  changes LV attributes in the VG, changes LV activation in the
72       kernel, and includes other utilities for LV maintenance.
73

USAGE

75       Change a general LV attribute.
76       For options listed in parentheses, any one is
77       required, after which the others are optional.
78
79       lvchange
80           ( -C|--contiguous y|n,
81             -p|--permission rw|r,
82             -r|--readahead auto|none|Number,
83             -k|--setactivationskip y|n,
84             -Z|--zero y|n,
85             -M|--persistent n,
86                --addtag Tag,
87                --deltag Tag,
88                --alloc contiguous|cling|cling_by_tags|normal|any‐
89           where|inherit,
90                --compression y|n,
91                --deduplication y|n,
92                --detachprofile,
93                --metadataprofile String,
94                --profile String,
95                --errorwhenfull y|n,
96                --discards passdown|nopassdown|ignore,
97                --cachemode writethrough|writeback|passthrough,
98                --cachepolicy String,
99                --cachesettings String,
100                --[raid]minrecoveryrate Size[k|UNIT],
101                --[raid]maxrecoveryrate Size[k|UNIT],
102                --[raid]writebehind Number,
103                --[raid]writemostly PV[:t|n|y] )
104            VG|LV|Tag|Select ...
105           [ -a|--activate y|n|ay ]
106           [    --poll y|n ]
107           [    --monitor y|n ]
108           [ COMMON_OPTIONS ]
109       -
110
111       Resyncronize a mirror or raid LV.
112       Use to reset 'R' attribute on a not initially synchronized LV.
113
114       lvchange --resync VG|LV_mirror_raid|Tag|Select ...
115           [ -a|--activate y|n|ay ]
116           [ COMMON_OPTIONS ]
117       -
118
119       Resynchronize or check a raid LV.
120
121       lvchange --syncaction check|repair VG|LV_raid|Tag|Select ...
122           [ COMMON_OPTIONS ]
123       -
124
125       Reconstruct data on specific PVs of a raid LV.
126
127       lvchange --rebuild PV VG|LV_raid|Tag|Select ...
128           [ COMMON_OPTIONS ]
129       -
130
131       Activate or deactivate an LV.
132
133       lvchange -a|--activate y|n|ay VG|LV|Tag|Select ...
134           [ -P|--partial ]
135           [ -K|--ignoreactivationskip ]
136           [    --activationmode partial|degraded|complete ]
137           [    --poll y|n ]
138           [    --monitor y|n ]
139           [    --ignorelockingfailure ]
140           [    --sysinit ]
141           [    --readonly ]
142           [ COMMON_OPTIONS ]
143       -
144
145       Reactivate an LV using the latest metadata.
146
147       lvchange --refresh VG|LV|Tag|Select ...
148           [ -P|--partial ]
149           [    --activationmode partial|degraded|complete ]
150           [    --poll y|n ]
151           [    --monitor y|n ]
152           [ COMMON_OPTIONS ]
153       -
154
155       Start or stop monitoring an LV from dmeventd.
156
157       lvchange --monitor y|n VG|LV|Tag|Select ...
158           [ COMMON_OPTIONS ]
159       -
160
161       Start or stop processing an LV conversion.
162
163       lvchange --poll y|n VG|LV|Tag|Select ...
164           [    --monitor y|n ]
165           [ COMMON_OPTIONS ]
166       -
167
168       Make the minor device number persistent for an LV.
169
170       lvchange -M|--persistent y --minor Number LV
171           [ -j|--major Number ]
172           [ -a|--activate y|n|ay ]
173           [    --poll y|n ]
174           [    --monitor y|n ]
175           [ COMMON_OPTIONS ]
176       -
177
178       Common options for command:
179           [ -A|--autobackup y|n ]
180           [ -f|--force ]
181           [ -S|--select String ]
182           [    --ignoremonitoring ]
183           [    --noudevsync ]
184           [    --reportformat basic|json ]
185
186       Common options for lvm:
187           [ -d|--debug ]
188           [ -h|--help ]
189           [ -q|--quiet ]
190           [ -t|--test ]
191           [ -v|--verbose ]
192           [ -y|--yes ]
193           [    --commandprofile String ]
194           [    --config String ]
195           [    --driverloaded y|n ]
196           [    --lockopt String ]
197           [    --longhelp ]
198           [    --nolocking ]
199           [    --profile String ]
200           [    --version ]
201

OPTIONS

203       -a|--activate y|n|ay
204              Change the active state of LVs.  An active LV can be used
205              through a block device, allowing data on the LV to be accessed.
206              y makes LVs active, or available.  n makes LVs inactive, or
207              unavailable.  The block device for the LV is added or removed
208              from the system using device-mapper in the kernel.  A symbolic
209              link /dev/VGName/LVName pointing to the device node is also
210              added/removed.  All software and scripts should access the
211              device through the symbolic link and present this as the name of
212              the device.  The location and name of the underlying device node
213              may depend on the distribution, configuration (e.g. udev), or
214              release version.  ay specifies autoactivation, in which case an
215              LV is activated only if it matches an item in lvm.conf activa‐
216              tion/auto_activation_volume_list.  If the list is not set, all
217              LVs are considered to match, and if if the list is set but
218              empty, no LVs match.  Autoactivation should be used during sys‐
219              tem boot to make it possible to select which LVs should be auto‐
220              matically activated by the system.  See lvmlockd(8) for more
221              information about activation options ey and sy for shared VGs.
222
223       --activationmode partial|degraded|complete
224              Determines if LV activation is allowed when PVs are missing,
225              e.g. because of a device failure.  complete only allows LVs with
226              no missing PVs to be activated, and is the most restrictive
227              mode.  degraded allows RAID LVs with missing PVs to be acti‐
228              vated.  (This does not include the "mirror" type, see "raid1"
229              instead.)  partial allows any LV with missing PVs to be acti‐
230              vated, and should only be used for recovery or repair.  For
231              default, see lvm.conf/activation_mode.  See lvmraid(7) for more
232              information.
233
234       --addtag Tag
235              Adds a tag to a PV, VG or LV. This option can be repeated to add
236              multiple tags at once. See lvm(8) for information about tags.
237
238       --alloc contiguous|cling|cling_by_tags|normal|anywhere|inherit
239              Determines the allocation policy when a command needs to allo‐
240              cate Physical Extents (PEs) from the VG. Each VG and LV has an
241              allocation policy which can be changed with vgchange/lvchange,
242              or overriden on the command line.  normal applies common sense
243              rules such as not placing parallel stripes on the same PV.
244              inherit applies the VG policy to an LV.  contiguous requires new
245              PEs be placed adjacent to existing PEs.  cling places new PEs on
246              the same PV as existing PEs in the same stripe of the LV.  If
247              there are sufficient PEs for an allocation, but normal does not
248              use them, anywhere will use them even if it reduces performance,
249              e.g. by placing two stripes on the same PV.  Optional positional
250              PV args on the command line can also be used to limit which PVs
251              the command will use for allocation.  See lvm(8) for more infor‐
252              mation about allocation.
253
254       -A|--autobackup y|n
255              Specifies if metadata should be backed up automatically after a
256              change.  Enabling this is strongly advised! See vgcfgbackup(8)
257              for more information.
258
259       --cachemode writethrough|writeback|passthrough
260              Specifies when writes to a cache LV should be considered com‐
261              plete.  writeback considers a write complete as soon as it is
262              stored in the cache pool.  writethough considers a write com‐
263              plete only when it has been stored in both the cache pool and on
264              the origin LV.  While writethrough may be slower for writes, it
265              is more resilient if something should happen to a device associ‐
266              ated with the cache pool LV. With passthrough, all reads are
267              served from the origin LV (all reads miss the cache) and all
268              writes are forwarded to the origin LV; additionally, write hits
269              cause cache block invalidates. See lvmcache(7) for more informa‐
270              tion.
271
272       --cachepolicy String
273              Specifies the cache policy for a cache LV.  See lvmcache(7) for
274              more information.
275
276       --cachesettings String
277              Specifies tunable values for a cache LV in "Key = Value" form.
278              Repeat this option to specify multiple values.  (The default
279              values should usually be adequate.)  The special string value
280              default switches settings back to their default kernel values
281              and removes them from the list of settings stored in LVM meta‐
282              data.  See lvmcache(7) for more information.
283
284       --commandprofile String
285              The command profile to use for command configuration.  See
286              lvm.conf(5) for more information about profiles.
287
288       --compression y|n
289              Controls whether compression is enabled or disable for VDO vol‐
290              ume.  See lvmvdo(7) for more information about VDO usage.
291
292       --config String
293              Config settings for the command. These override lvm.conf set‐
294              tings.  The String arg uses the same format as lvm.conf, or may
295              use section/field syntax.  See lvm.conf(5) for more information
296              about config.
297
298       -C|--contiguous y|n
299              Sets or resets the contiguous allocation policy for LVs.
300              Default is no contiguous allocation based on a next free princi‐
301              ple.  It is only possible to change a non-contiguous allocation
302              policy to contiguous if all of the allocated physical extents in
303              the LV are already contiguous.
304
305       -d|--debug ...
306              Set debug level. Repeat from 1 to 6 times to increase the detail
307              of messages sent to the log file and/or syslog (if configured).
308
309       --deduplication y|n
310              Controls whether deduplication is enabled or disable for VDO
311              volume.  See lvmvdo(7) for more information about VDO usage.
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       --discards passdown|nopassdown|ignore
323              Specifies how the device-mapper thin pool layer in the kernel
324              should handle discards.  ignore causes the thin pool to ignore
325              discards.  nopassdown causes the thin pool to process discards
326              itself to allow reuse of unneeded extents in the thin pool.
327              passdown causes the thin pool to process discards itself (like
328              nopassdown) and pass the discards to the underlying device.  See
329              lvmthin(7) for more information.
330
331       --driverloaded y|n
332              If set to no, the command will not attempt to use device-mapper.
333              For testing and debugging.
334
335       --errorwhenfull y|n
336              Specifies thin pool behavior when data space is exhausted.  When
337              yes, device-mapper will immediately return an error when a thin
338              pool is full and an I/O request requires space.  When no,
339              device-mapper will queue these I/O requests for a period of time
340              to allow the thin pool to be extended.  Errors are returned if
341              no space is available after the timeout.  (Also see dm-thin-pool
342              kernel module option no_space_timeout.)  See lvmthin(7) for more
343              information.
344
345       -f|--force ...
346              Override various checks, confirmations and protections.  Use
347              with extreme caution.
348
349       -h|--help
350              Display help text.
351
352       -K|--ignoreactivationskip
353              Ignore the "activation skip" LV flag during activation to allow
354              LVs with the flag set to be activated.
355
356       --ignorelockingfailure
357              Allows a command to continue with read-only metadata operations
358              after locking failures.
359
360       --ignoremonitoring
361              Do not interact with dmeventd unless --monitor is specified.  Do
362              not use this if dmeventd is already monitoring a device.
363
364       --lockopt String
365              Used to pass options for special cases to lvmlockd.  See lvm‐
366              lockd(8) for more information.
367
368       --longhelp
369              Display long help text.
370
371       -j|--major Number
372              Sets the major number of an LV block device.
373
374       --[raid]maxrecoveryrate Size[k|UNIT]
375              Sets the maximum recovery rate for a RAID LV.  The rate value is
376              an amount of data per second for each device in the array.  Set‐
377              ting the rate to 0 means it will be unbounded.  See lvmraid(7)
378              for more information.
379
380       --metadataprofile String
381              The metadata profile to use for command configuration.  See
382              lvm.conf(5) for more information about profiles.
383
384       --minor Number
385              Sets the minor number of an LV block device.
386
387       --[raid]minrecoveryrate Size[k|UNIT]
388              Sets the minimum recovery rate for a RAID LV.  The rate value is
389              an amount of data per second for each device in the array.  Set‐
390              ting the rate to 0 means it will be unbounded.  See lvmraid(7)
391              for more information.
392
393       --monitor y|n
394              Start (yes) or stop (no) monitoring an LV with dmeventd.
395              dmeventd monitors kernel events for an LV, and performs auto‐
396              mated maintenance for the LV in reponse to specific events.  See
397              dmeventd(8) for more information.
398
399       --nolocking
400              Disable locking.
401
402       --noudevsync
403              Disables udev synchronisation. The process will not wait for
404              notification from udev. It will continue irrespective of any
405              possible udev processing in the background. Only use this if
406              udev is not running or has rules that ignore the devices LVM
407              creates.
408
409       -P|--partial
410              Commands will do their best to activate LVs with missing PV
411              extents.  Missing extents may be replaced with error or zero
412              segments according to the lvm.conf missing_stripe_filler set‐
413              ting.  Metadata may not be changed with this option.
414
415       -p|--permission rw|r
416              Set access permission to read only r or read and write rw.
417
418       -M|--persistent y|n
419              When yes, makes the specified minor number persistent.
420
421       --poll y|n
422              When yes, start the background transformation of an LV.  An
423              incomplete transformation, e.g. pvmove or lvconvert interrupted
424              by reboot or crash, can be restarted from the last checkpoint
425              with --poll y.  When no, background transformation of an LV will
426              not occur, and the transformation will not complete. It may not
427              be appropriate to immediately poll an LV after activation, in
428              which case --poll n can be used to defer polling until a later
429              --poll y command.
430
431       --profile String
432              An alias for --commandprofile or --metadataprofile, depending on
433              the command.
434
435       -q|--quiet ...
436              Suppress output and log messages. Overrides --debug and --ver‐
437              bose.  Repeat once to also suppress any prompts with answer
438              'no'.
439
440       -r|--readahead auto|none|Number
441              Sets read ahead sector count of an LV.  auto is the default
442              which allows the kernel to choose a suitable value automati‐
443              cally.  none is equivalent to zero.
444
445       --readonly
446              Run the command in a special read-only mode which will read on-
447              disk metadata without needing to take any locks. This can be
448              used to peek inside metadata used by a virtual machine image
449              while the virtual machine is running. No attempt will be made to
450              communicate with the device-mapper kernel driver, so this option
451              is unable to report whether or not LVs are actually in use.
452
453       --rebuild PV
454              Selects a PV to rebuild in a raid LV. Multiple PVs can be
455              rebuilt by repeating this option.  Use this option in place of
456              --resync or --syncaction repair when the PVs with corrupted data
457              are known, and their data should be reconstructed rather than
458              reconstructing default (rotating) data.  See lvmraid(7) for more
459              information.
460
461       --refresh
462              If the LV is active, reload its metadata.  This is not necessary
463              in normal operation, but may be useful if something has gone
464              wrong, or if some form of manual LV sharing is being used.
465
466       --reportformat basic|json
467              Overrides current output format for reports which is defined
468              globally by the report/output_format setting in lvm.conf.  basic
469              is the original format with columns and rows.  If there is more
470              than one report per command, each report is prefixed with the
471              report name for identification. json produces report output in
472              JSON format. See lvmreport(7) for more information.
473
474       --resync
475              Initiates mirror synchronization. Synchronization generally hap‐
476              pens automatically, but this option forces it to run.  Also see
477              --rebuild to synchronize a specific PV.  During synchronization,
478              data is read from the primary mirror device and copied to the
479              others. This can take considerable time, during which the LV is
480              without a complete redundant copy of the data.  See lvmraid(7)
481              for more information.
482
483       -S|--select String
484              Select objects for processing and reporting based on specified
485              criteria.  The criteria syntax is described by --select help and
486              lvmreport(7).  For reporting commands, one row is displayed for
487              each object matching the criteria.  See --options help for
488              selectable object fields.  Rows can be displayed with an addi‐
489              tional "selected" field (-o selected) showing 1 if the row
490              matches the selection and 0 otherwise.  For non-reporting com‐
491              mands which process LVM entities, the selection is used to
492              choose items to process.
493
494       -k|--setactivationskip y|n
495              Persistently sets (yes) or clears (no) the "activation skip"
496              flag on an LV.  An LV with this flag set is not activated unless
497              the --ignoreactivationskip option is used by the activation com‐
498              mand.  This flag is set by default on new thin snapshot LVs.
499              The flag is not applied to deactivation.  The current value of
500              the flag is indicated in the lvs lv_attr bits.
501
502       --[raid]syncaction check|repair
503              Initiate different types of RAID synchronization.  This causes
504              the RAID LV to read all data and parity blocks in the array and
505              check for discrepancies (mismatches between mirrors or incorrect
506              parity values).  check will count but not correct discrepancies.
507              repair will correct discrepancies.  See lvs for reporting dis‐
508              crepancies found or repaired.
509
510       --sysinit
511              Indicates that vgchange/lvchange is being invoked from early
512              system initialisation scripts (e.g. rc.sysinit or an initrd),
513              before writable filesystems are available. As such, some func‐
514              tionality needs to be disabled and this option acts as a short‐
515              cut which selects an appropriate set of options. Currently, this
516              is equivalent to using --ignorelockingfailure, --ignoremonitor‐
517              ing, --poll n, and setting env var LVM_SUPPRESS_LOCKING_FAIL‐
518              URE_MESSAGES.  vgchange/lvchange skip autoactivation, and defer
519              to pvscan autoactivation.
520
521       -t|--test
522              Run in test mode. Commands will not update metadata.  This is
523              implemented by disabling all metadata writing but nevertheless
524              returning success to the calling function. This may lead to
525              unusual error messages in multi-stage operations if a tool
526              relies on reading back metadata it believes has changed but
527              hasn't.
528
529       -v|--verbose ...
530              Set verbose level. Repeat from 1 to 4 times to increase the
531              detail of messages sent to stdout and stderr.
532
533       --version
534              Display version information.
535
536       --[raid]writebehind Number
537              The maximum number of outstanding writes that are allowed to
538              devices in a RAID1 LV that is marked write-mostly.  Once this
539              value is exceeded, writes become synchronous (i.e. all writes to
540              the constituent devices must complete before the array signals
541              the write has completed). Setting the value to zero clears the
542              preference and allows the system to choose the value arbitrar‐
543              ily.
544
545       --[raid]writemostly PV[:t|n|y]
546              Mark a device in a RAID1 LV as write-mostly.  All reads to these
547              drives will be avoided unless absolutely necessary. This keeps
548              the number of I/Os to the drive to a minimum. The default behav‐
549              ior is to set the write-mostly attribute for the specified PV.
550              It is also possible to remove the write-mostly flag by adding
551              the suffix :n at the end of the PV name, or to toggle the value
552              with the suffix :t. Repeat this option to change the attribute
553              on multiple PVs.
554
555       -y|--yes
556              Do not prompt for confirmation interactively but always assume
557              the answer yes. Use with extreme caution.  (For automatic no,
558              see -qq.)
559
560       -Z|--zero y|n
561              Set zeroing mode for thin pool. Note: already provisioned blocks
562              from pool in non-zero mode are not cleared in unwritten parts
563              when setting --zero y.
564

VARIABLES

566       VG
567              Volume Group name.  See lvm(8) for valid names.
568
569       LV
570              Logical Volume name.  See lvm(8) for valid names.  An  LV  posi‐
571              tional  arg  generally  includes  the  VG name and LV name, e.g.
572              VG/LV.  LV followed by _<type> indicates that an LV of the given
573              type is required. (raid represents raid<N> type)
574
575       Tag
576              Tag  name.  See lvm(8) for information about tag names and using
577              tags in place of a VG, LV or PV.
578
579       Select
580              Select indicates that a required  positional  parameter  can  be
581              omitted  if the --select option is used.  No arg appears in this
582              position.
583
584       String
585              See the option description for information about the string con‐
586              tent.
587
588       Size[UNIT]
589              Size  is  an  input number that accepts an optional unit.  Input
590              units are always treated as base two values, regardless of capi‐
591              talization,  e.g.  'k'  and 'K' both refer to 1024.  The default
592              input unit is specified by letter, followed by |UNIT.  UNIT rep‐
593              resents  other  possible  input units: bBsSkKmMgGtTpPeE.  b|B is
594              bytes, s|S is sectors of 512 bytes, k|K  is  kilobytes,  m|M  is
595              megabytes, g|G is gigabytes, t|T is terabytes, p|P is petabytes,
596              e|E is exabytes.  (This should not be confused with  the  output
597              control --units, where capital letters mean multiple of 1000.)
598

ENVIRONMENT VARIABLES

600       See  lvm(8)  for  information  about environment variables used by lvm.
601       For example, LVM_VG_NAME can generally be substituted for a required VG
602       parameter.
603

EXAMPLES

605       Change LV permission to read-only:
606
607       lvchange -pr vg00/lvol1
608

SEE ALSO

610       lvm(8) lvm.conf(5) lvmconfig(8)
611
612       pvchange(8)  pvck(8)  pvcreate(8)  pvdisplay(8)  pvmove(8)  pvremove(8)
613       pvresize(8) pvs(8) pvscan(8)
614
615       vgcfgbackup(8) vgcfgrestore(8) vgchange(8) vgck(8)  vgcreate(8)  vgcon‐
616       vert(8)  vgdisplay(8)  vgexport(8)  vgextend(8)  vgimport(8)  vgimport‐
617       clone(8) vgmerge(8) vgmknodes(8)  vgreduce(8)  vgremove(8)  vgrename(8)
618       vgs(8) vgscan(8) vgsplit(8)
619
620       lvcreate(8)  lvchange(8)  lvconvert(8)  lvdisplay(8)  lvextend(8) lvre‐
621       duce(8) lvremove(8) lvrename(8) lvresize(8) lvs(8) lvscan(8)
622
623       lvm-fullreport(8) lvm-lvpoll(8) lvm2-activation-generator(8) blkdeacti‐
624       vate(8) lvmdump(8)
625
626       dmeventd(8)  lvmpolld(8)  lvmlockd(8)  lvmlockctl(8)  cmirrord(8) lvmd‐
627       busd(8)
628
629       lvmsystemid(7) lvmreport(7) lvmraid(7) lvmthin(7) lvmcache(7)
630
631
632
633Red Hat, Inc.          LVM TOOLS 2.03.10(2) (2020-08-09)           LVCHANGE(8)
Impressum