1LVREDUCE(8) System Manager's Manual LVREDUCE(8)
2
3
4
6 lvreduce — Reduce the size of a logical volume
7
9 lvreduce option_args position_args
10 [ option_args ]
11
13 lvreduce reduces the size of an LV. The freed logical extents are re‐
14 turned to the VG to be used by other LVs. A copy-on-write snapshot LV
15 can also be reduced if less space is needed to hold COW blocks. Use lv‐
16 convert(8) to change the number of data images in a RAID or mirrored
17 LV.
18
19 Be careful when reducing an LV's size, because data in the reduced area
20 is lost. Ensure that any file system on the LV is resized before run‐
21 ning lvreduce so that the removed extents are not in use by the file
22 system.
23
24 Sizes will be rounded if necessary. For example, the LV size must be an
25 exact number of extents, and the size of a striped segment must be a
26 multiple of the number of stripes.
27
28 In the usage section below, --size Size can be replaced with --extents
29 Number. See both descriptions the options section.
30
32 lvreduce -L|--size [-]Size[m|UNIT] LV
33 [ -l|--extents [-]Number[PERCENT] ]
34 [ -A|--autobackup y|n ]
35 [ -f|--force ]
36 [ -n|--nofsck ]
37 [ -r|--resizefs ]
38 [ --noudevsync ]
39 [ --reportformat basic|json|json_std ]
40 [ --fs String ]
41 [ --fsmode String ]
42 [ COMMON_OPTIONS ]
43
44 Common options for lvm:
45 [ -d|--debug ]
46 [ -h|--help ]
47 [ -q|--quiet ]
48 [ -t|--test ]
49 [ -v|--verbose ]
50 [ -y|--yes ]
51 [ --commandprofile String ]
52 [ --config String ]
53 [ --devices PV ]
54 [ --devicesfile String ]
55 [ --driverloaded y|n ]
56 [ --journal String ]
57 [ --lockopt String ]
58 [ --longhelp ]
59 [ --nohints ]
60 [ --nolocking ]
61 [ --profile String ]
62 [ --version ]
63
65 -A|--autobackup y|n
66 Specifies if metadata should be backed up automatically after a
67 change. Enabling this is strongly advised! See vgcfgbackup(8)
68 for more information.
69
70 --commandprofile String
71 The command profile to use for command configuration. See
72 lvm.conf(5) for more information about profiles.
73
74 --config String
75 Config settings for the command. These override lvm.conf(5) set‐
76 tings. The String arg uses the same format as lvm.conf(5), or
77 may use section/field syntax. See lvm.conf(5) for more informa‐
78 tion about config.
79
80 -d|--debug ...
81 Set debug level. Repeat from 1 to 6 times to increase the detail
82 of messages sent to the log file and/or syslog (if configured).
83
84 --devices PV
85 Restricts the devices that are visible and accessible to the
86 command. Devices not listed will appear to be missing. This op‐
87 tion can be repeated, or accepts a comma separated list of de‐
88 vices. This overrides the devices file.
89
90 --devicesfile String
91 A file listing devices that LVM should use. The file must exist
92 in /etc/lvm/devices/ and is managed with the lvmdevices(8) com‐
93 mand. This overrides the lvm.conf(5) devices/devicesfile and
94 devices/use_devicesfile settings.
95
96 --driverloaded y|n
97 If set to no, the command will not attempt to use device-mapper.
98 For testing and debugging.
99
100 -l|--extents [-]Number[PERCENT]
101 Specifies the new size of the LV in logical extents. The --size
102 and --extents options are alternate methods of specifying size.
103 The total number of physical extents used will be greater when
104 redundant data is needed for RAID levels. An alternate syntax
105 allows the size to be determined indirectly as a percentage of
106 the size of a related VG, LV, or set of PVs. The suffix %VG de‐
107 notes the total size of the VG, the suffix %FREE the remaining
108 free space in the VG, and the suffix %PVS the free space in the
109 specified PVs. For a snapshot, the size can be expressed as a
110 percentage of the total size of the origin LV with the suffix
111 %ORIGIN (100%ORIGIN provides space for the whole origin). When
112 expressed as a percentage, the size defines an upper limit for
113 the number of logical extents in the new LV. The precise number
114 of logical extents in the new LV is not determined until the
115 command has completed. When the plus + or minus - prefix is
116 used, the value is not an absolute size, but is relative and
117 added or subtracted from the current size.
118
119 -f|--force ...
120 Override various checks, confirmations and protections. Use
121 with extreme caution.
122
123 --fs String
124 Control file system resizing when resizing an LV. checksize:
125 Check the fs size and reduce the LV if the fs is not using the
126 reduced space (fs reduce is not needed.) If the reduced space is
127 used by the fs, then do not resize the fs or LV, and return an
128 error. (checksize only applies when reducing, and does nothing
129 for extend.) resize: Resize the fs by calling the fs-specific
130 resize command. This may also include mounting, unmounting, or
131 running fsck. See --fsmode to control mounting behavior, and
132 --nofsck to disable fsck. resize_fsadm: Use the old method of
133 calling fsadm to handle the fs (deprecated.) Warning: this op‐
134 tion does not prevent lvreduce from destroying file systems that
135 are unmounted (or mounted if prompts are skipped.) ignore: Re‐
136 size the LV without checking for or handling a file system.
137 Warning: using ignore when reducing the LV size may destroy the
138 file system.
139
140 --fsmode String
141 Control file system mounting behavior for fs resize. manage:
142 Mount or unmount the fs as needed to resize the fs, and attempt
143 to restore the original mount state at the end. nochange: Do
144 not mount or unmount the fs. If mounting or unmounting is re‐
145 quired to resize the fs, then do not resize the fs or the LV and
146 fail the command. offline: Unmount the fs if it is mounted, and
147 resize the fs while it is unmounted. If mounting is required to
148 resize the fs, then do not resize the fs or the LV and fail the
149 command.
150
151 -h|--help
152 Display help text.
153
154 --journal String
155 Record information in the systemd journal. This information is
156 in addition to information enabled by the lvm.conf log/journal
157 setting. command: record information about the command. out‐
158 put: record the default command output. debug: record full com‐
159 mand debugging.
160
161 --lockopt String
162 Used to pass options for special cases to lvmlockd. See lvm‐
163 lockd(8) for more information.
164
165 --longhelp
166 Display long help text.
167
168 -n|--nofsck
169 Do not perform fsck when resizing the file system with --re‐
170 sizefs.
171
172 --nohints
173 Do not use the hints file to locate devices for PVs. A command
174 may read more devices to find PVs when hints are not used. The
175 command will still perform standard hint file invalidation where
176 appropriate.
177
178 --nolocking
179 Disable locking. Use with caution, concurrent commands may pro‐
180 duce incorrect results.
181
182 --noudevsync
183 Disables udev synchronization. The process will not wait for no‐
184 tification from udev. It will continue irrespective of any pos‐
185 sible udev processing in the background. Only use this if udev
186 is not running or has rules that ignore the devices LVM creates.
187
188 --profile String
189 An alias for --commandprofile or --metadataprofile, depending on
190 the command.
191
192 -q|--quiet ...
193 Suppress output and log messages. Overrides --debug and --ver‐
194 bose. Repeat once to also suppress any prompts with answer
195 'no'.
196
197 --reportformat basic|json|json_std
198 Overrides current output format for reports which is defined
199 globally by the report/output_format setting in lvm.conf(5).
200 basic is the original format with columns and rows. If there is
201 more than one report per command, each report is prefixed with
202 the report name for identification. json produces report output
203 in JSON format. json_std produces report output in JSON format
204 which is more compliant with JSON standard. See lvmreport(7)
205 for more information.
206
207 -r|--resizefs
208 Resize the fs using the fs-specific resize command. May include
209 mounting, unmounting, or running fsck. See --fsmode to control
210 mounting behavior, and --nofsck to disable fsck. See --fs for
211 more options (--resizefs is equivalent to --fs resize.)
212
213 -L|--size [-]Size[m|UNIT]
214 Specifies the new size of the LV. The --size and --extents op‐
215 tions are alternate methods of specifying size. The total num‐
216 ber of physical extents used will be greater when redundant data
217 is needed for RAID levels. When the plus + or minus - prefix is
218 used, the value is not an absolute size, but is relative and
219 added or subtracted from the current size.
220
221 -t|--test
222 Run in test mode. Commands will not update metadata. This is
223 implemented by disabling all metadata writing but nevertheless
224 returning success to the calling function. This may lead to un‐
225 usual error messages in multi-stage operations if a tool relies
226 on reading back metadata it believes has changed but hasn't.
227
228 -v|--verbose ...
229 Set verbose level. Repeat from 1 to 4 times to increase the de‐
230 tail of messages sent to stdout and stderr.
231
232 --version
233 Display version information.
234
235 -y|--yes
236 Do not prompt for confirmation interactively but always assume
237 the answer yes. Use with extreme caution. (For automatic no,
238 see -qq.)
239
241 LV Logical Volume name. See lvm(8) for valid names. An LV posi‐
242 tional arg generally includes the VG name and LV name, e.g.
243 VG/LV.
244
245 String See the option description for information about the string con‐
246 tent.
247
248 Size[UNIT]
249 Size is an input number that accepts an optional unit. Input
250 units are always treated as base two values, regardless of capi‐
251 talization, e.g. 'k' and 'K' both refer to 1024. The default
252 input unit is specified by letter, followed by |UNIT. UNIT rep‐
253 resents other possible input units: b|B is bytes, s|S is sectors
254 of 512 bytes, k|K is KiB, m|M is MiB, g|G is GiB, t|T is TiB,
255 p|P is PiB, e|E is EiB. (This should not be confused with the
256 output control --units, where capital letters mean multiple of
257 1000.)
258
260 See lvm(8) for information about environment variables used by lvm.
261 For example, LVM_VG_NAME can generally be substituted for a required VG
262 parameter.
263
265 Reduce the size of an LV by 3 logical extents:
266 lvreduce -l -3 vg00/lvol1
267
269 lvm(8), lvm.conf(5), lvmconfig(8), lvmdevices(8),
270
271 pvchange(8), pvck(8), pvcreate(8), pvdisplay(8), pvmove(8),
272 pvremove(8), pvresize(8), pvs(8), pvscan(8),
273
274 vgcfgbackup(8), vgcfgrestore(8), vgchange(8), vgck(8), vgcreate(8),
275 vgconvert(8), vgdisplay(8), vgexport(8), vgextend(8), vgimport(8),
276 vgimportclone(8), vgimportdevices(8), vgmerge(8), vgmknodes(8),
277 vgreduce(8), vgremove(8), vgrename(8), vgs(8), vgscan(8), vgsplit(8),
278
279 lvcreate(8), lvchange(8), lvconvert(8), lvdisplay(8), lvextend(8),
280 lvreduce(8), lvremove(8), lvrename(8), lvresize(8), lvs(8), lvscan(8),
281
282 lvm-fullreport(8), lvm-lvpoll(8), blkdeactivate(8), lvmdump(8),
283
284 dmeventd(8), lvmpolld(8), lvmlockd(8), lvmlockctl(8), cmirrord(8),
285 lvmdbusd(8), fsadm(8),
286
287 lvmsystemid(7), lvmreport(7), lvmcache(7), lvmraid(7), lvmthin(7),
288 lvmvdo(7), lvmautoactivation(7)
289
290
291
292
293Red Hat, Inc. LVM TOOLS 2.03.22(2) (2023-08-02) LVREDUCE(8)