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