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|anywhere|in‐
89 herit,
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
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 un‐
207 available. The block device for the LV is added or removed from
208 the system using device-mapper in the kernel. A symbolic link
209 /dev/VGName/LVName pointing to the device node is also added/re‐
210 moved. All software and scripts should access the device
211 through the symbolic link and present this as the name of the
212 device. The location and name of the underlying device node may
213 depend on the distribution, configuration (e.g. udev), or re‐
214 lease version. ay specifies autoactivation, in which case an LV
215 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 in‐
221 formation 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 de‐
231 fault, 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. in‐
244 herit 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. De‐
300 fault 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, de‐
339 vice-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 no‐
404 tification from udev. It will continue irrespective of any pos‐
405 sible udev processing in the background. Only use this if udev
406 is not running or has rules that ignore the devices LVM creates.
407
408 -P|--partial
409 Commands will do their best to activate LVs with missing PV ex‐
410 tents. Missing extents may be replaced with error or zero seg‐
411 ments according to the lvm.conf missing_stripe_filler setting.
412 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 in‐
422 complete transformation, e.g. pvmove or lvconvert interrupted by
423 reboot or crash, can be restarted from the last checkpoint with
424 --poll y. When no, background transformation of an LV will not
425 occur, and the transformation will not complete. It may not be
426 appropriate to immediately poll an LV after activation, in which
427 case --poll n can be used to defer polling until a later --poll
428 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 re‐
454 built 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 se‐
487 lectable 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 un‐
524 usual error messages in multi-stage operations if a tool relies
525 on reading back metadata it believes has changed but hasn't.
526
527 -v|--verbose ...
528 Set verbose level. Repeat from 1 to 4 times to increase the de‐
529 tail of messages sent to stdout and stderr.
530
531 --version
532 Display version information.
533
534 --[raid]writebehind Number
535 The maximum number of outstanding writes that are allowed to de‐
536 vices in a RAID1 LV that is marked write-mostly. Once this
537 value is exceeded, writes become synchronous (i.e. all writes to
538 the constituent devices must complete before the array signals
539 the write has completed). Setting the value to zero clears the
540 preference and allows the system to choose the value arbitrar‐
541 ily.
542
543 --[raid]writemostly PV[:t|n|y]
544 Mark a device in a RAID1 LV as write-mostly. All reads to these
545 drives will be avoided unless absolutely necessary. This keeps
546 the number of I/Os to the drive to a minimum. The default behav‐
547 ior is to set the write-mostly attribute for the specified PV.
548 It is also possible to remove the write-mostly flag by adding
549 the suffix :n at the end of the PV name, or to toggle the value
550 with the suffix :t. Repeat this option to change the attribute
551 on multiple PVs.
552
553 -y|--yes
554 Do not prompt for confirmation interactively but always assume
555 the answer yes. Use with extreme caution. (For automatic no,
556 see -qq.)
557
558 -Z|--zero y|n
559 Set zeroing mode for thin pool. Note: already provisioned blocks
560 from pool in non-zero mode are not cleared in unwritten parts
561 when setting --zero y.
562
564 VG
565 Volume Group name. See lvm(8) for valid names.
566
567 LV
568 Logical Volume name. See lvm(8) for valid names. An LV posi‐
569 tional arg generally includes the VG name and LV name, e.g.
570 VG/LV. LV followed by _<type> indicates that an LV of the given
571 type is required. (raid represents raid<N> type)
572
573 Tag
574 Tag name. See lvm(8) for information about tag names and using
575 tags in place of a VG, LV or PV.
576
577 Select
578 Select indicates that a required positional parameter can be
579 omitted if the --select option is used. No arg appears in this
580 position.
581
582 String
583 See the option description for information about the string con‐
584 tent.
585
586 Size[UNIT]
587 Size is an input number that accepts an optional unit. Input
588 units are always treated as base two values, regardless of capi‐
589 talization, e.g. 'k' and 'K' both refer to 1024. The default
590 input unit is specified by letter, followed by |UNIT. UNIT rep‐
591 resents other possible input units: bBsSkKmMgGtTpPeE. b|B is
592 bytes, s|S is sectors of 512 bytes, k|K is KiB, m|M is MiB, g|G
593 is GiB, t|T is TiB, p|P is PiB, e|E is EiB. (This should not be
594 confused with the output control --units, where capital letters
595 mean multiple of 1000.)
596
598 See lvm(8) for information about environment variables used by lvm.
599 For example, LVM_VG_NAME can generally be substituted for a required VG
600 parameter.
601
603 Change LV permission to read-only:
604
605 lvchange -pr vg00/lvol1
606
608 lvm(8) lvm.conf(5) lvmconfig(8)
609
610 pvchange(8) pvck(8) pvcreate(8) pvdisplay(8) pvmove(8) pvremove(8)
611 pvresize(8) pvs(8) pvscan(8)
612
613 vgcfgbackup(8) vgcfgrestore(8) vgchange(8) vgck(8) vgcreate(8) vgcon‐
614 vert(8) vgdisplay(8) vgexport(8) vgextend(8) vgimport(8) vgimport‐
615 clone(8) vgmerge(8) vgmknodes(8) vgreduce(8) vgremove(8) vgrename(8)
616 vgs(8) vgscan(8) vgsplit(8)
617
618 lvcreate(8) lvchange(8) lvconvert(8) lvdisplay(8) lvextend(8) lvre‐
619 duce(8) lvremove(8) lvrename(8) lvresize(8) lvs(8) lvscan(8)
620
621 lvm-fullreport(8) lvm-lvpoll(8) lvm2-activation-generator(8) blkdeacti‐
622 vate(8) lvmdump(8)
623
624 dmeventd(8) lvmpolld(8) lvmlockd(8) lvmlockctl(8) cmirrord(8) lvmd‐
625 busd(8)
626
627 lvmsystemid(7) lvmreport(7) lvmraid(7) lvmthin(7) lvmcache(7)
628
629
630
631Red Hat, Inc. LVM TOOLS 2.03.11(2) (2021-01-08) LVCHANGE(8)