1LVCHANGE(8) System Manager's Manual LVCHANGE(8)
2
3
4
6 lvchange - Change the attributes of logical volume(s)
7
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
71 lvchange changes LV attributes in the VG, changes LV activation in the
72 kernel, and includes other utilities for LV maintenance.
73
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
113 lvchange --resync VG|LV_mirror_raid|Tag|Select ...
114 [ -a|--activate y|n|ay ]
115 [ COMMON_OPTIONS ]
116 -
117
118 Resynchronize or check a raid LV.
119
120 lvchange --syncaction check|repair VG|LV_raid|Tag|Select ...
121 [ COMMON_OPTIONS ]
122 -
123
124 Reconstruct data on specific PVs of a raid LV.
125
126 lvchange --rebuild PV VG|LV_raid|Tag|Select ...
127 [ COMMON_OPTIONS ]
128 -
129
130 Activate or deactivate an LV.
131
132 lvchange -a|--activate y|n|ay VG|LV|Tag|Select ...
133 [ -P|--partial ]
134 [ -K|--ignoreactivationskip ]
135 [ --activationmode partial|degraded|complete ]
136 [ --poll y|n ]
137 [ --monitor y|n ]
138 [ --ignorelockingfailure ]
139 [ --sysinit ]
140 [ --readonly ]
141 [ COMMON_OPTIONS ]
142 -
143
144 Reactivate an LV using the latest metadata.
145
146 lvchange --refresh VG|LV|Tag|Select ...
147 [ -P|--partial ]
148 [ --activationmode partial|degraded|complete ]
149 [ --poll y|n ]
150 [ --monitor y|n ]
151 [ COMMON_OPTIONS ]
152 -
153
154 Start or stop monitoring an LV from dmeventd.
155
156 lvchange --monitor y|n VG|LV|Tag|Select ...
157 [ COMMON_OPTIONS ]
158 -
159
160 Start or stop processing an LV conversion.
161
162 lvchange --poll y|n VG|LV|Tag|Select ...
163 [ --monitor y|n ]
164 [ COMMON_OPTIONS ]
165 -
166
167 Make the minor device number persistent for an LV.
168
169 lvchange -M|--persistent y --minor Number LV
170 [ -j|--major Number ]
171 [ -a|--activate y|n|ay ]
172 [ --poll y|n ]
173 [ --monitor y|n ]
174 [ COMMON_OPTIONS ]
175 -
176
177 Common options for command:
178 [ -A|--autobackup y|n ]
179 [ -f|--force ]
180 [ -S|--select String ]
181 [ --ignoremonitoring ]
182 [ --noudevsync ]
183 [ --reportformat basic|json ]
184
185 Common options for lvm:
186 [ -d|--debug ]
187 [ -h|--help ]
188 [ -q|--quiet ]
189 [ -t|--test ]
190 [ -v|--verbose ]
191 [ -y|--yes ]
192 [ --commandprofile String ]
193 [ --config String ]
194 [ --driverloaded y|n ]
195 [ --lockopt String ]
196 [ --longhelp ]
197 [ --nolocking ]
198 [ --profile String ]
199 [ --version ]
200
202 -a|--activate y|n|ay
203 Change the active state of LVs. An active LV can be used
204 through a block device, allowing data on the LV to be accessed.
205 y makes LVs active, or available. n makes LVs inactive, or
206 unavailable. The block device for the LV is added or removed
207 from the system using device-mapper in the kernel. A symbolic
208 link /dev/VGName/LVName pointing to the device node is also
209 added/removed. All software and scripts should access the
210 device through the symbolic link and present this as the name of
211 the device. The location and name of the underlying device node
212 may depend on the distribution, configuration (e.g. udev), or
213 release version. ay specifies autoactivation, in which case an
214 LV is activated only if it matches an item in lvm.conf activa‐
215 tion/auto_activation_volume_list. If the list is not set, all
216 LVs are considered to match, and if if the list is set but
217 empty, no LVs match. Autoactivation should be used during sys‐
218 tem boot to make it possible to select which LVs should be auto‐
219 matically activated by the system. See lvmlockd(8) for more
220 information about activation options ey and sy for shared VGs.
221
222 --activationmode partial|degraded|complete
223 Determines if LV activation is allowed when PVs are missing,
224 e.g. because of a device failure. complete only allows LVs with
225 no missing PVs to be activated, and is the most restrictive
226 mode. degraded allows RAID LVs with missing PVs to be acti‐
227 vated. (This does not include the "mirror" type, see "raid1"
228 instead.) partial allows any LV with missing PVs to be acti‐
229 vated, and should only be used for recovery or repair. For
230 default, see lvm.conf/activation_mode. See lvmraid(7) for more
231 information.
232
233 --addtag Tag
234 Adds a tag to a PV, VG or LV. This option can be repeated to add
235 multiple tags at once. See lvm(8) for information about tags.
236
237 --alloc contiguous|cling|cling_by_tags|normal|anywhere|inherit
238 Determines the allocation policy when a command needs to allo‐
239 cate Physical Extents (PEs) from the VG. Each VG and LV has an
240 allocation policy which can be changed with vgchange/lvchange,
241 or overriden on the command line. normal applies common sense
242 rules such as not placing parallel stripes on the same PV.
243 inherit applies the VG policy to an LV. contiguous requires new
244 PEs be placed adjacent to existing PEs. cling places new PEs on
245 the same PV as existing PEs in the same stripe of the LV. If
246 there are sufficient PEs for an allocation, but normal does not
247 use them, anywhere will use them even if it reduces performance,
248 e.g. by placing two stripes on the same PV. Optional positional
249 PV args on the command line can also be used to limit which PVs
250 the command will use for allocation. See lvm(8) for more infor‐
251 mation about allocation.
252
253 -A|--autobackup y|n
254 Specifies if metadata should be backed up automatically after a
255 change. Enabling this is strongly advised! See vgcfgbackup(8)
256 for more information.
257
258 --cachemode writethrough|writeback|passthrough
259 Specifies when writes to a cache LV should be considered com‐
260 plete. writeback considers a write complete as soon as it is
261 stored in the cache pool. writethough considers a write com‐
262 plete only when it has been stored in both the cache pool and on
263 the origin LV. While writethrough may be slower for writes, it
264 is more resilient if something should happen to a device associ‐
265 ated with the cache pool LV. With passthrough, all reads are
266 served from the origin LV (all reads miss the cache) and all
267 writes are forwarded to the origin LV; additionally, write hits
268 cause cache block invalidates. See lvmcache(7) for more informa‐
269 tion.
270
271 --cachepolicy String
272 Specifies the cache policy for a cache LV. See lvmcache(7) for
273 more information.
274
275 --cachesettings String
276 Specifies tunable values for a cache LV in "Key = Value" form.
277 Repeat this option to specify multiple values. (The default
278 values should usually be adequate.) The special string value
279 default switches settings back to their default kernel values
280 and removes them from the list of settings stored in LVM meta‐
281 data. See lvmcache(7) for more information.
282
283 --commandprofile String
284 The command profile to use for command configuration. See
285 lvm.conf(5) for more information about profiles.
286
287 --compression y|n
288 Controls whether compression is enabled or disable for VDO vol‐
289 ume. See lvmvdo(7) for more information about VDO usage.
290
291 --config String
292 Config settings for the command. These override lvm.conf set‐
293 tings. The String arg uses the same format as lvm.conf, or may
294 use section/field syntax. See lvm.conf(5) for more information
295 about config.
296
297 -C|--contiguous y|n
298 Sets or resets the contiguous allocation policy for LVs.
299 Default is no contiguous allocation based on a next free princi‐
300 ple. It is only possible to change a non-contiguous allocation
301 policy to contiguous if all of the allocated physical extents in
302 the LV are already contiguous.
303
304 -d|--debug ...
305 Set debug level. Repeat from 1 to 6 times to increase the detail
306 of messages sent to the log file and/or syslog (if configured).
307
308 --deduplication y|n
309 Controls whether deduplication is enabled or disable for VDO
310 volume. See lvmvdo(7) for more information about VDO usage.
311
312 --deltag Tag
313 Deletes a tag from a PV, VG or LV. This option can be repeated
314 to delete multiple tags at once. See lvm(8) for information
315 about tags.
316
317 --detachprofile
318 Detaches a metadata profile from a VG or LV. See lvm.conf(5)
319 for more information about profiles.
320
321 --discards passdown|nopassdown|ignore
322 Specifies how the device-mapper thin pool layer in the kernel
323 should handle discards. ignore causes the thin pool to ignore
324 discards. nopassdown causes the thin pool to process discards
325 itself to allow reuse of unneeded extents in the thin pool.
326 passdown causes the thin pool to process discards itself (like
327 nopassdown) and pass the discards to the underlying device. See
328 lvmthin(7) for more information.
329
330 --driverloaded y|n
331 If set to no, the command will not attempt to use device-mapper.
332 For testing and debugging.
333
334 --errorwhenfull y|n
335 Specifies thin pool behavior when data space is exhausted. When
336 yes, device-mapper will immediately return an error when a thin
337 pool is full and an I/O request requires space. When no,
338 device-mapper will queue these I/O requests for a period of time
339 to allow the thin pool to be extended. Errors are returned if
340 no space is available after the timeout. (Also see dm-thin-pool
341 kernel module option no_space_timeout.) See lvmthin(7) for more
342 information.
343
344 -f|--force ...
345 Override various checks, confirmations and protections. Use
346 with extreme caution.
347
348 -h|--help
349 Display help text.
350
351 -K|--ignoreactivationskip
352 Ignore the "activation skip" LV flag during activation to allow
353 LVs with the flag set to be activated.
354
355 --ignorelockingfailure
356 Allows a command to continue with read-only metadata operations
357 after locking failures.
358
359 --ignoremonitoring
360 Do not interact with dmeventd unless --monitor is specified. Do
361 not use this if dmeventd is already monitoring a device.
362
363 --lockopt String
364 Used to pass options for special cases to lvmlockd. See lvm‐
365 lockd(8) for more information.
366
367 --longhelp
368 Display long help text.
369
370 -j|--major Number
371 Sets the major number of an LV block device.
372
373 --[raid]maxrecoveryrate Size[k|UNIT]
374 Sets the maximum recovery rate for a RAID LV. The rate value is
375 an amount of data per second for each device in the array. Set‐
376 ting the rate to 0 means it will be unbounded. See lvmraid(7)
377 for more information.
378
379 --metadataprofile String
380 The metadata profile to use for command configuration. See
381 lvm.conf(5) for more information about profiles.
382
383 --minor Number
384 Sets the minor number of an LV block device.
385
386 --[raid]minrecoveryrate Size[k|UNIT]
387 Sets the minimum recovery rate for a RAID LV. The rate value is
388 an amount of data per second for each device in the array. Set‐
389 ting the rate to 0 means it will be unbounded. See lvmraid(7)
390 for more information.
391
392 --monitor y|n
393 Start (yes) or stop (no) monitoring an LV with dmeventd.
394 dmeventd monitors kernel events for an LV, and performs auto‐
395 mated maintenance for the LV in reponse to specific events. See
396 dmeventd(8) for more information.
397
398 --nolocking
399 Disable locking.
400
401 --noudevsync
402 Disables udev synchronisation. The process will not wait for
403 notification from udev. It will continue irrespective of any
404 possible udev processing in the background. Only use this if
405 udev is not running or has rules that ignore the devices LVM
406 creates.
407
408 -P|--partial
409 Commands will do their best to activate LVs with missing PV
410 extents. Missing extents may be replaced with error or zero
411 segments according to the lvm.conf missing_stripe_filler set‐
412 ting. Metadata may not be changed with this option.
413
414 -p|--permission rw|r
415 Set access permission to read only r or read and write rw.
416
417 -M|--persistent y|n
418 When yes, makes the specified minor number persistent.
419
420 --poll y|n
421 When yes, start the background transformation of an LV. An
422 incomplete transformation, e.g. pvmove or lvconvert interrupted
423 by reboot or crash, can be restarted from the last checkpoint
424 with --poll y. When no, background transformation of an LV will
425 not occur, and the transformation will not complete. It may not
426 be appropriate to immediately poll an LV after activation, in
427 which case --poll n can be used to defer polling until a later
428 --poll y command.
429
430 --profile String
431 An alias for --commandprofile or --metadataprofile, depending on
432 the command.
433
434 -q|--quiet ...
435 Suppress output and log messages. Overrides --debug and --ver‐
436 bose. Repeat once to also suppress any prompts with answer
437 'no'.
438
439 -r|--readahead auto|none|Number
440 Sets read ahead sector count of an LV. auto is the default
441 which allows the kernel to choose a suitable value automati‐
442 cally. none is equivalent to zero.
443
444 --readonly
445 Run the command in a special read-only mode which will read on-
446 disk metadata without needing to take any locks. This can be
447 used to peek inside metadata used by a virtual machine image
448 while the virtual machine is running. No attempt will be made to
449 communicate with the device-mapper kernel driver, so this option
450 is unable to report whether or not LVs are actually in use.
451
452 --rebuild PV
453 Selects a PV to rebuild in a raid LV. Multiple PVs can be
454 rebuilt by repeating this option. Use this option in place of
455 --resync or --syncaction repair when the PVs with corrupted data
456 are known, and their data should be reconstructed rather than
457 reconstructing default (rotating) data. See lvmraid(7) for more
458 information.
459
460 --refresh
461 If the LV is active, reload its metadata. This is not necessary
462 in normal operation, but may be useful if something has gone
463 wrong, or if some form of manual LV sharing is being used.
464
465 --reportformat basic|json
466 Overrides current output format for reports which is defined
467 globally by the report/output_format setting in lvm.conf. basic
468 is the original format with columns and rows. If there is more
469 than one report per command, each report is prefixed with the
470 report name for identification. json produces report output in
471 JSON format. See lvmreport(7) for more information.
472
473 --resync
474 Initiates mirror synchronization. Synchronization generally hap‐
475 pens automatically, but this option forces it to run. Also see
476 --rebuild to synchronize a specific PV. During synchronization,
477 data is read from the primary mirror device and copied to the
478 others. This can take considerable time, during which the LV is
479 without a complete redundant copy of the data. See lvmraid(7)
480 for more information.
481
482 -S|--select String
483 Select objects for processing and reporting based on specified
484 criteria. The criteria syntax is described by --select help and
485 lvmreport(7). For reporting commands, one row is displayed for
486 each object matching the criteria. See --options help for
487 selectable object fields. Rows can be displayed with an addi‐
488 tional "selected" field (-o selected) showing 1 if the row
489 matches the selection and 0 otherwise. For non-reporting com‐
490 mands which process LVM entities, the selection is used to
491 choose items to process.
492
493 -k|--setactivationskip y|n
494 Persistently sets (yes) or clears (no) the "activation skip"
495 flag on an LV. An LV with this flag set is not activated unless
496 the --ignoreactivationskip option is used by the activation com‐
497 mand. This flag is set by default on new thin snapshot LVs.
498 The flag is not applied to deactivation. The current value of
499 the flag is indicated in the lvs lv_attr bits.
500
501 --[raid]syncaction check|repair
502 Initiate different types of RAID synchronization. This causes
503 the RAID LV to read all data and parity blocks in the array and
504 check for discrepancies (mismatches between mirrors or incorrect
505 parity values). check will count but not correct discrepancies.
506 repair will correct discrepancies. See lvs for reporting dis‐
507 crepancies found or repaired.
508
509 --sysinit
510 Indicates that vgchange/lvchange is being invoked from early
511 system initialisation scripts (e.g. rc.sysinit or an initrd),
512 before writable filesystems are available. As such, some func‐
513 tionality needs to be disabled and this option acts as a short‐
514 cut which selects an appropriate set of options. Currently, this
515 is equivalent to using --ignorelockingfailure, --ignoremonitor‐
516 ing, --poll n, and setting env var LVM_SUPPRESS_LOCKING_FAIL‐
517 URE_MESSAGES. vgchange/lvchange skip autoactivation, and defer
518 to pvscan autoactivation.
519
520 -t|--test
521 Run in test mode. Commands will not update metadata. This is
522 implemented by disabling all metadata writing but nevertheless
523 returning success to the calling function. This may lead to
524 unusual error messages in multi-stage operations if a tool
525 relies on reading back metadata it believes has changed but
526 hasn't.
527
528 -v|--verbose ...
529 Set verbose level. Repeat from 1 to 4 times to increase the
530 detail of messages sent to stdout and stderr.
531
532 --version
533 Display version information.
534
535 --[raid]writebehind Number
536 The maximum number of outstanding writes that are allowed to
537 devices in a RAID1 LV that is marked write-mostly. Once this
538 value is exceeded, writes become synchronous (i.e. all writes to
539 the constituent devices must complete before the array signals
540 the write has completed). Setting the value to zero clears the
541 preference and allows the system to choose the value arbitrar‐
542 ily.
543
544 --[raid]writemostly PV[:t|n|y]
545 Mark a device in a RAID1 LV as write-mostly. All reads to these
546 drives will be avoided unless absolutely necessary. This keeps
547 the number of I/Os to the drive to a minimum. The default behav‐
548 ior is to set the write-mostly attribute for the specified PV.
549 It is also possible to remove the write-mostly flag by adding
550 the suffix :n at the end of the PV name, or to toggle the value
551 with the suffix :t. Repeat this option to change the attribute
552 on multiple PVs.
553
554 -y|--yes
555 Do not prompt for confirmation interactively but always assume
556 the answer yes. Use with extreme caution. (For automatic no,
557 see -qq.)
558
559 -Z|--zero y|n
560 Set zeroing mode for thin pool. Note: already provisioned blocks
561 from pool in non-zero mode are not cleared in unwritten parts
562 when setting --zero y.
563
565 VG
566 Volume Group name. See lvm(8) for valid names.
567
568 LV
569 Logical Volume name. See lvm(8) for valid names. An LV posi‐
570 tional arg generally includes the VG name and LV name, e.g.
571 VG/LV. LV followed by _<type> indicates that an LV of the given
572 type is required. (raid represents raid<N> type)
573
574 Tag
575 Tag name. See lvm(8) for information about tag names and using
576 tags in place of a VG, LV or PV.
577
578 Select
579 Select indicates that a required positional parameter can be
580 omitted if the --select option is used. No arg appears in this
581 position.
582
583 String
584 See the option description for information about the string con‐
585 tent.
586
587 Size[UNIT]
588 Size is an input number that accepts an optional unit. Input
589 units are always treated as base two values, regardless of capi‐
590 talization, e.g. 'k' and 'K' both refer to 1024. The default
591 input unit is specified by letter, followed by |UNIT. UNIT rep‐
592 resents other possible input units: bBsSkKmMgGtTpPeE. b|B is
593 bytes, s|S is sectors of 512 bytes, k|K is kilobytes, m|M is
594 megabytes, g|G is gigabytes, t|T is terabytes, p|P is petabytes,
595 e|E is exabytes. (This should not be confused with the output
596 control --units, where capital letters mean multiple of 1000.)
597
599 See lvm(8) for information about environment variables used by lvm.
600 For example, LVM_VG_NAME can generally be substituted for a required VG
601 parameter.
602
604 Change LV permission to read-only:
605
606 lvchange -pr vg00/lvol1
607
609 lvm(8) lvm.conf(5) lvmconfig(8)
610
611 pvchange(8) pvck(8) pvcreate(8) pvdisplay(8) pvmove(8) pvremove(8)
612 pvresize(8) pvs(8) pvscan(8)
613
614 vgcfgbackup(8) vgcfgrestore(8) vgchange(8) vgck(8) vgcreate(8) vgcon‐
615 vert(8) vgdisplay(8) vgexport(8) vgextend(8) vgimport(8) vgimport‐
616 clone(8) vgmerge(8) vgmknodes(8) vgreduce(8) vgremove(8) vgrename(8)
617 vgs(8) vgscan(8) vgsplit(8)
618
619 lvcreate(8) lvchange(8) lvconvert(8) lvdisplay(8) lvextend(8) lvre‐
620 duce(8) lvremove(8) lvrename(8) lvresize(8) lvs(8) lvscan(8)
621
622 lvm-fullreport(8) lvm-lvpoll(8) lvm2-activation-generator(8) blkdeacti‐
623 vate(8) lvmdump(8)
624
625 dmeventd(8) lvmpolld(8) lvmlockd(8) lvmlockctl(8) cmirrord(8) lvmd‐
626 busd(8)
627
628 lvmsystemid(7) lvmreport(7) lvmraid(7) lvmthin(7) lvmcache(7)
629
630
631
632Red Hat, Inc. LVM TOOLS 2.03.02(2)-RHEL8 (2019-01-04) LVCHANGE(8)