1LVRESIZE(8) System Manager's Manual LVRESIZE(8)
2
3
4
6 lvresize — Resize a logical volume
7
9 lvresize option_args position_args
10 [ option_args ]
11 [ position_args ]
12
13 --alloc contiguous|cling|cling_by_tags|normal|anywhere|inherit
14 -A|--autobackup y|n
15 --commandprofile String
16 --config String
17 -d|--debug
18 --devices PV
19 --devicesfile String
20 --driverloaded y|n
21 -l|--extents [+|-]Number[PERCENT]
22 -f|--force
23 --fs String
24 --fsmode String
25 -h|--help
26 --journal String
27 --lockopt String
28 --longhelp
29 -n|--nofsck
30 --nohints
31 --nolocking
32 --nosync
33 --noudevsync
34 --poolmetadatasize [+]Size[m|UNIT]
35 --profile String
36 -q|--quiet
37 --reportformat basic|json|json_std
38 -r|--resizefs
39 -L|--size [+|-]Size[m|UNIT]
40 -i|--stripes Number
41 -I|--stripesize Size[k|UNIT]
42 -t|--test
43 --type linear|striped|snapshot|raid|mirror|thin|thin-pool|vdo|
44 vdo-pool|cache|cache-pool|writecache
45 -v|--verbose
46 --version
47 -y|--yes
48
50 lvresize resizes an LV in the same way as lvextend and lvreduce. See
51 lvextend(8) and lvreduce(8) for more information.
52
53 In the usage section below, --size Size can be replaced with --extents
54 Number. See both descriptions the options section.
55
57 Resize an LV by a specified size.
58
59 lvresize -L|--size [+|-]Size[m|UNIT] LV
60 [ -l|--extents [+|-]Number[PERCENT] ]
61 [ -r|--resizefs ]
62 [ --poolmetadatasize [+]Size[m|UNIT] ]
63 [ --fs String ]
64 [ --fsmode String ]
65 [ COMMON_OPTIONS ]
66 [ PV ... ]
67
68 —
69
70 Resize an LV by specified PV extents.
71
72 lvresize LV PV ...
73 [ -r|--resizefs ]
74 [ --fs String ]
75 [ --fsmode String ]
76 [ COMMON_OPTIONS ]
77
78 —
79
80 Resize a pool metadata SubLV by a specified size.
81
82 lvresize --poolmetadatasize [+]Size[m|UNIT] LV1
83 [ COMMON_OPTIONS ]
84 [ PV ... ]
85
86 LV1 types: thinpool
87
88 —
89
90 Common options for command:
91 [ -A|--autobackup y|n ]
92 [ -f|--force ]
93 [ -n|--nofsck ]
94 [ -i|--stripes Number ]
95 [ -I|--stripesize Size[k|UNIT] ]
96 [ --alloc contiguous|cling|cling_by_tags|normal|anywhere|inherit
97 ]
98 [ --nosync ]
99 [ --noudevsync ]
100 [ --reportformat basic|json|json_std ]
101 [ --type linear|striped|snapshot|raid|mirror|thin|thin-pool|vdo|
102 vdo-pool|cache|cache-pool|writecache ]
103
104 Common options for lvm:
105 [ -d|--debug ]
106 [ -h|--help ]
107 [ -q|--quiet ]
108 [ -t|--test ]
109 [ -v|--verbose ]
110 [ -y|--yes ]
111 [ --commandprofile String ]
112 [ --config String ]
113 [ --devices PV ]
114 [ --devicesfile String ]
115 [ --driverloaded y|n ]
116 [ --journal String ]
117 [ --lockopt String ]
118 [ --longhelp ]
119 [ --nohints ]
120 [ --nolocking ]
121 [ --profile String ]
122 [ --version ]
123
125 --alloc contiguous|cling|cling_by_tags|normal|anywhere|inherit
126 Determines the allocation policy when a command needs to allo‐
127 cate Physical Extents (PEs) from the VG. Each VG and LV has an
128 allocation policy which can be changed with vgchange/lvchange,
129 or overridden on the command line. normal applies common sense
130 rules such as not placing parallel stripes on the same PV. in‐
131 herit applies the VG policy to an LV. contiguous requires new
132 PEs be placed adjacent to existing PEs. cling places new PEs on
133 the same PV as existing PEs in the same stripe of the LV. If
134 there are sufficient PEs for an allocation, but normal does not
135 use them, anywhere will use them even if it reduces performance,
136 e.g. by placing two stripes on the same PV. Optional positional
137 PV args on the command line can also be used to limit which PVs
138 the command will use for allocation. See lvm(8) for more infor‐
139 mation about allocation.
140
141 -A|--autobackup y|n
142 Specifies if metadata should be backed up automatically after a
143 change. Enabling this is strongly advised! See vgcfgbackup(8)
144 for more information.
145
146 --commandprofile String
147 The command profile to use for command configuration. See
148 lvm.conf(5) for more information about profiles.
149
150 --config String
151 Config settings for the command. These override lvm.conf(5) set‐
152 tings. The String arg uses the same format as lvm.conf(5), or
153 may use section/field syntax. See lvm.conf(5) for more informa‐
154 tion about config.
155
156 -d|--debug ...
157 Set debug level. Repeat from 1 to 6 times to increase the detail
158 of messages sent to the log file and/or syslog (if configured).
159
160 --devices PV
161 Restricts the devices that are visible and accessible to the
162 command. Devices not listed will appear to be missing. This op‐
163 tion can be repeated, or accepts a comma separated list of de‐
164 vices. This overrides the devices file.
165
166 --devicesfile String
167 A file listing devices that LVM should use. The file must exist
168 in /etc/lvm/devices/ and is managed with the lvmdevices(8) com‐
169 mand. This overrides the lvm.conf(5) devices/devicesfile and
170 devices/use_devicesfile settings.
171
172 --driverloaded y|n
173 If set to no, the command will not attempt to use device-mapper.
174 For testing and debugging.
175
176 -l|--extents [+|-]Number[PERCENT]
177 Specifies the new size of the LV in logical extents. The --size
178 and --extents options are alternate methods of specifying size.
179 The total number of physical extents used will be greater when
180 redundant data is needed for RAID levels. An alternate syntax
181 allows the size to be determined indirectly as a percentage of
182 the size of a related VG, LV, or set of PVs. The suffix %VG de‐
183 notes the total size of the VG, the suffix %FREE the remaining
184 free space in the VG, and the suffix %PVS the free space in the
185 specified PVs. For a snapshot, the size can be expressed as a
186 percentage of the total size of the origin LV with the suffix
187 %ORIGIN (100%ORIGIN provides space for the whole origin). When
188 expressed as a percentage, the size defines an upper limit for
189 the number of logical extents in the new LV. The precise number
190 of logical extents in the new LV is not determined until the
191 command has completed. When the plus + or minus - prefix is
192 used, the value is not an absolute size, but is relative and
193 added or subtracted from the current size.
194
195 -f|--force ...
196 Override various checks, confirmations and protections. Use
197 with extreme caution.
198
199 --fs String
200 Control file system resizing when resizing an LV. checksize:
201 Check the fs size and reduce the LV if the fs is not using the
202 reduced space (fs reduce is not needed.) If the reduced space is
203 used by the fs, then do not resize the fs or LV, and return an
204 error. (checksize only applies when reducing, and does nothing
205 for extend.) resize: Resize the fs by calling the fs-specific
206 resize command. This may also include mounting, unmounting, or
207 running fsck. See --fsmode to control mounting behavior, and
208 --nofsck to disable fsck. resize_fsadm: Use the old method of
209 calling fsadm to handle the fs (deprecated.) Warning: this op‐
210 tion does not prevent lvreduce from destroying file systems that
211 are unmounted (or mounted if prompts are skipped.) ignore: Re‐
212 size the LV without checking for or handling a file system.
213 Warning: using ignore when reducing the LV size may destroy the
214 file system.
215
216 --fsmode String
217 Control file system mounting behavior for fs resize. manage:
218 Mount or unmount the fs as needed to resize the fs, and attempt
219 to restore the original mount state at the end. nochange: Do
220 not mount or unmount the fs. If mounting or unmounting is re‐
221 quired to resize the fs, then do not resize the fs or the LV and
222 fail the command. offline: Unmount the fs if it is mounted, and
223 resize the fs while it is unmounted. If mounting is required to
224 resize the fs, then do not resize the fs or the LV and fail the
225 command.
226
227 -h|--help
228 Display help text.
229
230 --journal String
231 Record information in the systemd journal. This information is
232 in addition to information enabled by the lvm.conf log/journal
233 setting. command: record information about the command. out‐
234 put: record the default command output. debug: record full com‐
235 mand debugging.
236
237 --lockopt String
238 Used to pass options for special cases to lvmlockd. See lvm‐
239 lockd(8) for more information.
240
241 --longhelp
242 Display long help text.
243
244 -n|--nofsck
245 Do not perform fsck when resizing the file system with --re‐
246 sizefs.
247
248 --nohints
249 Do not use the hints file to locate devices for PVs. A command
250 may read more devices to find PVs when hints are not used. The
251 command will still perform standard hint file invalidation where
252 appropriate.
253
254 --nolocking
255 Disable locking. Use with caution, concurrent commands may pro‐
256 duce incorrect results.
257
258 --nosync
259 Causes the creation of mirror, raid1, raid4, raid5 and raid10 to
260 skip the initial synchronization. In case of mirror, raid1 and
261 raid10, any data written afterwards will be mirrored, but the
262 original contents will not be copied. In case of raid4 and
263 raid5, no parity blocks will be written, though any data written
264 afterwards will cause parity blocks to be stored. This is use‐
265 ful for skipping a potentially long and resource intensive ini‐
266 tial sync of an empty mirror/raid1/raid4/raid5 and raid10 LV.
267 This option is not valid for raid6, because raid6 relies on
268 proper parity (P and Q Syndromes) being created during initial
269 synchronization in order to reconstruct proper user date in case
270 of device failures. raid0 and raid0_meta do not provide any da‐
271 ta copies or parity support and thus do not support initial syn‐
272 chronization.
273
274 --noudevsync
275 Disables udev synchronisation. The process will not wait for no‐
276 tification from udev. It will continue irrespective of any pos‐
277 sible udev processing in the background. Only use this if udev
278 is not running or has rules that ignore the devices LVM creates.
279
280 --poolmetadatasize [+]Size[m|UNIT]
281 Specifies the new size of the pool metadata LV. The plus prefix
282 + can be used, in which case the value is added to the current
283 size.
284
285 --profile String
286 An alias for --commandprofile or --metadataprofile, depending on
287 the command.
288
289 -q|--quiet ...
290 Suppress output and log messages. Overrides --debug and --ver‐
291 bose. Repeat once to also suppress any prompts with answer
292 'no'.
293
294 --reportformat basic|json|json_std
295 Overrides current output format for reports which is defined
296 globally by the report/output_format setting in lvm.conf(5).
297 basic is the original format with columns and rows. If there is
298 more than one report per command, each report is prefixed with
299 the report name for identification. json produces report output
300 in JSON format. json_std produces report output in JSON format
301 which is more compliant with JSON standard. See lvmreport(7)
302 for more information.
303
304 -r|--resizefs
305 Resize the fs using the fs-specific resize command. May include
306 mounting, unmounting, or running fsck. See --fsmode to control
307 mounting behavior, and --nofsck to disable fsck. See --fs for
308 more options (--resizefs is equivalent to --fs resize.)
309
310 -L|--size [+|-]Size[m|UNIT]
311 Specifies the new size of the LV. The --size and --extents op‐
312 tions are alternate methods of specifying size. The total num‐
313 ber of physical extents used will be greater when redundant data
314 is needed for RAID levels. When the plus + or minus - prefix is
315 used, the value is not an absolute size, but is relative and
316 added or subtracted from the current size.
317
318 -i|--stripes Number
319 Specifies the number of stripes in a striped LV. This is the
320 number of PVs (devices) that a striped LV is spread across. Data
321 that appears sequential in the LV is spread across multiple de‐
322 vices in units of the stripe size (see --stripesize). This does
323 not change existing allocated space, but only applies to space
324 being allocated by the command. When creating a RAID 4/5/6 LV,
325 this number does not include the extra devices that are required
326 for parity. The largest number depends on the RAID type (raid0:
327 64, raid10: 32, raid4/5: 63, raid6: 62), and when unspecified,
328 the default depends on the RAID type (raid0: 2, raid10: 2,
329 raid4/5: 3, raid6: 5.) To stripe a new raid LV across all PVs
330 by default, see lvm.conf(5) allocation/raid_stripe_all_devices.
331
332 -I|--stripesize Size[k|UNIT]
333 The amount of data that is written to one device before moving
334 to the next in a striped LV.
335
336 -t|--test
337 Run in test mode. Commands will not update metadata. This is
338 implemented by disabling all metadata writing but nevertheless
339 returning success to the calling function. This may lead to un‐
340 usual error messages in multi-stage operations if a tool relies
341 on reading back metadata it believes has changed but hasn't.
342
343 --type linear|striped|snapshot|raid|mirror|thin|thin-pool|vdo|vdo-pool|
344 cache|cache-pool|writecache
345 The LV type, also known as "segment type" or "segtype". See us‐
346 age descriptions for the specific ways to use these types. For
347 more information about redundancy and performance (raid<N>, mir‐
348 ror, striped, linear) see lvmraid(7). For thin provisioning
349 (thin, thin-pool) see lvmthin(7). For performance caching
350 (cache, cache-pool) see lvmcache(7). For copy-on-write snap‐
351 shots (snapshot) see usage definitions. For VDO (vdo) see lvmv‐
352 do(7). Several commands omit an explicit type option because
353 the type is inferred from other options or shortcuts (e.g.
354 --stripes, --mirrors, --snapshot, --virtualsize, --thin,
355 --cache, --vdo). Use inferred types with care because it can
356 lead to unexpected results.
357
358 -v|--verbose ...
359 Set verbose level. Repeat from 1 to 4 times to increase the de‐
360 tail of messages sent to stdout and stderr.
361
362 --version
363 Display version information.
364
365 -y|--yes
366 Do not prompt for confirmation interactively but always assume
367 the answer yes. Use with extreme caution. (For automatic no,
368 see -qq.)
369
371 LV Logical Volume name. See lvm(8) for valid names. An LV posi‐
372 tional arg generally includes the VG name and LV name, e.g.
373 VG/LV. LV1 indicates the LV must have a specific type, where
374 the accepted LV types are listed. (raid represents raid<N>
375 type).
376
377 PV Physical Volume name, a device path under /dev. For commands
378 managing physical extents, a PV positional arg generally accepts
379 a suffix indicating a range (or multiple ranges) of physical ex‐
380 tents (PEs). When the first PE is omitted, it defaults to the
381 start of the device, and when the last PE is omitted it defaults
382 to end. Start and end range (inclusive): PV[:PE-PE]... Start
383 and length range (counting from 0): PV[:PE+PE]...
384
385 String See the option description for information about the string con‐
386 tent.
387
388 Size[UNIT]
389 Size is an input number that accepts an optional unit. Input
390 units are always treated as base two values, regardless of capi‐
391 talization, e.g. 'k' and 'K' both refer to 1024. The default
392 input unit is specified by letter, followed by |UNIT. UNIT rep‐
393 resents other possible input units: b|B is bytes, s|S is sectors
394 of 512 bytes, k|K is KiB, m|M is MiB, g|G is GiB, t|T is TiB,
395 p|P is PiB, e|E is EiB. (This should not be confused with the
396 output control --units, where capital letters mean multiple of
397 1000.)
398
400 See lvm(8) for information about environment variables used by lvm.
401 For example, LVM_VG_NAME can generally be substituted for a required VG
402 parameter.
403
405 Extend an LV by 16MB using specific physical extents.
406 lvresize -L+16M vg1/lv1 /dev/sda:0-1 /dev/sdb:0-1
407
408 Resize an LV to use 50% of the size volume group.
409 lvresize -l50%VG vg1/lv1
410
412 lvm(8), lvm.conf(5), lvmconfig(8), lvmdevices(8),
413
414 pvchange(8), pvck(8), pvcreate(8), pvdisplay(8), pvmove(8),
415 pvremove(8), pvresize(8), pvs(8), pvscan(8),
416
417 vgcfgbackup(8), vgcfgrestore(8), vgchange(8), vgck(8), vgcreate(8),
418 vgconvert(8), vgdisplay(8), vgexport(8), vgextend(8), vgimport(8),
419 vgimportclone(8), vgimportdevices(8), vgmerge(8), vgmknodes(8),
420 vgreduce(8), vgremove(8), vgrename(8), vgs(8), vgscan(8), vgsplit(8),
421
422 lvcreate(8), lvchange(8), lvconvert(8), lvdisplay(8), lvextend(8),
423 lvreduce(8), lvremove(8), lvrename(8), lvresize(8), lvs(8), lvscan(8),
424
425 lvm-fullreport(8), lvm-lvpoll(8), blkdeactivate(8), lvmdump(8),
426
427 dmeventd(8), lvmpolld(8), lvmlockd(8), lvmlockctl(8), cmirrord(8),
428 lvmdbusd(8), fsadm(8),
429
430 lvmsystemid(7), lvmreport(7), lvmraid(7), lvmthin(7), lvmcache(7)
431
432
433
434Red Hat, Inc. LVM TOOLS 2.03.18(2)-git (2022-11-10) LVRESIZE(8)