1LVCHANGE(8) System Manager's Manual LVCHANGE(8)
2
3
4
6 lvchange — change attributes of a logical volume
7
9 lvchange [-a|--activate [a][e|s|l]{y|n}] [--activationmode {com‐
10 plete|degraded|partial}] [--addtag Tag] [-K|--ignoreactivationskip]
11 [-k|--setactivationskip {y|n}] [--alloc AllocationPolicy] [-A|--auto‐
12 backup {y|n}] [--cachepolicy policy] [--cachesettings key=value]
13 [--commandprofile ProfileName] [-C|--contiguous {y|n}] [-d|--debug]
14 [--degraded] [--deltag Tag] [--detachprofile] [--discards
15 {ignore|nopassdown|passdown}] [--errorwhenfull {y|n}] [-h|-?|--help]
16 [--ignorelockingfailure] [--ignoremonitoring] [--ignoreskippedcluster]
17 [--metadataprofile ProfileName] [--monitor {y|n}] [--noudevsync]
18 [-P|--partial] [-p|--permission {r|rw}] [-M|--persistent {y|n} [--major
19 major] [--minor minor]] [--poll {y|n}] [--[raid]maxrecoveryrate Rate]
20 [--[raid]minrecoveryrate Rate] [--[raid]syncaction {check|repair}]
21 [--[raid]writebehind IOCount] [--[raid]writemostly PhysicalVol‐
22 ume[:{y|n|t}]] [-r|--readahead {ReadAheadSectors|auto|none}]
23 [--refresh] [--resync] [-S|--select Selection] [--sysinit] [-t|--test]
24 [-v|--verbose] [-Z|--zero {y|n}] [LogicalVolumePath...]
25
27 lvchange allows you to change the attributes of a logical volume
28 including making them known to the kernel ready for use.
29
31 See lvm(8) for common options.
32
33 -a|--activate [a][e|s|l]{y|n}
34 Controls the availability of the logical volumes for use. Com‐
35 municates with the kernel device-mapper driver via libdevmapper
36 to activate (-ay) or deactivate (-an) the logical volumes.
37 Activation of a logical volume creates a symbolic link /dev/Vol‐
38 umeGroupName/LogicalVolumeName pointing to the device node.
39 This link is removed on deactivation. All software and scripts
40 should access the device through this symbolic link and present
41 this as the name of the device. The location and name of the
42 underlying device node may depend on the distribution and con‐
43 figuration (e.g. udev) and might change from release to release.
44 If autoactivation option is used (-aay), the logical volume is
45 activated only if it matches an item in the activa‐
46 tion/auto_activation_volume_list set in lvm.conf(5). If this
47 list is not set, then all volumes are considered for activation.
48 The -aay option should be also used during system boot so it's
49 possible to select which volumes to activate using the activa‐
50 tion/auto_activation_volume_list setting.
51 In a clustered VG, clvmd is used for activation, and the follow‐
52 ing options are possible:
53
54 With -aey, clvmd activates the LV in exclusive mode (with an
55 exclusive lock), allowing a single node to activate the LV.
56
57 With -asy, clvmd activates the LV in shared mode (with a shared
58 lock), allowing multiple nodes to activate the LV concurrently.
59 If the LV type prohibits shared access, such as an LV with a
60 snapshot, the 's' option is ignored and an exclusive lock is
61 used.
62
63 With -ay (no mode specified), clvmd activates the LV in shared
64 mode if the LV type allows concurrent access, such as a linear
65 LV. Otherwise, clvmd activates the LV in exclusive mode.
66
67 With -aey, -asy, and -ay, clvmd attempts to activate the LV on
68 all nodes. If exclusive mode is used, then only one of the
69 nodes will be successful.
70
71 With -an, clvmd attempts to deactivate the LV on all nodes.
72
73 With -aly, clvmd activates the LV only on the local node, and
74 -aln deactivates only on the local node. If the LV type allows
75 concurrent access, then shared mode is used, otherwise exclu‐
76 sive.
77
78 LVs with snapshots are always activated exclusively because they
79 can only be used on one node at once.
80
81 For local VGs -ay, -aey, and -asy are all equivalent.
82
83 --activationmode {complete|degraded|partial}
84 The activation mode determines whether logical volumes are
85 allowed to activate when there are physical volumes missing
86 (e.g. due to a device failure). complete is the most restric‐
87 tive; allowing only those logical volumes to be activated that
88 are not affected by the missing PVs. degraded allows RAID logi‐
89 cal volumes to be activated even if they have PVs missing.
90 (Note that the "mirror" segment type is not considered a RAID
91 logical volume. The "raid1" segment type should be used
92 instead.) Finally, partial allows any logical volume to be
93 activated even if portions are missing due to a missing or
94 failed PV. This last option should only be used when performing
95 recovery or repair operations. degraded is the default mode.
96 To change it, modify activation_mode in lvm.conf(5).
97
98 -K|--ignoreactivationskip
99 Ignore the flag to skip Logical Volumes during activation.
100
101 -k|--setactivationskip {y|n}
102 Controls whether Logical Volumes are persistently flagged to be
103 skipped during activation. By default, thin snapshot volumes are
104 flagged for activation skip. To activate such volumes, an extra
105 --ignoreactivationskip option must be used. The flag is not
106 applied during deactivation. To see whether the flag is
107 attached, use lvs(8) command where the state of the flag is
108 reported within lv_attr bits.
109
110 --cachepolicy policy, --cachesettings key=value
111 Only applicable to cached LVs; see also lvmcache(7). Sets the
112 cache policy and its associated tunable settings. In most use-
113 cases, default values should be adequate.
114
115 -C|--contiguous {y|n}
116 Tries to set or reset the contiguous allocation policy for logi‐
117 cal volumes. It's only possible to change a non-contiguous logi‐
118 cal volume's allocation policy to contiguous, if all of the
119 allocated physical extents are already contiguous.
120
121 --detachprofile
122 Detach any metadata configuration profiles attached to given
123 Logical Volumes. See lvm.conf(5) for more information about
124 metadata profiles.
125
126 --discards {ignore|nopassdown|passdown}
127 Set this to ignore to ignore any discards received by a thin
128 pool Logical Volume. Set to nopassdown to process such discards
129 within the thin pool itself and allow the no-longer-needed
130 extents to be overwritten by new data. Set to passdown (the
131 default) to process them both within the thin pool itself and to
132 pass them down the underlying device.
133
134 --errorwhenfull {y|n}
135 Sets thin pool behavior when data space is exhaused. See lvcre‐
136 ate(8) for information.
137
138 --ignoremonitoring
139 Make no attempt to interact with dmeventd unless --monitor is
140 specified. Do not use this if dmeventd is already monitoring a
141 device.
142
143 --major major
144 Sets the major number. This option is supported only on older
145 systems (kernel version 2.4) and is ignored on modern Linux sys‐
146 tems where major numbers are dynamically assigned.
147
148 --minor minor
149 Set the minor number.
150
151 --metadataprofile ProfileName
152 Uses and attaches ProfileName configuration profile to the logi‐
153 cal volume metadata. Whenever the logical volume is processed
154 next time, the profile is automatically applied. If the volume
155 group has another profile attached, the logical volume profile
156 is preferred. See lvm.conf(5) for more information about meta‐
157 data profiles.
158
159 --monitor {y|n}
160 Start or stop monitoring a mirrored or snapshot logical volume
161 with dmeventd, if it is installed. If a device used by a moni‐
162 tored mirror reports an I/O error, the failure is handled
163 according to mirror_image_fault_policy and mirror_log_fault_pol‐
164 icy set in lvm.conf(5).
165
166 --noudevsync
167 Disable udev synchronisation. The process will not wait for
168 notification from udev. It will continue irrespective of any
169 possible udev processing in the background. You should only use
170 this if udev is not running or has rules that ignore the devices
171 LVM2 creates.
172
173 -p|--permission {r|rw}
174 Change access permission to read-only or read/write.
175
176 -M|--persistent {y|n}
177 Set to y to make the minor number specified persistent. Change
178 of persistent numbers is not supported for pool volumes.
179
180 --poll {y|n}
181 Without polling a logical volume's backgrounded transformation
182 process will never complete. If there is an incomplete pvmove
183 or lvconvert (for example, on rebooting after a crash), use
184 --poll y to restart the process from its last checkpoint. How‐
185 ever, it may not be appropriate to immediately poll a logical
186 volume when it is activated, use --poll n to defer and then
187 --poll y to restart the process.
188
189 --[raid]maxrecoveryrate Rate[b|B|s|S|k|K|m|M|g|G]
190 Sets the maximum recovery rate for a RAID logical volume. Rate
191 is specified as an amount per second for each device in the
192 array. If no suffix is given, then KiB/sec/device is assumed.
193 Setting the recovery rate to 0 means it will be unbounded.
194
195 --[raid]minrecoveryrate Rate[b|B|s|S|k|K|m|M|g|G]
196 Sets the minimum recovery rate for a RAID logical volume. Rate
197 is specified as an amount per second for each device in the
198 array. If no suffix is given, then KiB/sec/device is assumed.
199 Setting the recovery rate to 0 means it will be unbounded.
200
201 --[raid]syncaction {check|repair}
202 This argument is used to initiate various RAID synchronization
203 operations. The check and repair options provide a way to check
204 the integrity of a RAID logical volume (often referred to as
205 "scrubbing"). These options cause the RAID logical volume to
206 read all of the data and parity blocks in the array and check
207 for any discrepancies (e.g. mismatches between mirrors or incor‐
208 rect parity values). If check is used, the discrepancies will
209 be counted but not repaired. If repair is used, the discrepan‐
210 cies will be corrected as they are encountered. The lvs(8) com‐
211 mand can be used to show the number of discrepancies found or
212 repaired.
213
214 --[raid]writebehind IOCount
215 Specify the maximum number of outstanding writes that are
216 allowed to devices in a RAID1 logical volume that are marked as
217 write-mostly. Once this value is exceeded, writes become syn‐
218 chronous (i.e. all writes to the constituent devices must com‐
219 plete before the array signals the write has completed). Set‐
220 ting the value to zero clears the preference and allows the sys‐
221 tem to choose the value arbitrarily.
222
223 --[raid]writemostly PhysicalVolume[:{y|n|t}]
224 Mark a device in a RAID1 logical volume as write-mostly. All
225 reads to these drives will be avoided unless absolutely neces‐
226 sary. This keeps the number of I/Os to the drive to a minimum.
227 The default behavior is to set the write-mostly attribute for
228 the specified physical volume in the logical volume. It is pos‐
229 sible to also remove the write-mostly flag by appending a ":n"
230 to the physical volume or to toggle the value by specifying
231 ":t". The --writemostly argument can be specified more than one
232 time in a single command; making it possible to toggle the
233 write-mostly attributes for all the physical volumes in a logi‐
234 cal volume at once.
235
236 -r|--readahead {ReadAheadSectors|auto|none}
237 Set read ahead sector count of this logical volume. For volume
238 groups with metadata in lvm1 format, this must be a value
239 between 2 and 120 sectors. The default value is "auto" which
240 allows the kernel to choose a suitable value automatically.
241 "none" is equivalent to specifying zero.
242
243 --refresh
244 If the logical volume is active, reload its metadata. This is
245 not necessary in normal operation, but may be useful if some‐
246 thing has gone wrong or if you're doing clustering manually
247 without a clustered lock manager.
248
249 --resync
250 Forces the complete resynchronization of a mirror. In normal
251 circumstances you should not need this option because synchro‐
252 nization happens automatically. Data is read from the primary
253 mirror device and copied to the others, so this can take a con‐
254 siderable amount of time - and during this time you are without
255 a complete redundant copy of your data.
256
257 --sysinit
258 Indicates that lvchange(8) is being invoked from early system
259 initialisation scripts (e.g. rc.sysinit or an initrd), before
260 writeable filesystems are available. As such, some functionality
261 needs to be disabled and this option acts as a shortcut which
262 selects an appropriate set of options. Currently this is equiva‐
263 lent to using --ignorelockingfailure, --ignoremonitoring,
264 --poll n and setting LVM_SUPPRESS_LOCKING_FAILURE_MESSAGES envi‐
265 ronment variable.
266
267 If --sysinit is used in conjunction with lvmetad(8) enabled and
268 running, autoactivation is preferred over manual activation via
269 direct lvchange call. Logical volumes are autoactivated accord‐
270 ing to
271 auto_activation_volume_list set in lvm.conf(5).
272
273 -Z|--zero {y|n}
274 Set zeroing mode for thin pool. Note: already provisioned blocks
275 from pool in non-zero mode are not cleared in unwritten parts
276 when setting zero to y.
277
279 LVM_SUPPRESS_LOCKING_FAILURE_MESSAGES
280 Suppress locking failure messages.
281
283 Changes the permission on volume lvol1 in volume group vg00 to be read-
284 only:
285
286 lvchange -pr vg00/lvol1
287
289 lvm(8), lvmetad(8), lvs(8), lvcreate(8), vgchange(8), lvmcache(7),
290 lvmthin(7), lvm.conf(5)
291
292
293
294Sistina Software UKLVM TOOLS 2.02.143(2)-RHEL6 (2016-12-13) LVCHANGE(8)