0、 前言

逻辑卷管理LVM是一个多才多艺的硬盘系统工具。无论在Linux或者其他类似的系统,都是非常的好用。
传统分区使用固定大小分区,重新调整大小十分麻烦。但是,LVM可以创建和管理“逻辑”卷,而不是直接使
用物理硬盘。可以让管理员弹性的管理逻辑卷的扩大缩小,操作简单,而不损坏已存储的数据。可以随意将
新的硬盘添加到LVM,以直接扩展已经存在的逻辑卷。LVM并不需要重启就可以让内核知道分区的存在。

1
2
3
4
5
6
7
8
9
10
11
12
         disk A                    disk B
↓----------↓ ↓-------↓------↓
分区1 分区2 分区1 分区2 分区3
↓ ↓ ↓ ↓ ↓
pv1 pv2 pv1 pv2 pv3
↓ ↓ ↓ ↓ ↓
volume group1 volume group 2, volume group 2,
↓ ↓ ↓
logical volume1 logical volume2 logical volume3
↓ ↓
文件系统ext4 文件系统zfs

图中顶部,首先是实际的物理磁盘及其划分的分区和其上的物理卷(PV)。
一个或多个物理卷可以用来创建卷组(VG)。然后基于卷组可以创建逻辑卷(LV)。
只要在卷组中有可用空间,就可以随心所欲的创建逻辑卷。
文件系统就是在逻辑卷上创建的,然后可以在操作系统挂载和访问。

1、首先使用分区工具进行分区,parted、fdisk命令。

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
buildfarm@xref:~$ sudo parted /dev/sde 
GNU Parted 3.2
Using /dev/sde
Welcome to GNU Parted! Type 'help' to view a list of commands.
(parted) mklabel gpt
(parted) mkpart primary ext4 0% 100%
(parted) set 1 lvm on
(parted) print
Model: ATA WDC WD20EZRZ-00Z (scsi)
Disk /dev/sde: 2000GB
Sector size (logical/physical): 512B/4096B
Partition Table: gpt
Disk Flags:

Number Start End Size File system Name Flags
1 1049kB 2000GB 2000GB ext4 primary lvm

(parted) q
Information: You may need to update /etc/fstab.

buildfarm@xref:~$


root@fs-share:/# fdisk -l /dev/sdb
Disk /dev/sdb: 8.9 TiB, 9796283531264 bytes, 19133366272 sectors
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disklabel type: gpt
Disk identifier: 2C9EDAFE-B39C-4DFA-8BD4-A6C74FC02CE6

Device Start End Sectors Size Type
/dev/sdb1 2048 195311615 195309568 93.1G Linux LVM
/dev/sdb2 195311616 4687499263 4492187648 2.1T Linux LVM
/dev/sdb3 4687499264 5859375103 1171875840 558.8G Linux filesystem
/dev/sdb4 5859375104 7812499455 1953124352 931.3G Linux filesystem
/dev/sdb5 7812499456 11718750207 3906250752 1.8T Linux filesystem
/dev/sdb6 11718750208 13671874559 1953124352 931.3G Linux filesystem
/dev/sdb7 13671874560 14648436735 976562176 465.7G Linux filesystem
/dev/sdb8 14648436736 17578125311 2929688576 1.4T Linux filesystem
/dev/sdb9 17578125312 18554687487 976562176 465.7G Linux filesystem


2、使用命令pvcreate创建物理卷(PV)

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
root@fs-share:/# pvcreate /dev/sdb1
Physical volume "/dev/sdb1" successfully created.

# 使用下列命令检查物理卷的创建情况。
root@fs-share:/# pvdisplay
"/dev/sdb1" is a new physical volume of "93.13 GiB"
--- NEW Physical volume ---
PV Name /dev/sdb1
VG Name
PV Size 93.13 GiB
Allocatable NO
PE Size 0
Total PE 0
Free PE 0
Allocated PE 0
PV UUID fNiq1L-rCZC-y1DQ-YoNk-ufr8-Ddz3-RRwknx


# pvremove /dev/sdb1 使用下列命令可以删除物理卷。
root@fs-share:/# pvremove /dev/sdb1
Labels on physical volume "/dev/sdb1" successfully wiped.


# 也可以同时新建多个pv的
root@fs-share:/# pvcreate /dev/sdb1 /dev/sdb2 /dev/sdb3
Physical volume "/dev/sdb1" successfully created.
Physical volume "/dev/sdb2" successfully created.
Physical volume "/dev/sdb3" successfully created.



3、准备卷组

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
#下列命令用来创建名为'data1'的卷组
root@fs-share:/# vgcreate data1 /dev/sdb1 /dev/sdb3
Volume group "data1" successfully created

root@fs-share:/# vgcreate vg-data1 /dev/sdb1 /dev/sdb3
Volume group "vg-data1" successfully created

# 使用下列命令可以来验证卷组。
root@fs-share:/# vgdisplay
--- Volume group ---
VG Name vg-data1
System ID
Format lvm2
Metadata Areas 2
Metadata Sequence No 1
VG Access read/write
VG Status resizable
MAX LV 0
Cur LV 0
Open LV 0
Max PV 0
Cur PV 2
Act PV 2
VG Size 651.92 GiB
PE Size 4.00 MiB
Total PE 166892
Alloc PE / Size 0 / 0
Free PE / Size 166892 / 651.92 GiB
VG UUID vLRQGk-Ml8H-mupG-ITKN-KWYm-jRyl-nI9aBY


#使用下列命令删除卷组。
vgremove vg-data1

# 如果再次新建之前的一个分区到vg中会提示报错的
root@fs-share:/# vgcreate vg-root /dev/sdb1
Physical volume '/dev/sdb1' is already in volume group 'vg-data1'
Unable to add physical volume '/dev/sdb1' to volume group 'vg-data1'
/dev/sdb1: physical volume not initialized.

# 再单独建个vg-root
root@fs-share:/# vgcreate vg-root /dev/sdb2
Volume group "vg-root" successfully created
root@fs-share:/# vgdisplay
--- Volume group ---
VG Name vg-data1
System ID
Format lvm2
Metadata Areas 2
Metadata Sequence No 1
VG Access read/write
VG Status resizable
MAX LV 0
Cur LV 0
Open LV 0
Max PV 0
Cur PV 2
Act PV 2
VG Size 651.92 GiB
PE Size 4.00 MiB
Total PE 166892
Alloc PE / Size 0 / 0
Free PE / Size 166892 / 651.92 GiB
VG UUID vLRQGk-Ml8H-mupG-ITKN-KWYm-jRyl-nI9aBY

--- Volume group ---
VG Name vg-root
System ID
Format lvm2
Metadata Areas 1
Metadata Sequence No 1
VG Access read/write
VG Status resizable
MAX LV 0
Cur LV 0
Open LV 0
Max PV 0
Cur PV 1
Act PV 1
VG Size 2.09 TiB
PE Size 4.00 MiB
Total PE 548362
Alloc PE / Size 0 / 0
Free PE / Size 548362 / 2.09 TiB
VG UUID EL9l4y-b1qo-9LWx-oxiQ-u5J4-2vS9-ejP6FL

root@fs-share:/#

4、准备逻辑卷

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
下列命令创建一个名为'1v1'、大小为100MB的逻辑卷。我们使用小分区减少执行时间
lvcreate -L 100M -n vg-data1_lv1 vg-data1


root@fs-share:/# lvcreate -L 100M -n vg-data1_lv1 vg-data1
Logical volume "vg-data1_lv1" created.

root@fs-share:/# lvdisplay
--- Logical volume ---
LV Path /dev/vg-data1/vg-data1_lv1
LV Name vg-data1_lv1
VG Name vg-data1
LV UUID JUIugv-IOpL-sJEU-kwb9-q8gt-T0ct-wDSoBL
LV Write Access read/write
LV Creation host, time fs-share, 2019-06-04 17:25:17 +0800
LV Status available
# open 0
LV Size 100.00 MiB
Current LE 25
Segments 1
Allocation inherit
Read ahead sectors auto
- currently set to 256
Block device 253:0



现在逻辑卷已经准备好了,我们可以格式化和挂载逻辑卷,就像其它ext2/3/4分区一样!
root@fs-share:/# mkfs.ext4 /dev/vg-data1/vg-data1_lv1
mke2fs 1.44.1 (24-Mar-2018)
Creating filesystem with 102400 1k blocks and 25688 inodes
Filesystem UUID: 64ae11e6-5650-42b4-a8f9-150f055d372c
Superblock backups stored on blocks:
8193, 24577, 40961, 57345, 73729

Allocating group tables: done
Writing inode tables: done
Creating journal (4096 blocks): done
Writing superblocks and filesystem accounting information: done

root@fs-share:/# mount /dev/vg-data1/vg-data1_lv1 /mnt/
root@fs-share:/# df -ah
Filesystem Size Used Avail Use% Mounted on
/dev/sda1 256G 2.1G 241G 1% /
/dev/mapper/vg--data1-vg--data1_lv1 93M 1.6M 85M 2% /mnt

一旦逻辑卷挂载,我们就可以到挂载点 /lvm-mount/ 上读写了。要创建和挂载其它的逻辑卷,我们重复这个过程。
最后,使用lvremove我们可以删除逻辑卷。
umount /lvm-mount/
lvremove /dev/volume-group1/lv1

5、扩展一个LVM卷

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62

调整逻辑卷大小的功能是LVM最有用的功能,调整逻辑卷大小之后也需要对文件系统调整大小进行匹配。

首先,我们卸载掉lv1卷
root@fs-share:~# umount /dev/vg-data1/vg-data1_lv1

然后,设置卷的大小为200M
root@fs-share:~# lvresize -L 200M /dev/vg-data1/vg-data1_lv1
Size of logical volume vg-data1/vg-data1_lv1 changed from 100.00 MiB (25 extents) to 200.00 MiB (50 extents).
Logical volume vg-data1/vg-data1_lv1 successfully resized.


检查磁盘错误
root@fs-share:~# e2fsck -f /dev/vg-data1/vg-data1_lv1
e2fsck 1.44.1 (24-Mar-2018)
Pass 1: Checking inodes, blocks, and sizes
Pass 2: Checking directory structure
Pass 3: Checking directory connectivity
Pass 4: Checking reference counts
Pass 5: Checking group summary information
/dev/vg-data1/vg-data1_lv1: 297/25688 files (3.0% non-contiguous), 100351/102400 blocks

扩展文件系统
root@fs-share:~# resize2fs /dev/vg-data1/vg-data1_lv1
resize2fs 1.44.1 (24-Mar-2018)
Resizing the filesystem on /dev/vg-data1/vg-data1_lv1 to 204800 (1k) blocks.
The filesystem on /dev/vg-data1/vg-data1_lv1 is now 204800 (1k) blocks long.


检查LV的状态来验证
root@fs-share:~# lvdisplay
--- Logical volume ---
LV Path /dev/vg-data1/vg-data1_lv1
LV Name vg-data1_lv1
VG Name vg-data1
LV UUID JUIugv-IOpL-sJEU-kwb9-q8gt-T0ct-wDSoBL
LV Write Access read/write
LV Creation host, time fs-share, 2019-06-04 17:25:17 +0800
LV Status available
# open 0
LV Size 200.00 MiB
Current LE 50
Segments 1
Allocation inherit
Read ahead sectors auto
- currently set to 256
Block device 253:0


root@fs-share:~# mount /dev/vg-data1/vg-data1_lv1 /mnt/
root@fs-share:~# df -h
Filesystem Size Used Avail Use% Mounted on
udev 16G 0 16G 0% /dev
tmpfs 3.2G 2.9M 3.2G 1% /run
/dev/sda1 256G 2.4G 240G 1% /
tmpfs 16G 0 16G 0% /dev/shm
tmpfs 5.0M 0 5.0M 0% /run/lock
tmpfs 16G 0 16G 0% /sys/fs/cgroup
tmpfs 3.2G 0 3.2G 0% /run/user/1000
/dev/mapper/vg--data1-vg--data1_lv1 190M 91M 86M 52% /mnt


6、缩减一个LVM卷,扩展一个LVM卷

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47

注意减少逻辑卷的大小值若小于储存的数据大小,存储在后面的数据会丢失。

卸载掉卷。
root@fs-share:~# umount /dev/vg-data1/vg-data1_lv1


检测磁盘错误
root@fs-share:~# e2fsck /dev/vg-data1/vg-data1_lv1
e2fsck 1.44.1 (24-Mar-2018)
/dev/vg-data1/vg-data1_lv1: clean, 13/49400 files, 177515/204800 blocks


缩小文件系统
root@fs-share:~# resize2fs /dev/vg-data1/vg-data1_lv1 100M
resize2fs 1.44.1 (24-Mar-2018)
resize2fs: New size smaller than minimum (204800)

减少逻辑卷大小
root@fs-share:~# lvresize -L 100M /dev/vg-data1/vg-data1_lv1
WARNING: Reducing active logical volume to 100.00 MiB.
THIS MAY DESTROY YOUR DATA (filesystem etc.)
Do you really want to reduce vg-data1/vg-data1_lv1? [y/n]: y
Size of logical volume vg-data1/vg-data1_lv1 changed from 200.00 MiB (50 extents) to 100.00 MiB (25 extents).
Logical volume vg-data1/vg-data1_lv1 successfully resized.


验证调整后的逻辑卷大小
root@fs-share:~# lvdisplay
--- Logical volume ---
LV Path /dev/vg-data1/vg-data1_lv1
LV Name vg-data1_lv1
VG Name vg-data1
LV UUID JUIugv-IOpL-sJEU-kwb9-q8gt-T0ct-wDSoBL
LV Write Access read/write
LV Creation host, time fs-share, 2019-06-04 17:25:17 +0800
LV Status available
# open 0
LV Size 100.00 MiB
Current LE 25
Segments 1
Allocation inherit
Read ahead sectors auto
- currently set to 256
Block device 253:0


7、扩展一个卷组

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93

root@fs-share:~#
root@fs-share:~# pvdisplay
--- Physical volume ---
PV Name /dev/sdb1
VG Name vg-data
PV Size <8.91 TiB / not usable 2.00 MiB
Allocatable yes
PE Size 4.00 MiB
Total PE 2335615
Free PE 2335615
Allocated PE 0
PV UUID hwqYDk-BANT-TRjl-E816-XflZ-5tox-NZzzlf

"/dev/sdc1" is a new physical volume of "<8.91 TiB"
--- NEW Physical volume ---
PV Name /dev/sdc1
VG Name
PV Size <8.91 TiB
Allocatable NO
PE Size 0
Total PE 0
Free PE 0
Allocated PE 0
PV UUID MTNKpf-fwWc-s090-frxQ-engb-eGwQ-ArQmX6

检测现在卷组状态
root@fs-share:~# vgdisplay
--- Volume group ---
VG Name vg-data
System ID
Format lvm2
Metadata Areas 1
Metadata Sequence No 1
VG Access read/write
VG Status resizable
MAX LV 0
Cur LV 0
Open LV 0
Max PV 0
Cur PV 1
Act PV 1
VG Size <8.91 TiB
PE Size 4.00 MiB
Total PE 2335615
Alloc PE / Size 0 / 0
Free PE / Size 2335615 / <8.91 TiB
VG UUID 8biipv-Yx0F-OVRW-1ADL-dvEu-pFpL-Z4g9pu

root@fs-share:~#




扩增一个卷组
root@fs-share:~# vgextend vg-data /dev/sdc1
Volume group "vg-data" successfully extended
root@fs-share:~#


# 扩展一个卷组之后大小已经变化了
root@fs-share:~# vgdisplay
--- Volume group ---
VG Name vg-data
System ID
Format lvm2
Metadata Areas 2
Metadata Sequence No 2
VG Access read/write
VG Status resizable
MAX LV 0
Cur LV 0
Open LV 0
Max PV 0
Cur PV 2
Act PV 2
VG Size <17.82 TiB
PE Size 4.00 MiB
Total PE 4671230
Alloc PE / Size 0 / 0
Free PE / Size 4671230 / <17.82 TiB
VG UUID 8biipv-Yx0F-OVRW-1ADL-dvEu-pFpL-Z4g9pu

root@fs-share:~#

从一个卷组中移除一个pv
vgreduce - Remove physical volume(s) from a volume group






1、 lvm — LVM2 tools

其实以上命令都来自一个命令 lvm — LVM2 tools

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
lrwxrwxrwx  1 root root         3 Apr 12  2018 lvchange -> lvm*
lrwxrwxrwx 1 root root 3 Apr 12 2018 lvconvert -> lvm*
lrwxrwxrwx 1 root root 3 Apr 12 2018 lvcreate -> lvm*
lrwxrwxrwx 1 root root 3 Apr 12 2018 lvdisplay -> lvm*
lrwxrwxrwx 1 root root 3 Apr 12 2018 lvextend -> lvm*
-rwxr-xr-x 1 root root 2535424 Apr 12 2018 lvm*
-rwxr-xr-x 1 root root 12847 Apr 12 2018 lvmconf*
lrwxrwxrwx 1 root root 3 Apr 12 2018 lvmconfig -> lvm*
lrwxrwxrwx 1 root root 3 Apr 12 2018 lvmdiskscan -> lvm*
-rwxr-xr-x 1 root root 10312 Apr 12 2018 lvmdump*
-rwxr-xr-x 1 root root 84104 Apr 12 2018 lvmetad*
-rwxr-xr-x 1 root root 72136 Apr 12 2018 lvmpolld*
lrwxrwxrwx 1 root root 3 Apr 12 2018 lvmsadc -> lvm*
lrwxrwxrwx 1 root root 3 Apr 12 2018 lvmsar -> lvm*
lrwxrwxrwx 1 root root 3 Apr 12 2018 lvreduce -> lvm*
lrwxrwxrwx 1 root root 3 Apr 12 2018 lvremove -> lvm*
lrwxrwxrwx 1 root root 3 Apr 12 2018 lvrename -> lvm*
lrwxrwxrwx 1 root root 3 Apr 12 2018 lvresize -> lvm*
lrwxrwxrwx 1 root root 3 Apr 12 2018 lvs -> lvm*
lrwxrwxrwx 1 root root 3 Apr 12 2018 lvscan -> lvm*
lrwxrwxrwx 1 root root 3 Apr 12 2018 pvchange -> lvm*
lrwxrwxrwx 1 root root 3 Apr 12 2018 pvck -> lvm*
lrwxrwxrwx 1 root root 3 Apr 12 2018 pvcreate -> lvm*
lrwxrwxrwx 1 root root 3 Apr 12 2018 pvdisplay -> lvm*
lrwxrwxrwx 1 root root 3 Apr 12 2018 pvmove -> lvm*
lrwxrwxrwx 1 root root 3 Apr 12 2018 pvremove -> lvm*
lrwxrwxrwx 1 root root 3 Apr 12 2018 pvresize -> lvm*
lrwxrwxrwx 1 root root 3 Apr 12 2018 pvs -> lvm*
lrwxrwxrwx 1 root root 3 Apr 12 2018 pvscan -> lvm*
lrwxrwxrwx 1 root root 3 Apr 12 2018 vgcfgbackup -> lvm*
lrwxrwxrwx 1 root root 3 Apr 12 2018 vgcfgrestore -> lvm*
lrwxrwxrwx 1 root root 3 Apr 12 2018 vgchange -> lvm*
lrwxrwxrwx 1 root root 3 Apr 12 2018 vgck -> lvm*
lrwxrwxrwx 1 root root 3 Apr 12 2018 vgconvert -> lvm*
lrwxrwxrwx 1 root root 3 Apr 12 2018 vgcreate -> lvm*
lrwxrwxrwx 1 root root 3 Apr 12 2018 vgdisplay -> lvm*
lrwxrwxrwx 1 root root 3 Apr 12 2018 vgexport -> lvm*
lrwxrwxrwx 1 root root 3 Apr 12 2018 vgextend -> lvm*
lrwxrwxrwx 1 root root 3 Apr 12 2018 vgimport -> lvm*
lrwxrwxrwx 1 root root 3 Apr 12 2018 vgimportclone -> lvm*
lrwxrwxrwx 1 root root 3 Apr 12 2018 vgmerge -> lvm*
lrwxrwxrwx 1 root root 3 Apr 12 2018 vgmknodes -> lvm*
lrwxrwxrwx 1 root root 3 Apr 12 2018 vgreduce -> lvm*
lrwxrwxrwx 1 root root 3 Apr 12 2018 vgremove -> lvm*
lrwxrwxrwx 1 root root 3 Apr 12 2018 vgrename -> lvm*
lrwxrwxrwx 1 root root 3 Apr 12 2018 vgs -> lvm*
lrwxrwxrwx 1 root root 3 Apr 12 2018 vgscan -> lvm*
lrwxrwxrwx 1 root root 3 Apr 12 2018 vgsplit -> lvm*

NAME
lvm — LVM2 tools

SYNOPSIS
lvm [command|file]

DESCRIPTION
The Logical Volume Manager (LVM) provides tools to create virtual block devices from physical devices. Virtual devices may be easier to manage than physical devices, and can have capabilities
beyond what the physical devices provide themselves. A Volume Group (VG) is a collection of one or more physical devices, each called a Physical Volume (PV). A Logical Volume (LV) is a vir‐
tual block device that can be used by the system or applications. Each block of data in an LV is stored on one or more PV in the VG, according to algorithms implemented by Device Mapper (DM)
in the kernel.

The lvm command, and other commands listed below, are the command-line tools for LVM. A separate manual page describes each command in detail.

If lvm is invoked with no arguments it presents a readline prompt (assuming it was compiled with readline support). LVM commands may be entered interactively at this prompt with readline
facilities including history and command name and option completion. Refer to readline(3) for details.

If lvm is invoked with argv[0] set to the name of a specific LVM command (for example by using a hard or soft link) it acts as that command.

On invocation, lvm requires that only the standard file descriptors stdin, stdout and stderr are available. If others are found, they get closed and messages are issued warning about the
leak. This warning can be suppressed by setting the environment variable LVM_SUPPRESS_FD_WARNINGS.

Where commands take VG or LV names as arguments, the full path name is optional. An LV called "lvol0" in a VG called "vg0" can be specified as "vg0/lvol0". Where a list of VGs is required
but is left empty, a list of all VGs will be substituted. Where a list of LVs is required but a VG is given, a list of all the LVs in that VG will be substituted. So lvdisplay vg0 will dis‐
play all the LVs in "vg0". Tags can also be used - see --addtag below.

One advantage of using the built-in shell is that configuration information gets cached internally between commands.

A file containing a simple script with one command per line can also be given on the command line. The script can also be executed directly if the first line is #! followed by the absolute
path of lvm.

Additional hyphens within option names are ignored. For example, --readonly and --read-only are both accepted.

BUILT-IN COMMANDS
The following commands are built into lvm without links normally being created in the filesystem for them.

config The same as lvmconfig(8) below.
devtypes Display the recognised built-in block device types.
dumpconfig The same as lvmconfig(8) below.
formats Display recognised metadata formats.
fullreport Report information about PVs, PV segments, VGs, LVs and LV segments, all at once.
help Display the help text.
lastlog Display log report of last command run in LVM shell if command log reporting is enabled.
lvpoll Complete lvmpolld operations (Internal command).
segtypes Display recognised Logical Volume segment types.
systemid Display any system ID currently set on this host.
tags Display any tags defined on this host.
version Display version information.

COMMANDS
The following commands implement the core LVM functionality.

pvchange Change attributes of a Physical Volume.
pvck Check Physical Volume metadata.
pvcreate Initialize a disk or partition for use by LVM.
pvdisplay Display attributes of a Physical Volume.
pvmove Move Physical Extents.
pvremove Remove a Physical Volume.
pvresize Resize a disk or partition in use by LVM2.
pvs Report information about Physical Volumes.
pvscan Scan all disks for Physical Volumes.
vgcfgbackup Backup Volume Group descriptor area.
vgcfgrestore Restore Volume Group descriptor area.
vgchange Change attributes of a Volume Group.
vgck Check Volume Group metadata.
vgconvert Convert Volume Group metadata format.
vgcreate Create a Volume Group.
vgdisplay Display attributes of Volume Groups.
vgexport Make volume Groups unknown to the system.
vgextend Add Physical Volumes to a Volume Group.
vgimport Make exported Volume Groups known to the system.
vgimportclone Import and rename duplicated Volume Group (e.g. a hardware snapshot).
vgmerge Merge two Volume Groups.
vgmknodes Recreate Volume Group directory and Logical Volume special files
vgreduce Reduce a Volume Group by removing one or more Physical Volumes.
vgremove Remove a Volume Group.
vgrename Rename a Volume Group.
vgs Report information about Volume Groups.
vgscan Scan all disks for Volume Groups and rebuild caches.
vgsplit Split a Volume Group into two, moving any logical volumes from one Volume Group to another by moving entire Physical Volumes.
lvchange Change attributes of a Logical Volume.
lvconvert Convert a Logical Volume from linear to mirror or snapshot.
lvcreate Create a Logical Volume in an existing Volume Group.
lvdisplay Display attributes of a Logical Volume.
lvextend Extend the size of a Logical Volume.
lvmconfig Display the configuration information after loading lvm.conf(5) and any other configuration files.
lvmdiskscan Scan for all devices visible to LVM2.
lvmdump Create lvm2 information dumps for diagnostic purposes.
lvreduce Reduce the size of a Logical Volume.
lvremove Remove a Logical Volume.
lvrename Rename a Logical Volume.
lvresize Resize a Logical Volume.
lvs Report information about Logical Volumes.
lvscan Scan (all disks) for Logical Volumes.

The following LVM1 commands are not implemented in LVM2: lvmchange, lvmsadc, lvmsar, pvdata. For performance metrics, use dmstats(8) or to manipulate the kernel device-mapper driver used by
LVM2 directly, use dmsetup(8).

VALID NAMES
The valid characters for VG and LV names are: a-z A-Z 0-9 + _ . -

VG names cannot begin with a hyphen. The name of a new LV also cannot begin with a hyphen. However, if the configuration setting metadata/record_lvs_history is enabled then an LV name with a
hyphen as a prefix indicates that, although the LV was removed, it is still being tracked because it forms part of the history of at least one LV that is still present. This helps to record
the ancestry of thin snapshots even after some links in the chain have been removed. A reference to the historical LV 'lvol1' in VG 'vg00' would be 'vg00/\-lvol1' or just '-lvol1' if the VG
is already set. (The latter form must be preceded by '--' to terminate command line option processing before reaching this argument.)

There are also various reserved names that are used internally by lvm that can not be used as LV or VG names. A VG cannot be called anything that exists in /dev/ at the time of creation, nor
can it be called '.' or '..'. An LV cannot be called '.', '..', 'snapshot' or 'pvmove'. The LV name may also not contain any of the following strings: '_cdata', '_cmeta', '_corig', '_mlog',
'_mimage', '_pmspare', '_rimage', '_rmeta', '_tdata', '_tmeta' or '_vorigin'. A directory bearing the name of each Volume Group is created under /dev when any of its Logical Volumes are acti‐
vated. Each active Logical Volume is accessible from this directory as a symbolic link leading to a device node. Links or nodes in /dev/mapper are intended only for internal use and the pre‐
cise format and escaping might change between releases and distributions. Other software and scripts should use the /dev/VolumeGroupName/LogicalVolumeName format to reduce the chance of need‐
ing amendment when the software is updated. Should you need to process the node names in /dev/mapper, you may use dmsetup splitname to separate out the original VG, LV and internal layer
names.

UNIQUE NAMES
VG names should be unique. vgcreate will produce an error if the specified VG name matches an existing VG name. However, there are cases where different VGs with the same name can appear to
LVM, e.g. after moving disks or changing filters.

When VGs with the same name exist, commands operating on all VGs will include all of the VGs with the same name. If the ambiguous VG name is specified on the command line, the command will
produce an error. The error states that multiple VGs exist with the specified name. To process one of the VGs specifically, the --select option should be used with the UUID of the intended
VG: '--select vg_uuid=<uuid>'.

An exception is if all but one of the VGs with the shared name is foreign (see lvmsystemid(7).) In this case, the one VG that is not foreign is assumed to be the intended VG and is processed.

LV names are unique within a VG. The name of an historical LV cannot be reused until the historical LV has itself been removed or renamed.

ALLOCATION
When an operation needs to allocate Physical Extents for one or more Logical Volumes, the tools proceed as follows:

First of all, they generate the complete set of unallocated Physical Extents in the Volume Group. If any ranges of Physical Extents are supplied at the end of the command line, only unallo‐
cated Physical Extents within those ranges on the specified Physical Volumes are considered.

Then they try each allocation policy in turn, starting with the strictest policy (contiguous) and ending with the allocation policy specified using --alloc or set as the default for the par‐
ticular Logical Volume or Volume Group concerned. For each policy, working from the lowest-numbered Logical Extent of the empty Logical Volume space that needs to be filled, they allocate as
much space as possible according to the restrictions imposed by the policy. If more space is needed, they move on to the next policy.

The restrictions are as follows:

Contiguous requires that the physical location of any Logical Extent that is not the first Logical Extent of a Logical Volume is adjacent to the physical location of the Logical Extent immedi‐
ately preceding it.

Cling requires that the Physical Volume used for any Logical Extent to be added to an existing Logical Volume is already in use by at least one Logical Extent earlier in that Logical Volume.
If the configuration parameter allocation/cling_tag_list is defined, then two Physical Volumes are considered to match if any of the listed tags is present on both Physical Volumes. This
allows groups of Physical Volumes with similar properties (such as their physical location) to be tagged and treated as equivalent for allocation purposes.

When a Logical Volume is striped or mirrored, the above restrictions are applied independently to each stripe or mirror image (leg) that needs space.

Normal will not choose a Physical Extent that shares the same Physical Volume as a Logical Extent already allocated to a parallel Logical Volume (i.e. a different stripe or mirror image/leg)
at the same offset within that parallel Logical Volume.

When allocating a mirror log at the same time as Logical Volumes to hold the mirror data, Normal will first try to select different Physical Volumes for the log and the data. If that's not
possible and the allocation/mirror_logs_require_separate_pvs configuration parameter is set to 0, it will then allow the log to share Physical Volume(s) with part of the data.

When allocating thin pool metadata, similar considerations to those of a mirror log in the last paragraph apply based on the value of the allocation/thin_pool_metadata_require_separate_pvs
configuration parameter.

If you rely upon any layout behaviour beyond that documented here, be aware that it might change in future versions of the code.

For example, if you supply on the command line two empty Physical Volumes that have an identical number of free Physical Extents available for allocation, the current code considers using each
of them in the order they are listed, but there is no guarantee that future releases will maintain that property. If it is important to obtain a specific layout for a particular Logical Vol‐
ume, then you should build it up through a sequence of lvcreate(8) and lvconvert(8) steps such that the restrictions described above applied to each step leave the tools no discretion over the
layout.

To view the way the allocation process currently works in any specific case, read the debug logging output, for example by adding -vvvv to a command.

LOGICAL VOLUME TYPES
Some logical volume types are simple to create and can be done with a single lvcreate(8) command. The linear and striped logical volume types are an example of this. Other logical volume
types may require more than one command to create. The cache (lvmcache(7)) and thin provisioning (lvmthin(7)) types are examples of this.

DIAGNOSTICS
All tools return a status code of zero on success or non-zero on failure. The non-zero codes distinguish only between the broad categories of unrecognised commands, problems processing the
command line arguments and any other failures. As LVM remains under active development, the code used in a specific case occasionally changes between releases. Message text may also change.

ENVIRONMENT VARIABLES
HOME Directory containing .lvm_history if the internal readline shell is invoked.

LVM_OUT_FD
File descriptor to use for common output from LVM commands.

LVM_ERR_FD
File descriptor to use for error output from LVM commands.

LVM_REPORT_FD
File descriptor to use for report output from LVM commands.

LVM_COMMAND_PROFILE
Name of default command profile to use for LVM commands. This profile is overriden by direct use of --commandprofile command line option.

LVM_RUN_BY_DMEVENTD
This variable is normally set by dmeventd plugin to inform lvm2 command it is running from dmeventd plugin so lvm2 takes some extra action to avoid comunication and deadlocks with
dmeventd.

LVM_SYSTEM_DIR
Directory containing lvm.conf(5) and other LVM system files. Defaults to "/etc/lvm".

LVM_SUPPRESS_FD_WARNINGS
Suppress warnings about unexpected file descriptors passed into LVM.

LVM_VG_NAME
The Volume Group name that is assumed for any reference to a Logical Volume that doesn't specify a path. Not set by default.

LVM_LVMETAD_PIDFILE
Path to the file that stores the lvmetad process ID.

LVM_LVMETAD_SOCKET
Path to the socket used to communicate with lvmetad.

LVM_LVMPOLLD_PIDFILE
Path to the file that stores the lvmpolld process ID.

LVM_LVMPOLLD_SOCKET
Path to the socket used to communicate with lvmpolld..

LVM_LOG_FILE_EPOCH
A string of up to 32 letters appended to the log filename and followed by the process ID and a startup timestamp using this format string "_%s_%d_%llu". When set, each process logs to
a separate file.

LVM_LOG_FILE_MAX_LINES
If more than this number of lines are sent to the log file, the command gets aborted. Automated tests use this to terminate looping commands.

LVM_EXPECTED_EXIT_STATUS
The status anticipated when the process exits. Use ">N" to match any status greater than N. If the actual exit status matches and a log file got produced, it is deleted.
LVM_LOG_FILE_EPOCH and LVM_EXPECTED_EXIT_STATUS together allow automated test scripts to discard uninteresting log data.

LVM_SUPPRESS_LOCKING_FAILURE_MESSAGES
Used to suppress warning messages when the configured locking is known to be unavailable.

DM_ABORT_ON_INTERNAL_ERRORS
Abort processing if the code detects a non-fatal internal error.

DM_DISABLE_UDEV
Avoid interaction with udev. LVM will manage the relevant nodes in /dev directly.

FILES
/etc/lvm/lvm.conf
$HOME/.lvm_history

SEE ALSO
lvm(8) lvm.conf(5) lvmconfig(8)

pvchange(8) pvck(8) pvcreate(8) pvdisplay(8) pvmove(8) pvremove(8) pvresize(8) pvs(8) pvscan(8)

vgcfgbackup(8) vgcfgrestore(8) vgchange(8) vgck(8) vgcreate(8) vgconvert(8) vgdisplay(8) vgexport(8) vgextend(8) vgimport(8) vgimportclone(8) vgmerge(8) vgmknodes(8) vgreduce(8) vgremove(8)
vgrename(8) vgs(8) vgscan(8) vgsplit(8)

lvcreate(8) lvchange(8) lvconvert(8) lvdisplay(8) lvextend(8) lvreduce(8) lvremove(8) lvrename(8) lvresize(8) lvs(8) lvscan(8)

lvm-fullreport(8) lvm-lvpoll(8) lvm2-activation-generator(8) blkdeactivate(8) lvmdump(8)

dmeventd(8) lvmetad(8) lvmpolld(8) lvmlockd(8) lvmlockctl(8) clvmd(8) cmirrord(8) lvmdbusd(8)

lvmsystemid(7) lvmreport(7) lvmraid(7) lvmthin(7) lvmcache(7)

dmsetup(8), dmstats(8), readline(3)

pvchange

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
PVCHANGE(8)                                                                                            System Manager's Manual                                                                                           PVCHANGE(8)

NAME
pvchange - Change attributes of physical volume(s)

SYNOPSIS
pvchange option_args position_args
[ option_args ]

DESCRIPTION
pvchange changes PV attributes in the VG.

For options listed in parentheses, any one is required, after which the others are optional.

USAGE
Change properties of all PVs.

pvchange
( -x|--allocatable y|n,
-u|--uuid,
-a|--all,
--addtag Tag,
--deltag Tag,
--metadataignore y|n )
[ COMMON_OPTIONS ]

Change properties of specified PVs.

pvchange
( -x|--allocatable y|n,
-u|--uuid,
--addtag Tag,
--deltag Tag,
--metadataignore y|n )
PV|Select ...
[ -S|--select String ]
[ COMMON_OPTIONS ]

Common options for command:
[ -A|--autobackup y|n ]
[ -f|--force ]
[ -u|--uuid ]
[ --ignoreskippedcluster ]
[ --reportformat basic|json ]

Common options for lvm:
[ -d|--debug ]
[ -h|--help ]
[ -q|--quiet ]
[ -t|--test ]
[ -v|--verbose ]
[ -y|--yes ]
[ --commandprofile String ]
[ --config String ]
[ --driverloaded y|n ]
[ --longhelp ]
[ --profile String ]
[ --version ]

OPTIONS
--addtag Tag
Adds a tag to a PV, VG or LV. This option can be repeated to add multiple tags at once. See lvm(8) for information about tags.

-a|--all
Change all visible PVs.

-x|--allocatable y|n
Enable or disable allocation of physical extents on this PV.

-A|--autobackup y|n
Specifies if metadata should be backed up automatically after a change. Enabling this is strongly advised! See vgcfgbackup(8) for more information.

--commandprofile String
The command profile to use for command configuration. See lvm.conf(5) for more information about profiles.

--config String
Config settings for the command. These override lvm.conf settings. The String arg uses the same format as lvm.conf, or may use section/field syntax. See lvm.conf(5) for more information about config.

-d|--debug ...
Set debug level. Repeat from 1 to 6 times to increase the detail of messages sent to the log file and/or syslog (if configured).

--deltag Tag
Deletes a tag from a PV, VG or LV. This option can be repeated to delete multiple tags at once. See lvm(8) for information about tags.

--driverloaded y|n
If set to no, the command will not attempt to use device-mapper. For testing and debugging.

-f|--force ...
Override various checks, confirmations and protections. Use with extreme caution.

-h|--help
Display help text.

--ignoreskippedcluster
Use to avoid exiting with an non-zero status code if the command is run without clustered locking and clustered VGs are skipped.

--longhelp
Display long help text.

--metadataignore y|n
Specifies the metadataignore property of a PV. If yes, metadata areas on the PV are ignored, and lvm will not store metadata in the metadata areas of the PV. If no, lvm will store metadata on the PV.

--profile String
An alias for --commandprofile or --metadataprofile, depending on the command.

-q|--quiet ...
Suppress output and log messages. Overrides --debug and --verbose. Repeat once to also suppress any prompts with answer 'no'.

--reportformat basic|json
Overrides current output format for reports which is defined globally by the report/output_format setting in lvm.conf. basic is the original format with columns and rows. If there is more than one report per com‐
mand, each report is prefixed with the report name for identification. json produces report output in JSON format. See lvmreport(7) for more information.

-S|--select String
Select objects for processing and reporting based on specified criteria. The criteria syntax is described by --select help and lvmreport(7). For reporting commands, one row is displayed for each object matching
the criteria. See --options help for selectable object fields. Rows can be displayed with an additional "selected" field (-o selected) showing 1 if the row matches the selection and 0 otherwise. For non-report‐
ing commands which process LVM entities, the selection is used to choose items to process.

-t|--test
Run in test mode. Commands will not update metadata. This is implemented by disabling all metadata writing but nevertheless returning success to the calling function. This may lead to unusual error messages in
multi-stage operations if a tool relies on reading back metadata it believes has changed but hasn't.

-u|--uuid
Generate new random UUID for specified PVs.

-v|--verbose ...
Set verbose level. Repeat from 1 to 4 times to increase the detail of messages sent to stdout and stderr.

--version
Display version information.

-y|--yes
Do not prompt for confirmation interactively but always assume the answer yes. Use with extreme caution. (For automatic no, see -qq.)

VARIABLES
PV
Physical Volume name, a device path under /dev. For commands managing physical extents, a PV positional arg generally accepts a suffix indicating a range (or multiple ranges) of physical extents (PEs). When the
first PE is omitted, it defaults to the start of the device, and when the last PE is omitted it defaults to end. Start and end range (inclusive): PV[:PE-PE]... Start and length range (counting from 0):
PV[:PE+PE]...

Select
Select indicates that a required positional parameter can be omitted if the --select option is used. No arg appears in this position.

String
See the option description for information about the string content.

Size[UNIT]
Size is an input number that accepts an optional unit. Input units are always treated as base two values, regardless of capitalization, e.g. 'k' and 'K' both refer to 1024. The default input unit is specified by
letter, followed by |UNIT. UNIT represents other possible input units: bBsSkKmMgGtTpPeE. b|B is bytes, s|S is sectors of 512 bytes, k|K is kilobytes, m|M is megabytes, g|G is gigabytes, t|T is terabytes, p|P is
petabytes, e|E is exabytes. (This should not be confused with the output control --units, where capital letters mean multiple of 1000.)

ENVIRONMENT VARIABLES
See lvm(8) for information about environment variables used by lvm. For example, LVM_VG_NAME can generally be substituted for a required VG parameter.

EXAMPLES
Disallow the allocation of physical extents on a PV (e.g. because of disk errors, or because it will be removed after freeing it).
pvchange -x n /dev/sdk1

SEE ALSO
lvm(8) lvm.conf(5) lvmconfig(8)

pvchange(8) pvck(8) pvcreate(8) pvdisplay(8) pvmove(8) pvremove(8) pvresize(8) pvs(8) pvscan(8)

vgcfgbackup(8) vgcfgrestore(8) vgchange(8) vgck(8) vgcreate(8) vgconvert(8) vgdisplay(8) vgexport(8) vgextend(8) vgimport(8) vgimportclone(8) vgmerge(8) vgmknodes(8) vgreduce(8) vgremove(8) vgrename(8) vgs(8) vgscan(8)
vgsplit(8)

lvcreate(8) lvchange(8) lvconvert(8) lvdisplay(8) lvextend(8) lvreduce(8) lvremove(8) lvrename(8) lvresize(8) lvs(8) lvscan(8)

lvm-fullreport(8) lvm-lvpoll(8) lvm2-activation-generator(8) blkdeactivate(8) lvmdump(8)

dmeventd(8) lvmetad(8) lvmpolld(8) lvmlockd(8) lvmlockctl(8) clvmd(8) cmirrord(8) lvmdbusd(8)

lvmsystemid(7) lvmreport(7) lvmraid(7) lvmthin(7) lvmcache(7)

Red Hat, Inc. LVM TOOLS 2.02.176(2) (2017-11-03) PVCHANGE(8)

pvck

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
PVCK(8)                                                                                                System Manager's Manual                                                                                               PVCK(8)

NAME
pvck - Check the consistency of physical volume(s)

SYNOPSIS
pvck position_args
[ option_args ]

DESCRIPTION
pvck checks the LVM metadata for consistency on PVs.

USAGE
pvck PV ...
[ --labelsector Number ]
[ COMMON_OPTIONS ]

Common options for lvm:
[ -d|--debug ]
[ -h|--help ]
[ -q|--quiet ]
[ -t|--test ]
[ -v|--verbose ]
[ -y|--yes ]
[ --commandprofile String ]
[ --config String ]
[ --driverloaded y|n ]
[ --longhelp ]
[ --profile String ]
[ --version ]

OPTIONS
--commandprofile String
The command profile to use for command configuration. See lvm.conf(5) for more information about profiles.

--config String
Config settings for the command. These override lvm.conf settings. The String arg uses the same format as lvm.conf, or may use section/field syntax. See lvm.conf(5) for more information about config.

-d|--debug ...
Set debug level. Repeat from 1 to 6 times to increase the detail of messages sent to the log file and/or syslog (if configured).

--driverloaded y|n
If set to no, the command will not attempt to use device-mapper. For testing and debugging.

-h|--help
Display help text.

--labelsector Number
By default the PV is labelled with an LVM2 identifier in its second sector (sector 1). This lets you use a different sector near the start of the disk (between 0 and 3 inclusive - see LABEL_SCAN_SECTORS in the
source). Use with care.

--longhelp
Display long help text.

--profile String
An alias for --commandprofile or --metadataprofile, depending on the command.

-q|--quiet ...
Suppress output and log messages. Overrides --debug and --verbose. Repeat once to also suppress any prompts with answer 'no'.

-t|--test
Run in test mode. Commands will not update metadata. This is implemented by disabling all metadata writing but nevertheless returning success to the calling function. This may lead to unusual error messages in
multi-stage operations if a tool relies on reading back metadata it believes has changed but hasn't.

-v|--verbose ...
Set verbose level. Repeat from 1 to 4 times to increase the detail of messages sent to stdout and stderr.

--version
Display version information.

-y|--yes
Do not prompt for confirmation interactively but always assume the answer yes. Use with extreme caution. (For automatic no, see -qq.)

VARIABLES
PV
Physical Volume name, a device path under /dev. For commands managing physical extents, a PV positional arg generally accepts a suffix indicating a range (or multiple ranges) of physical extents (PEs). When the
first PE is omitted, it defaults to the start of the device, and when the last PE is omitted it defaults to end. Start and end range (inclusive): PV[:PE-PE]... Start and length range (counting from 0):
PV[:PE+PE]...

String
See the option description for information about the string content.

Size[UNIT]
Size is an input number that accepts an optional unit. Input units are always treated as base two values, regardless of capitalization, e.g. 'k' and 'K' both refer to 1024. The default input unit is specified by
letter, followed by |UNIT. UNIT represents other possible input units: bBsSkKmMgGtTpPeE. b|B is bytes, s|S is sectors of 512 bytes, k|K is kilobytes, m|M is megabytes, g|G is gigabytes, t|T is terabytes, p|P is
petabytes, e|E is exabytes. (This should not be confused with the output control --units, where capital letters mean multiple of 1000.)

ENVIRONMENT VARIABLES
See lvm(8) for information about environment variables used by lvm. For example, LVM_VG_NAME can generally be substituted for a required VG parameter.

EXAMPLES
If the partition table is corrupted or lost on /dev/sda, and you suspect there was an LVM partition at approximately 100 MiB, then this area of the disk can be scanned using the --labelsector parameter with a value of
204800 (100 * 1024 * 1024 / 512 = 204800).
pvck --labelsector 204800 /dev/sda

SEE ALSO
lvm(8) lvm.conf(5) lvmconfig(8)

pvchange(8) pvck(8) pvcreate(8) pvdisplay(8) pvmove(8) pvremove(8) pvresize(8) pvs(8) pvscan(8)

vgcfgbackup(8) vgcfgrestore(8) vgchange(8) vgck(8) vgcreate(8) vgconvert(8) vgdisplay(8) vgexport(8) vgextend(8) vgimport(8) vgimportclone(8) vgmerge(8) vgmknodes(8) vgreduce(8) vgremove(8) vgrename(8) vgs(8) vgscan(8)
vgsplit(8)

lvcreate(8) lvchange(8) lvconvert(8) lvdisplay(8) lvextend(8) lvreduce(8) lvremove(8) lvrename(8) lvresize(8) lvs(8) lvscan(8)

lvm-fullreport(8) lvm-lvpoll(8) lvm2-activation-generator(8) blkdeactivate(8) lvmdump(8)

dmeventd(8) lvmetad(8) lvmpolld(8) lvmlockd(8) lvmlockctl(8) clvmd(8) cmirrord(8) lvmdbusd(8)

lvmsystemid(7) lvmreport(7) lvmraid(7) lvmthin(7) lvmcache(7)

Red Hat, Inc. LVM TOOLS 2.02.176(2) (2017-11-03) PVCK(8)

pvcreate

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
PVCREATE(8)                                                                                            System Manager's Manual                                                                                           PVCREATE(8)

NAME
pvcreate - Initialize physical volume(s) for use by LVM

SYNOPSIS
pvcreate position_args
[ option_args ]

DESCRIPTION
pvcreate initializes a PV so that it is recognized as belonging to LVM, and allows the PV to be used in a VG. A PV can be a disk partition, whole disk, meta device, or loopback file.

For DOS disk partitions, the partition id should be set to 0x8e using fdisk(8), cfdisk(8), or a equivalent. For GUID Partition Table (GPT), the id is E6D6D379-F507-44C2-A23C-238F2A3DF928. For whole disk devices only the
partition table must be erased, which will effectively destroy all data on that disk. This can be done by zeroing the first sector with:

dd if=/dev/zero of=PhysicalVolume bs=512 count=1

Use vgcreate(8) to create a new VG on the PV, or vgextend(8) to add the PV to existing VG.

The force option will create a PV without confirmation. Repeating the force option (-ff) will forcibly create a PV, overriding checks that normally prevent it, e.g. if the PV is already in a VG.

USAGE
pvcreate PV ...
[ -f|--force ]
[ -M|--metadatatype lvm2|lvm1 ]
[ -u|--uuid String ]
[ -Z|--zero y|n ]
[ --dataalignment Size[k|UNIT] ]
[ --dataalignmentoffset Size[k|UNIT] ]
[ --bootloaderareasize Size[m|UNIT] ]
[ --labelsector Number ]
[ --[pv]metadatacopies 0|1|2 ]
[ --metadatasize Size[m|UNIT] ]
[ --metadataignore y|n ]
[ --norestorefile ]
[ --setphysicalvolumesize Size[m|UNIT] ]
[ --reportformat basic|json ]
[ --restorefile String ]
[ COMMON_OPTIONS ]

Common options for lvm:
[ -d|--debug ]
[ -h|--help ]
[ -q|--quiet ]
[ -t|--test ]
[ -v|--verbose ]
[ -y|--yes ]
[ --commandprofile String ]
[ --config String ]
[ --driverloaded y|n ]
[ --longhelp ]
[ --profile String ]
[ --version ]

OPTIONS
--bootloaderareasize Size[m|UNIT]
Create a separate bootloader area of specified size besides PV's data area. The bootloader area is an area of reserved space on the PV from which LVM will not allocate any extents and it's kept untouched. This is
primarily aimed for use with bootloaders to embed their own data or metadata. The start of the bootloader area is always aligned, see also --dataalignment and --dataalignmentoffset. The bootloader area size may
eventually end up increased due to the alignment, but it's never less than the size that is requested. To see the bootloader area start and size of an existing PV use pvs -o +pv_ba_start,pv_ba_size.

--commandprofile String
The command profile to use for command configuration. See lvm.conf(5) for more information about profiles.

--config String
Config settings for the command. These override lvm.conf settings. The String arg uses the same format as lvm.conf, or may use section/field syntax. See lvm.conf(5) for more information about config.

--dataalignment Size[k|UNIT]
Align the start of the data to a multiple of this number. Also specify an appropriate Physical Extent size when creating a VG. To see the location of the first Physical Extent of an existing PV, use pvs -o
+pe_start. In addition, it may be shifted by an alignment offset. See lvm.conf/data_alignment_offset_detection and --dataalignmentoffset.

--dataalignmentoffset Size[k|UNIT]
Shift the start of the data area by this additional offset.

-d|--debug ...
Set debug level. Repeat from 1 to 6 times to increase the detail of messages sent to the log file and/or syslog (if configured).

--driverloaded y|n
If set to no, the command will not attempt to use device-mapper. For testing and debugging.

-f|--force ...
Override various checks, confirmations and protections. Use with extreme caution.

-h|--help
Display help text.

--labelsector Number
By default the PV is labelled with an LVM2 identifier in its second sector (sector 1). This lets you use a different sector near the start of the disk (between 0 and 3 inclusive - see LABEL_SCAN_SECTORS in the
source). Use with care.

--longhelp
Display long help text.

--metadataignore y|n
Specifies the metadataignore property of a PV. If yes, metadata areas on the PV are ignored, and lvm will not store metadata in the metadata areas of the PV. If no, lvm will store metadata on the PV.

--metadatasize Size[m|UNIT]
The approximate amount of space used for each VG metadata area. The size may be rounded.

-M|--metadatatype lvm2|lvm1
Specifies the type of on-disk metadata to use. lvm2 (or just 2) is the current, standard format. lvm1 (or just 1) is a historical format that can be used for accessing old data.

--norestorefile
In conjunction with --uuid, this allows a uuid to be specified without also requiring that a backup of the metadata be provided.

--profile String
An alias for --commandprofile or --metadataprofile, depending on the command.

--[pv]metadatacopies 0|1|2
The number of metadata areas to set aside on a PV for storing VG metadata. When 2, one copy of the VG metadata is stored at the front of the PV and a second copy is stored at the end. When 1, one copy of the VG
metadata is stored at the front of the PV (starting in the 5th sector). When 0, no copies of the VG metadata are stored on the given PV. This may be useful in VGs containing many PVs (this places limitations on
the ability to use vgsplit later.)

-q|--quiet ...
Suppress output and log messages. Overrides --debug and --verbose. Repeat once to also suppress any prompts with answer 'no'.

--reportformat basic|json
Overrides current output format for reports which is defined globally by the report/output_format setting in lvm.conf. basic is the original format with columns and rows. If there is more than one report per com‐
mand, each report is prefixed with the report name for identification. json produces report output in JSON format. See lvmreport(7) for more information.

--restorefile String
In conjunction with --uuid, this reads the file (produced by vgcfgbackup), extracts the location and size of the data on the PV, and ensures that the metadata produced by the program is consistent with the contents
of the file, i.e. the physical extents will be in the same place and not be overwritten by new metadata. This provides a mechanism to upgrade the metadata format or to add/remove metadata areas. Use with care.

--setphysicalvolumesize Size[m|UNIT]
Overrides the automatically detected size of the PV. Use with care, or prior to reducing the physical size of the device.

-t|--test
Run in test mode. Commands will not update metadata. This is implemented by disabling all metadata writing but nevertheless returning success to the calling function. This may lead to unusual error messages in
multi-stage operations if a tool relies on reading back metadata it believes has changed but hasn't.

-u|--uuid String
Specify a UUID for the device. Without this option, a random UUID is generated. This option is needed before restoring a backup of LVM metadata onto a replacement device; see vgcfgrestore(8). As such, use of
--restorefile is compulsory unless the --norestorefile is used. All PVs must have unique UUIDs, and LVM will prevent certain operations if multiple devices are seen with the same UUID. See vgimportclone(8) for
more information.

-v|--verbose ...
Set verbose level. Repeat from 1 to 4 times to increase the detail of messages sent to stdout and stderr.

--version
Display version information.

-y|--yes
Do not prompt for confirmation interactively but always assume the answer yes. Use with extreme caution. (For automatic no, see -qq.)

-Z|--zero y|n
Controls if the first 4 sectors (2048 bytes) of the device are wiped. The default is to wipe these sectors unless either or both of --restorefile or --uuid are specified.

VARIABLES
PV
Physical Volume name, a device path under /dev. For commands managing physical extents, a PV positional arg generally accepts a suffix indicating a range (or multiple ranges) of physical extents (PEs). When the
first PE is omitted, it defaults to the start of the device, and when the last PE is omitted it defaults to end. Start and end range (inclusive): PV[:PE-PE]... Start and length range (counting from 0):
PV[:PE+PE]...

String
See the option description for information about the string content.

Size[UNIT]
Size is an input number that accepts an optional unit. Input units are always treated as base two values, regardless of capitalization, e.g. 'k' and 'K' both refer to 1024. The default input unit is specified by
letter, followed by |UNIT. UNIT represents other possible input units: bBsSkKmMgGtTpPeE. b|B is bytes, s|S is sectors of 512 bytes, k|K is kilobytes, m|M is megabytes, g|G is gigabytes, t|T is terabytes, p|P is
petabytes, e|E is exabytes. (This should not be confused with the output control --units, where capital letters mean multiple of 1000.)

ENVIRONMENT VARIABLES
See lvm(8) for information about environment variables used by lvm. For example, LVM_VG_NAME can generally be substituted for a required VG parameter.

EXAMPLES
Initialize a partition and a full device.
pvcreate /dev/sdc4 /dev/sde

If a device is a 4KiB sector drive that compensates for windows partitioning (sector 7 is the lowest aligned logical block, the 4KiB sectors start at LBA -1, and consequently sector 63 is aligned on a 4KiB boundary) manu‐
ally account for this when initializing for use by LVM.
pvcreate --dataalignmentoffset 7s /dev/sdb

SEE ALSO
lvm(8) lvm.conf(5) lvmconfig(8)

pvchange(8) pvck(8) pvcreate(8) pvdisplay(8) pvmove(8) pvremove(8) pvresize(8) pvs(8) pvscan(8)

vgcfgbackup(8) vgcfgrestore(8) vgchange(8) vgck(8) vgcreate(8) vgconvert(8) vgdisplay(8) vgexport(8) vgextend(8) vgimport(8) vgimportclone(8) vgmerge(8) vgmknodes(8) vgreduce(8) vgremove(8) vgrename(8) vgs(8) vgscan(8)
vgsplit(8)

lvcreate(8) lvchange(8) lvconvert(8) lvdisplay(8) lvextend(8) lvreduce(8) lvremove(8) lvrename(8) lvresize(8) lvs(8) lvscan(8)

lvm-fullreport(8) lvm-lvpoll(8) lvm2-activation-generator(8) blkdeactivate(8) lvmdump(8)

dmeventd(8) lvmetad(8) lvmpolld(8) lvmlockd(8) lvmlockctl(8) clvmd(8) cmirrord(8) lvmdbusd(8)

lvmsystemid(7) lvmreport(7) lvmraid(7) lvmthin(7) lvmcache(7)

Red Hat, Inc. LVM TOOLS 2.02.176(2) (2017-11-03) PVCREATE(8)

pvdisplay

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
PVDISPLAY(8)                                                                                           System Manager's Manual                                                                                          PVDISPLAY(8)

NAME
pvdisplay - Display various attributes of physical volume(s)

SYNOPSIS
pvdisplay
[ option_args ]
[ position_args ]

DESCRIPTION
pvdisplay shows the attributes of PVs, like size, physical extent size, space used for the VG descriptor area, etc.

pvs(8) is a preferred alternative that shows the same information and more, using a more compact and configurable output format.

USAGE
pvdisplay
[ -a|--all ]
[ -c|--colon ]
[ -C|--columns ]
[ -m|--maps ]
[ -o|--options String ]
[ -S|--select String ]
[ -s|--short ]
[ -O|--sort String ]
[ --aligned ]
[ --binary ]
[ --configreport log|vg|lv|pv|pvseg|seg ]
[ --foreign ]
[ --ignorelockingfailure ]
[ --ignoreskippedcluster ]
[ --logonly ]
[ --noheadings ]
[ --nosuffix ]
[ --readonly ]
[ --reportformat basic|json ]
[ --separator String ]
[ --shared ]
[ --unbuffered ]
[ --units r|R|h|H|b|B|s|S|k|K|m|M|g|G|t|T|p|P|e|E ]
[ COMMON_OPTIONS ]
[ PV|Tag ... ]

Common options for lvm:
[ -d|--debug ]
[ -h|--help ]
[ -q|--quiet ]
[ -t|--test ]
[ -v|--verbose ]
[ -y|--yes ]
[ --commandprofile String ]
[ --config String ]
[ --driverloaded y|n ]
[ --longhelp ]
[ --profile String ]
[ --version ]

OPTIONS
--aligned
Use with --separator to align the output columns

-a|--all
Show information about devices that have not been initialized by LVM, i.e. they are not PVs.

--binary
Use binary values "0" or "1" instead of descriptive literal values for columns that have exactly two valid values to report (not counting the "unknown" value which denotes that the value could not be determined).

-c|--colon
Generate colon separated output for easier parsing in scripts or programs. Also see vgs(8) which provides considerably more control over the output.

-C|--columns
Display output in columns, the equivalent of vgs(8). Options listed are the same as options given in vgs(8).

--commandprofile String
The command profile to use for command configuration. See lvm.conf(5) for more information about profiles.

--config String
Config settings for the command. These override lvm.conf settings. The String arg uses the same format as lvm.conf, or may use section/field syntax. See lvm.conf(5) for more information about config.

--configreport log|vg|lv|pv|pvseg|seg
See lvmreport(7).

-d|--debug ...
Set debug level. Repeat from 1 to 6 times to increase the detail of messages sent to the log file and/or syslog (if configured).

--driverloaded y|n
If set to no, the command will not attempt to use device-mapper. For testing and debugging.

--foreign
Report/display foreign VGs that would otherwise be skipped. See lvmsystemid(7) for more information about foreign VGs.

-h|--help
Display help text.

--ignorelockingfailure
Allows a command to continue with read-only metadata operations after locking failures.

--ignoreskippedcluster
Use to avoid exiting with an non-zero status code if the command is run without clustered locking and clustered VGs are skipped.

--logonly
Suppress command report and display only log report.

--longhelp
Display long help text.

-m|--maps
Display the mapping of physical extents to LVs and logical extents.

--noheadings
Suppress the headings line that is normally the first line of output. Useful if grepping the output.

--nosuffix
Suppress the suffix on output sizes. Use with --units (except h and H) if processing the output.

-o|--options String
Comma-separated, ordered list of fields to display in columns. String arg syntax is: [+|-|#]Field1[,Field2 ...] The prefix + will append the specified fields to the default fields, - will remove the specified
fields from the default fields, and # will compact specified fields (removing them when empty for all rows.) Use -o help to view the list of all available fields. Use separate lists of fields to add, remove or
compact by repeating the -o option: -o+field1,field2 -o-field3,field4 -o#field5. These lists are evaluated from left to right. Use field name lv_all to view all LV fields, vg_all all VG fields, pv_all all PV
fields, pvseg_all all PV segment fields, seg_all all LV segment fields, and pvseg_all all PV segment columns. See the lvm.conf report section for more config options. See lvmreport(7) for more information about
reporting.

--profile String
An alias for --commandprofile or --metadataprofile, depending on the command.

-q|--quiet ...
Suppress output and log messages. Overrides --debug and --verbose. Repeat once to also suppress any prompts with answer 'no'.

--readonly
Run the command in a special read-only mode which will read on-disk metadata without needing to take any locks. This can be used to peek inside metadata used by a virtual machine image while the virtual machine is
running. It can also be used to peek inside the metadata of clustered VGs when clustered locking is not configured or running. No attempt will be made to communicate with the device-mapper kernel driver, so this
option is unable to report whether or not LVs are actually in use.

--reportformat basic|json
Overrides current output format for reports which is defined globally by the report/output_format setting in lvm.conf. basic is the original format with columns and rows. If there is more than one report per com‐
mand, each report is prefixed with the report name for identification. json produces report output in JSON format. See lvmreport(7) for more information.

-S|--select String
Select objects for processing and reporting based on specified criteria. The criteria syntax is described by --select help and lvmreport(7). For reporting commands, one row is displayed for each object matching
the criteria. See --options help for selectable object fields. Rows can be displayed with an additional "selected" field (-o selected) showing 1 if the row matches the selection and 0 otherwise. For non-report‐
ing commands which process LVM entities, the selection is used to choose items to process.

--separator String
String to use to separate each column. Useful if grepping the output.

--shared
Report/display shared VGs that would otherwise be skipped when lvmlockd is not being used on the host. See lvmlockd(8) for more information about shared VGs.

-s|--short
Only display the size of the given PVs.

-O|--sort String
Comma-separated ordered list of columns to sort by. Replaces the default selection. Precede any column with - for a reverse sort on that column.

-t|--test
Run in test mode. Commands will not update metadata. This is implemented by disabling all metadata writing but nevertheless returning success to the calling function. This may lead to unusual error messages in
multi-stage operations if a tool relies on reading back metadata it believes has changed but hasn't.

--unbuffered
Produce output immediately without sorting or aligning the columns properly.

--units r|R|h|H|b|B|s|S|k|K|m|M|g|G|t|T|p|P|e|E
All sizes are output in these units: human-(r)eadable with '<' rounding indicator, (h)uman-readable, (b)ytes, (s)ectors, (k)ilobytes, (m)egabytes, (g)igabytes, (t)erabytes, (p)etabytes, (e)xabytes. Capitalise to
use multiples of 1000 (S.I.) instead of 1024. Custom units can be specified, e.g. --units 3M.

-v|--verbose ...
Set verbose level. Repeat from 1 to 4 times to increase the detail of messages sent to stdout and stderr.

--version
Display version information.

-y|--yes
Do not prompt for confirmation interactively but always assume the answer yes. Use with extreme caution. (For automatic no, see -qq.)

VARIABLES
PV
Physical Volume name, a device path under /dev. For commands managing physical extents, a PV positional arg generally accepts a suffix indicating a range (or multiple ranges) of physical extents (PEs). When the
first PE is omitted, it defaults to the start of the device, and when the last PE is omitted it defaults to end. Start and end range (inclusive): PV[:PE-PE]... Start and length range (counting from 0):
PV[:PE+PE]...

Tag
Tag name. See lvm(8) for information about tag names and using tags in place of a VG, LV or PV.

String
See the option description for information about the string content.

Size[UNIT]
Size is an input number that accepts an optional unit. Input units are always treated as base two values, regardless of capitalization, e.g. 'k' and 'K' both refer to 1024. The default input unit is specified by
letter, followed by |UNIT. UNIT represents other possible input units: bBsSkKmMgGtTpPeE. b|B is bytes, s|S is sectors of 512 bytes, k|K is kilobytes, m|M is megabytes, g|G is gigabytes, t|T is terabytes, p|P is
petabytes, e|E is exabytes. (This should not be confused with the output control --units, where capital letters mean multiple of 1000.)

ENVIRONMENT VARIABLES
See lvm(8) for information about environment variables used by lvm. For example, LVM_VG_NAME can generally be substituted for a required VG parameter.

SEE ALSO
lvm(8) lvm.conf(5) lvmconfig(8)

pvchange(8) pvck(8) pvcreate(8) pvdisplay(8) pvmove(8) pvremove(8) pvresize(8) pvs(8) pvscan(8)

vgcfgbackup(8) vgcfgrestore(8) vgchange(8) vgck(8) vgcreate(8) vgconvert(8) vgdisplay(8) vgexport(8) vgextend(8) vgimport(8) vgimportclone(8) vgmerge(8) vgmknodes(8) vgreduce(8) vgremove(8) vgrename(8) vgs(8) vgscan(8)
vgsplit(8)

lvcreate(8) lvchange(8) lvconvert(8) lvdisplay(8) lvextend(8) lvreduce(8) lvremove(8) lvrename(8) lvresize(8) lvs(8) lvscan(8)

lvm-fullreport(8) lvm-lvpoll(8) lvm2-activation-generator(8) blkdeactivate(8) lvmdump(8)

dmeventd(8) lvmetad(8) lvmpolld(8) lvmlockd(8) lvmlockctl(8) clvmd(8) cmirrord(8) lvmdbusd(8)

lvmsystemid(7) lvmreport(7) lvmraid(7) lvmthin(7) lvmcache(7)

Red Hat, Inc. LVM TOOLS 2.02.176(2) (2017-11-03) PVDISPLAY(8)

pvmove

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
PVMOVE(8)                                                                                              System Manager's Manual                                                                                             PVMOVE(8)

NAME
pvmove - Move extents from one physical volume to another

SYNOPSIS
pvmove position_args
[ option_args ]
[ position_args ]

DESCRIPTION
pvmove moves the allocated physical extents (PEs) on a source PV to one or more destination PVs. You can optionally specify a source LV in which case only extents used by that LV will be moved to free (or specified)
extents on the destination PV. If no destination PV is specified, the normal allocation rules for the VG are used.

If pvmove is interrupted for any reason (e.g. the machine crashes) then run pvmove again without any PV arguments to restart any operations that were in progress from the last checkpoint. Alternatively, use the abort
option at any time to abort the operation. The resulting location of LVs after an abort depends on whether the atomic option was used.

More than one pvmove can run concurrently if they are moving data from different source PVs, but additional pvmoves will ignore any LVs already in the process of being changed, so some data might not get moved.

USAGE
Move PV extents.

pvmove PV
[ -A|--autobackup y|n ]
[ -n|--name LV ]
[ --alloc contiguous|cling|cling_by_tags|normal|anywhere|inherit ]
[ --atomic ]
[ --noudevsync ]
[ --reportformat basic|json ]
[ COMMON_OPTIONS ]
[ PV ... ]

Continue or abort existing pvmove operations.

pvmove
[ COMMON_OPTIONS ]

Common options for command:
[ -b|--background ]
[ -i|--interval Number ]
[ --abort ]

Common options for lvm:
[ -d|--debug ]
[ -h|--help ]
[ -q|--quiet ]
[ -t|--test ]
[ -v|--verbose ]
[ -y|--yes ]
[ --commandprofile String ]
[ --config String ]
[ --driverloaded y|n ]
[ --longhelp ]
[ --profile String ]
[ --version ]

OPTIONS
--abort
Abort any pvmove operations in progress. If a pvmove was started with the --atomic option, then all LVs will remain on the source PV. Otherwise, segments that have been moved will remain on the destination PV,
while unmoved segments will remain on the source PV.

--alloc contiguous|cling|cling_by_tags|normal|anywhere|inherit
Determines the allocation policy when a command needs to allocate Physical Extents (PEs) from the VG. Each VG and LV has an allocation policy which can be changed with vgchange/lvchange, or overriden on the command
line. normal applies common sense rules such as not placing parallel stripes on the same PV. inherit applies the VG policy to an LV. contiguous requires new PEs be placed adjacent to existing PEs. cling places
new PEs on the same PV as existing PEs in the same stripe of the LV. If there are sufficient PEs for an allocation, but normal does not use them, anywhere will use them even if it reduces performance, e.g. by
placing two stripes on the same PV. Optional positional PV args on the command line can also be used to limit which PVs the command will use for allocation. See lvm(8) for more information about allocation.

--atomic
Makes a pvmove operation atomic, ensuring that all affected LVs are moved to the destination PV, or none are if the operation is aborted.

-A|--autobackup y|n
Specifies if metadata should be backed up automatically after a change. Enabling this is strongly advised! See vgcfgbackup(8) for more information.

-b|--background
If the operation requires polling, this option causes the command to return before the operation is complete, and polling is done in the background.

--commandprofile String
The command profile to use for command configuration. See lvm.conf(5) for more information about profiles.

--config String
Config settings for the command. These override lvm.conf settings. The String arg uses the same format as lvm.conf, or may use section/field syntax. See lvm.conf(5) for more information about config.

-d|--debug ...
Set debug level. Repeat from 1 to 6 times to increase the detail of messages sent to the log file and/or syslog (if configured).

--driverloaded y|n
If set to no, the command will not attempt to use device-mapper. For testing and debugging.

-h|--help
Display help text.

-i|--interval Number
Report progress at regular intervals.

--longhelp
Display long help text.

-n|--name String
Move only the extents belonging to the named LV.

--noudevsync
Disables udev synchronisation. The process will not wait for notification from udev. It will continue irrespective of any possible udev processing in the background. Only use this if udev is not running or has
rules that ignore the devices LVM creates.

--profile String
An alias for --commandprofile or --metadataprofile, depending on the command.

-q|--quiet ...
Suppress output and log messages. Overrides --debug and --verbose. Repeat once to also suppress any prompts with answer 'no'.

--reportformat basic|json
Overrides current output format for reports which is defined globally by the report/output_format setting in lvm.conf. basic is the original format with columns and rows. If there is more than one report per com‐
mand, each report is prefixed with the report name for identification. json produces report output in JSON format. See lvmreport(7) for more information.

-t|--test
Run in test mode. Commands will not update metadata. This is implemented by disabling all metadata writing but nevertheless returning success to the calling function. This may lead to unusual error messages in
multi-stage operations if a tool relies on reading back metadata it believes has changed but hasn't.

-v|--verbose ...
Set verbose level. Repeat from 1 to 4 times to increase the detail of messages sent to stdout and stderr.

--version
Display version information.

-y|--yes
Do not prompt for confirmation interactively but always assume the answer yes. Use with extreme caution. (For automatic no, see -qq.)

VARIABLES
PV
Physical Volume name, a device path under /dev. For commands managing physical extents, a PV positional arg generally accepts a suffix indicating a range (or multiple ranges) of physical extents (PEs). When the
first PE is omitted, it defaults to the start of the device, and when the last PE is omitted it defaults to end. Start and end range (inclusive): PV[:PE-PE]... Start and length range (counting from 0):
PV[:PE+PE]...

String
See the option description for information about the string content.

Size[UNIT]
Size is an input number that accepts an optional unit. Input units are always treated as base two values, regardless of capitalization, e.g. 'k' and 'K' both refer to 1024. The default input unit is specified by
letter, followed by |UNIT. UNIT represents other possible input units: bBsSkKmMgGtTpPeE. b|B is bytes, s|S is sectors of 512 bytes, k|K is kilobytes, m|M is megabytes, g|G is gigabytes, t|T is terabytes, p|P is
petabytes, e|E is exabytes. (This should not be confused with the output control --units, where capital letters mean multiple of 1000.)

ENVIRONMENT VARIABLES
See lvm(8) for information about environment variables used by lvm. For example, LVM_VG_NAME can generally be substituted for a required VG parameter.

NOTES
pvmove works as follows:

1. A temporary 'pvmove' LV is created to store details of all the data movements required.

2. Every LV in the VG is searched for contiguous data that need moving according to the command line arguments. For each piece of data found, a new segment is added to the end of the pvmove LV. This segment takes the
form of a temporary mirror to copy the data from the original location to a newly allocated location. The original LV is updated to use the new temporary mirror segment in the pvmove LV instead of accessing the data
directly.

3. The VG metadata is updated on disk.

4. The first segment of the pvmove LV is activated and starts to mirror the first part of the data. Only one segment is mirrored at once as this is usually more efficient.

5. A daemon repeatedly checks progress at the specified time interval. When it detects that the first temporary mirror is in sync, it breaks that mirror so that only the new location for that data gets used and writes a
checkpoint into the VG metadata on disk. Then it activates the mirror for the next segment of the pvmove LV.

6. When there are no more segments left to be mirrored, the temporary LV is removed and the VG metadata is updated so that the LVs reflect the new data locations.

Note that this new process cannot support the original LVM1 type of on-disk metadata. Metadata can be converted using vgconvert(8).

If the --atomic option is used, a slightly different approach is used for the move. Again, a temporary 'pvmove' LV is created to store the details of all the data movements required. This temporary LV contains all the
segments of the various LVs that need to be moved. However, in this case, an identical LV is allocated that contains the same number of segments and a mirror is created to copy the contents from the first temporary LV to
the second. After a complete copy is made, the temporary LVs are removed, leaving behind the segments on the destination PV. If an abort is issued during the move, all LVs being moved will remain on the source PV.

EXAMPLES
Move all physical extents that are used by simple LVs on the specified PV to free physical extents elsewhere in the VG.
pvmove /dev/sdb1

Use a specific destination PV when moving physical extents.
pvmove /dev/sdb1 /dev/sdc1

Move extents belonging to a single LV.
pvmove -n lvol1 /dev/sdb1 /dev/sdc1

Rather than moving the contents of an entire device, it is possible to move a range of physical extents, for example numbers 1000 to 1999 inclusive on the specified PV.
pvmove /dev/sdb1:1000-1999

A range of physical extents to move can be specified as start+length. For example, starting from PE 1000. (Counting starts from 0, so this refers to the 1001st to the 2000th PE inclusive.)
pvmove /dev/sdb1:1000+1000

Move a range of physical extents to a specific PV (which must have sufficient free extents).
pvmove /dev/sdb1:1000-1999 /dev/sdc1

Move a range of physical extents to specific new extents on a new PV.
pvmove /dev/sdb1:1000-1999 /dev/sdc1:0-999

If the source and destination are on the same disk, the anywhere allocation policy is needed.
pvmove --alloc anywhere /dev/sdb1:1000-1999 /dev/sdb1:0-999

The part of a specific LV present within in a range of physical extents can also be picked out and moved.
pvmove -n lvol1 /dev/sdb1:1000-1999 /dev/sdc1

SEE ALSO
lvm(8) lvm.conf(5) lvmconfig(8)

pvchange(8) pvck(8) pvcreate(8) pvdisplay(8) pvmove(8) pvremove(8) pvresize(8) pvs(8) pvscan(8)

vgcfgbackup(8) vgcfgrestore(8) vgchange(8) vgck(8) vgcreate(8) vgconvert(8) vgdisplay(8) vgexport(8) vgextend(8) vgimport(8) vgimportclone(8) vgmerge(8) vgmknodes(8) vgreduce(8) vgremove(8) vgrename(8) vgs(8) vgscan(8)
vgsplit(8)

lvcreate(8) lvchange(8) lvconvert(8) lvdisplay(8) lvextend(8) lvreduce(8) lvremove(8) lvrename(8) lvresize(8) lvs(8) lvscan(8)

lvm-fullreport(8) lvm-lvpoll(8) lvm2-activation-generator(8) blkdeactivate(8) lvmdump(8)

dmeventd(8) lvmetad(8) lvmpolld(8) lvmlockd(8) lvmlockctl(8) clvmd(8) cmirrord(8) lvmdbusd(8)

lvmsystemid(7) lvmreport(7) lvmraid(7) lvmthin(7) lvmcache(7)

Red Hat, Inc. LVM TOOLS 2.02.176(2) (2017-11-03) PVMOVE(8)

pvremove

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
PVREMOVE(8)                                                                                            System Manager's Manual                                                                                           PVREMOVE(8)

NAME
pvremove - Remove LVM label(s) from physical volume(s)

SYNOPSIS
pvremove position_args
[ option_args ]

DESCRIPTION
pvremove wipes the label on a device so that LVM will no longer recognise it as a PV.

A PV cannot be removed from a VG while it is used by an active LV.

Repeat the force option (-ff) to forcibly remove a PV belonging to an existing VG. Normally, vgreduce(8) should be used instead.

USAGE
pvremove PV ...
[ -f|--force ]
[ --reportformat basic|json ]
[ COMMON_OPTIONS ]

Common options for lvm:
[ -d|--debug ]
[ -h|--help ]
[ -q|--quiet ]
[ -t|--test ]
[ -v|--verbose ]
[ -y|--yes ]
[ --commandprofile String ]
[ --config String ]
[ --driverloaded y|n ]
[ --longhelp ]
[ --profile String ]
[ --version ]

OPTIONS
--commandprofile String
The command profile to use for command configuration. See lvm.conf(5) for more information about profiles.

--config String
Config settings for the command. These override lvm.conf settings. The String arg uses the same format as lvm.conf, or may use section/field syntax. See lvm.conf(5) for more information about config.

-d|--debug ...
Set debug level. Repeat from 1 to 6 times to increase the detail of messages sent to the log file and/or syslog (if configured).

--driverloaded y|n
If set to no, the command will not attempt to use device-mapper. For testing and debugging.

-f|--force ...
Override various checks, confirmations and protections. Use with extreme caution.

-h|--help
Display help text.

--longhelp
Display long help text.

--profile String
An alias for --commandprofile or --metadataprofile, depending on the command.

-q|--quiet ...
Suppress output and log messages. Overrides --debug and --verbose. Repeat once to also suppress any prompts with answer 'no'.

--reportformat basic|json
Overrides current output format for reports which is defined globally by the report/output_format setting in lvm.conf. basic is the original format with columns and rows. If there is more than one report per com‐
mand, each report is prefixed with the report name for identification. json produces report output in JSON format. See lvmreport(7) for more information.

-t|--test
Run in test mode. Commands will not update metadata. This is implemented by disabling all metadata writing but nevertheless returning success to the calling function. This may lead to unusual error messages in
multi-stage operations if a tool relies on reading back metadata it believes has changed but hasn't.

-v|--verbose ...
Set verbose level. Repeat from 1 to 4 times to increase the detail of messages sent to stdout and stderr.

--version
Display version information.

-y|--yes
Do not prompt for confirmation interactively but always assume the answer yes. Use with extreme caution. (For automatic no, see -qq.)

VARIABLES
PV
Physical Volume name, a device path under /dev. For commands managing physical extents, a PV positional arg generally accepts a suffix indicating a range (or multiple ranges) of physical extents (PEs). When the
first PE is omitted, it defaults to the start of the device, and when the last PE is omitted it defaults to end. Start and end range (inclusive): PV[:PE-PE]... Start and length range (counting from 0):
PV[:PE+PE]...

String
See the option description for information about the string content.

Size[UNIT]
Size is an input number that accepts an optional unit. Input units are always treated as base two values, regardless of capitalization, e.g. 'k' and 'K' both refer to 1024. The default input unit is specified by
letter, followed by |UNIT. UNIT represents other possible input units: bBsSkKmMgGtTpPeE. b|B is bytes, s|S is sectors of 512 bytes, k|K is kilobytes, m|M is megabytes, g|G is gigabytes, t|T is terabytes, p|P is
petabytes, e|E is exabytes. (This should not be confused with the output control --units, where capital letters mean multiple of 1000.)

ENVIRONMENT VARIABLES
See lvm(8) for information about environment variables used by lvm. For example, LVM_VG_NAME can generally be substituted for a required VG parameter.

SEE ALSO
lvm(8) lvm.conf(5) lvmconfig(8)

pvchange(8) pvck(8) pvcreate(8) pvdisplay(8) pvmove(8) pvremove(8) pvresize(8) pvs(8) pvscan(8)

vgcfgbackup(8) vgcfgrestore(8) vgchange(8) vgck(8) vgcreate(8) vgconvert(8) vgdisplay(8) vgexport(8) vgextend(8) vgimport(8) vgimportclone(8) vgmerge(8) vgmknodes(8) vgreduce(8) vgremove(8) vgrename(8) vgs(8) vgscan(8)
vgsplit(8)

lvcreate(8) lvchange(8) lvconvert(8) lvdisplay(8) lvextend(8) lvreduce(8) lvremove(8) lvrename(8) lvresize(8) lvs(8) lvscan(8)

lvm-fullreport(8) lvm-lvpoll(8) lvm2-activation-generator(8) blkdeactivate(8) lvmdump(8)

dmeventd(8) lvmetad(8) lvmpolld(8) lvmlockd(8) lvmlockctl(8) clvmd(8) cmirrord(8) lvmdbusd(8)

lvmsystemid(7) lvmreport(7) lvmraid(7) lvmthin(7) lvmcache(7)

Red Hat, Inc. LVM TOOLS 2.02.176(2) (2017-11-03) PVREMOVE(8)

pvresize

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
PVRESIZE(8)                                                                                            System Manager's Manual                                                                                           PVRESIZE(8)

NAME
pvresize - Resize physical volume(s)

SYNOPSIS
pvresize position_args
[ option_args ]

DESCRIPTION
pvresize resizes a PV. The PV may already be in a VG and may have active LVs allocated on it.

USAGE
pvresize PV ...
[ --setphysicalvolumesize Size[m|UNIT] ]
[ --reportformat basic|json ]
[ COMMON_OPTIONS ]

Common options for lvm:
[ -d|--debug ]
[ -h|--help ]
[ -q|--quiet ]
[ -t|--test ]
[ -v|--verbose ]
[ -y|--yes ]
[ --commandprofile String ]
[ --config String ]
[ --driverloaded y|n ]
[ --longhelp ]
[ --profile String ]
[ --version ]

OPTIONS
--commandprofile String
The command profile to use for command configuration. See lvm.conf(5) for more information about profiles.

--config String
Config settings for the command. These override lvm.conf settings. The String arg uses the same format as lvm.conf, or may use section/field syntax. See lvm.conf(5) for more information about config.

-d|--debug ...
Set debug level. Repeat from 1 to 6 times to increase the detail of messages sent to the log file and/or syslog (if configured).

--driverloaded y|n
If set to no, the command will not attempt to use device-mapper. For testing and debugging.

-h|--help
Display help text.

--longhelp
Display long help text.

--profile String
An alias for --commandprofile or --metadataprofile, depending on the command.

-q|--quiet ...
Suppress output and log messages. Overrides --debug and --verbose. Repeat once to also suppress any prompts with answer 'no'.

--reportformat basic|json
Overrides current output format for reports which is defined globally by the report/output_format setting in lvm.conf. basic is the original format with columns and rows. If there is more than one report per com‐
mand, each report is prefixed with the report name for identification. json produces report output in JSON format. See lvmreport(7) for more information.

--setphysicalvolumesize Size[m|UNIT]
Overrides the automatically detected size of the PV. Use with care, or prior to reducing the physical size of the device.

-t|--test
Run in test mode. Commands will not update metadata. This is implemented by disabling all metadata writing but nevertheless returning success to the calling function. This may lead to unusual error messages in
multi-stage operations if a tool relies on reading back metadata it believes has changed but hasn't.

-v|--verbose ...
Set verbose level. Repeat from 1 to 4 times to increase the detail of messages sent to stdout and stderr.

--version
Display version information.

-y|--yes
Do not prompt for confirmation interactively but always assume the answer yes. Use with extreme caution. (For automatic no, see -qq.)

VARIABLES
PV
Physical Volume name, a device path under /dev. For commands managing physical extents, a PV positional arg generally accepts a suffix indicating a range (or multiple ranges) of physical extents (PEs). When the
first PE is omitted, it defaults to the start of the device, and when the last PE is omitted it defaults to end. Start and end range (inclusive): PV[:PE-PE]... Start and length range (counting from 0):
PV[:PE+PE]...

String
See the option description for information about the string content.

Size[UNIT]
Size is an input number that accepts an optional unit. Input units are always treated as base two values, regardless of capitalization, e.g. 'k' and 'K' both refer to 1024. The default input unit is specified by
letter, followed by |UNIT. UNIT represents other possible input units: bBsSkKmMgGtTpPeE. b|B is bytes, s|S is sectors of 512 bytes, k|K is kilobytes, m|M is megabytes, g|G is gigabytes, t|T is terabytes, p|P is
petabytes, e|E is exabytes. (This should not be confused with the output control --units, where capital letters mean multiple of 1000.)

ENVIRONMENT VARIABLES
See lvm(8) for information about environment variables used by lvm. For example, LVM_VG_NAME can generally be substituted for a required VG parameter.

NOTES
pvresize will refuse to shrink a PV if it has allocated extents beyond the new end.

EXAMPLES
Expand a PV after enlarging the partition.
pvresize /dev/sda1

Shrink a PV prior to shrinking the partition (ensure that the PV size is appropriate for the intended new partition size).
pvresize --setphysicalvolumesize 40G /dev/sda1

SEE ALSO
lvm(8) lvm.conf(5) lvmconfig(8)

pvchange(8) pvck(8) pvcreate(8) pvdisplay(8) pvmove(8) pvremove(8) pvresize(8) pvs(8) pvscan(8)

vgcfgbackup(8) vgcfgrestore(8) vgchange(8) vgck(8) vgcreate(8) vgconvert(8) vgdisplay(8) vgexport(8) vgextend(8) vgimport(8) vgimportclone(8) vgmerge(8) vgmknodes(8) vgreduce(8) vgremove(8) vgrename(8) vgs(8) vgscan(8)
vgsplit(8)

lvcreate(8) lvchange(8) lvconvert(8) lvdisplay(8) lvextend(8) lvreduce(8) lvremove(8) lvrename(8) lvresize(8) lvs(8) lvscan(8)

lvm-fullreport(8) lvm-lvpoll(8) lvm2-activation-generator(8) blkdeactivate(8) lvmdump(8)

dmeventd(8) lvmetad(8) lvmpolld(8) lvmlockd(8) lvmlockctl(8) clvmd(8) cmirrord(8) lvmdbusd(8)

lvmsystemid(7) lvmreport(7) lvmraid(7) lvmthin(7) lvmcache(7)

Red Hat, Inc. LVM TOOLS 2.02.176(2) (2017-11-03) PVRESIZE(8)

pvs

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
PVS(8)                                                                                                 System Manager's Manual                                                                                                PVS(8)

NAME
pvs - Display information about physical volumes

SYNOPSIS
pvs
[ option_args ]
[ position_args ]

DESCRIPTION
pvs produces formatted output about PVs.

USAGE
pvs
[ -a|--all ]
[ -o|--options String ]
[ -S|--select String ]
[ -O|--sort String ]
[ --segments ]
[ --aligned ]
[ --binary ]
[ --configreport log|vg|lv|pv|pvseg|seg ]
[ --foreign ]
[ --ignorelockingfailure ]
[ --ignoreskippedcluster ]
[ --logonly ]
[ --nameprefixes ]
[ --noheadings ]
[ --nolocking ]
[ --nosuffix ]
[ --readonly ]
[ --reportformat basic|json ]
[ --rows ]
[ --separator String ]
[ --shared ]
[ --trustcache ]
[ --unbuffered ]
[ --units r|R|h|H|b|B|s|S|k|K|m|M|g|G|t|T|p|P|e|E ]
[ --unquoted ]
[ COMMON_OPTIONS ]
[ PV|Tag ... ]

Common options for lvm:
[ -d|--debug ]
[ -h|--help ]
[ -q|--quiet ]
[ -t|--test ]
[ -v|--verbose ]
[ -y|--yes ]
[ --commandprofile String ]
[ --config String ]
[ --driverloaded y|n ]
[ --longhelp ]
[ --profile String ]
[ --version ]

OPTIONS
--aligned
Use with --separator to align the output columns

-a|--all
Show information about devices that have not been initialized by LVM, i.e. they are not PVs.

--binary
Use binary values "0" or "1" instead of descriptive literal values for columns that have exactly two valid values to report (not counting the "unknown" value which denotes that the value could not be determined).

--commandprofile String
The command profile to use for command configuration. See lvm.conf(5) for more information about profiles.

--config String
Config settings for the command. These override lvm.conf settings. The String arg uses the same format as lvm.conf, or may use section/field syntax. See lvm.conf(5) for more information about config.

--configreport log|vg|lv|pv|pvseg|seg
See lvmreport(7).

-d|--debug ...
Set debug level. Repeat from 1 to 6 times to increase the detail of messages sent to the log file and/or syslog (if configured).

--driverloaded y|n
If set to no, the command will not attempt to use device-mapper. For testing and debugging.

--foreign
Report/display foreign VGs that would otherwise be skipped. See lvmsystemid(7) for more information about foreign VGs.

-h|--help
Display help text.

--ignorelockingfailure
Allows a command to continue with read-only metadata operations after locking failures.

--ignoreskippedcluster
Use to avoid exiting with an non-zero status code if the command is run without clustered locking and clustered VGs are skipped.

--logonly
Suppress command report and display only log report.

--longhelp
Display long help text.

--nameprefixes
Add an "LVM2_" prefix plus the field name to the output. Useful with --noheadings to produce a list of field=value pairs that can be used to set environment variables (for example, in udev rules).

--noheadings
Suppress the headings line that is normally the first line of output. Useful if grepping the output.

--nolocking
Disable locking.

--nosuffix
Suppress the suffix on output sizes. Use with --units (except h and H) if processing the output.

-o|--options String
Comma-separated, ordered list of fields to display in columns. String arg syntax is: [+|-|#]Field1[,Field2 ...] The prefix + will append the specified fields to the default fields, - will remove the specified
fields from the default fields, and # will compact specified fields (removing them when empty for all rows.) Use -o help to view the list of all available fields. Use separate lists of fields to add, remove or
compact by repeating the -o option: -o+field1,field2 -o-field3,field4 -o#field5. These lists are evaluated from left to right. Use field name lv_all to view all LV fields, vg_all all VG fields, pv_all all PV
fields, pvseg_all all PV segment fields, seg_all all LV segment fields, and pvseg_all all PV segment columns. See the lvm.conf report section for more config options. See lvmreport(7) for more information about
reporting.

--profile String
An alias for --commandprofile or --metadataprofile, depending on the command.

-q|--quiet ...
Suppress output and log messages. Overrides --debug and --verbose. Repeat once to also suppress any prompts with answer 'no'.

--readonly
Run the command in a special read-only mode which will read on-disk metadata without needing to take any locks. This can be used to peek inside metadata used by a virtual machine image while the virtual machine is
running. It can also be used to peek inside the metadata of clustered VGs when clustered locking is not configured or running. No attempt will be made to communicate with the device-mapper kernel driver, so this
option is unable to report whether or not LVs are actually in use.

--reportformat basic|json
Overrides current output format for reports which is defined globally by the report/output_format setting in lvm.conf. basic is the original format with columns and rows. If there is more than one report per com‐
mand, each report is prefixed with the report name for identification. json produces report output in JSON format. See lvmreport(7) for more information.

--rows
Output columns as rows.

--segments
Produces one line of output for each contiguous allocation of space on each PV, showing the start (pvseg_start) and length (pvseg_size) in units of physical extents.

-S|--select String
Select objects for processing and reporting based on specified criteria. The criteria syntax is described by --select help and lvmreport(7). For reporting commands, one row is displayed for each object matching
the criteria. See --options help for selectable object fields. Rows can be displayed with an additional "selected" field (-o selected) showing 1 if the row matches the selection and 0 otherwise. For non-report‐
ing commands which process LVM entities, the selection is used to choose items to process.

--separator String
String to use to separate each column. Useful if grepping the output.

--shared
Report/display shared VGs that would otherwise be skipped when lvmlockd is not being used on the host. See lvmlockd(8) for more information about shared VGs.

-O|--sort String
Comma-separated ordered list of columns to sort by. Replaces the default selection. Precede any column with - for a reverse sort on that column.

-t|--test
Run in test mode. Commands will not update metadata. This is implemented by disabling all metadata writing but nevertheless returning success to the calling function. This may lead to unusual error messages in
multi-stage operations if a tool relies on reading back metadata it believes has changed but hasn't.

--trustcache
Avoids certain device scanning during command processing. Do not use.

--unbuffered
Produce output immediately without sorting or aligning the columns properly.

--units r|R|h|H|b|B|s|S|k|K|m|M|g|G|t|T|p|P|e|E
All sizes are output in these units: human-(r)eadable with '<' rounding indicator, (h)uman-readable, (b)ytes, (s)ectors, (k)ilobytes, (m)egabytes, (g)igabytes, (t)erabytes, (p)etabytes, (e)xabytes. Capitalise to
use multiples of 1000 (S.I.) instead of 1024. Custom units can be specified, e.g. --units 3M.

--unquoted
When used with --nameprefixes, output values in the field=value pairs are not quoted.

-v|--verbose ...
Set verbose level. Repeat from 1 to 4 times to increase the detail of messages sent to stdout and stderr.

--version
Display version information.

-y|--yes
Do not prompt for confirmation interactively but always assume the answer yes. Use with extreme caution. (For automatic no, see -qq.)

VARIABLES
PV
Physical Volume name, a device path under /dev. For commands managing physical extents, a PV positional arg generally accepts a suffix indicating a range (or multiple ranges) of physical extents (PEs). When the
first PE is omitted, it defaults to the start of the device, and when the last PE is omitted it defaults to end. Start and end range (inclusive): PV[:PE-PE]... Start and length range (counting from 0):
PV[:PE+PE]...

Tag
Tag name. See lvm(8) for information about tag names and using tags in place of a VG, LV or PV.

String
See the option description for information about the string content.

Size[UNIT]
Size is an input number that accepts an optional unit. Input units are always treated as base two values, regardless of capitalization, e.g. 'k' and 'K' both refer to 1024. The default input unit is specified by
letter, followed by |UNIT. UNIT represents other possible input units: bBsSkKmMgGtTpPeE. b|B is bytes, s|S is sectors of 512 bytes, k|K is kilobytes, m|M is megabytes, g|G is gigabytes, t|T is terabytes, p|P is
petabytes, e|E is exabytes. (This should not be confused with the output control --units, where capital letters mean multiple of 1000.)

ENVIRONMENT VARIABLES
See lvm(8) for information about environment variables used by lvm. For example, LVM_VG_NAME can generally be substituted for a required VG parameter.

NOTES
The pv_attr bits are:

1 (d)uplicate, (a)llocatable, (u)sed

2 e(x)ported

3 (m)issing

SEE ALSO
lvm(8) lvm.conf(5) lvmconfig(8)

pvchange(8) pvck(8) pvcreate(8) pvdisplay(8) pvmove(8) pvremove(8) pvresize(8) pvs(8) pvscan(8)

vgcfgbackup(8) vgcfgrestore(8) vgchange(8) vgck(8) vgcreate(8) vgconvert(8) vgdisplay(8) vgexport(8) vgextend(8) vgimport(8) vgimportclone(8) vgmerge(8) vgmknodes(8) vgreduce(8) vgremove(8) vgrename(8) vgs(8) vgscan(8)
vgsplit(8)

lvcreate(8) lvchange(8) lvconvert(8) lvdisplay(8) lvextend(8) lvreduce(8) lvremove(8) lvrename(8) lvresize(8) lvs(8) lvscan(8)

lvm-fullreport(8) lvm-lvpoll(8) lvm2-activation-generator(8) blkdeactivate(8) lvmdump(8)

dmeventd(8) lvmetad(8) lvmpolld(8) lvmlockd(8) lvmlockctl(8) clvmd(8) cmirrord(8) lvmdbusd(8)

lvmsystemid(7) lvmreport(7) lvmraid(7) lvmthin(7) lvmcache(7)

Red Hat, Inc. LVM TOOLS 2.02.176(2) (2017-11-03) PVS(8)

pvscan

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
PVSCAN(8)                                                                                              System Manager's Manual                                                                                             PVSCAN(8)

NAME
pvscan - List all physical volumes

SYNOPSIS
pvscan option_args
[ option_args ]
[ position_args ]

DESCRIPTION
pvscan scans all supported LVM block devices in the system for PVs.

Scanning with lvmetad

pvscan operates differently when used with the lvmetad(8) daemon.

Scanning disks is required to read LVM metadata and identify LVM PVs. Once read, lvmetad caches the metadata so that LVM commands can read it without repeatedly scanning disks. This is helpful because scanning disks is
time consuming, and frequent scanning may interfere with the normal work of the system and disks.

When lvmetad is not used, LVM commands revert to scanning disks to read metadata. Any LVM command that needs metadata will scan disks for it; running the pvscan command is not necessary for the sake of other LVM com‐
mands.

When lvmetad is used, LVM commands avoid scanning disks by reading metadata from lvmetad. When new disks appear, they must be scanned so their metadata can be cached in lvmetad. This is done by the command pvscan
--cache, which scans disks and passes the metadata to lvmetad.

The pvscan --cache command is typically run automatically by system services when a new device appears. Users do not generally need to run this command if the system and lvmetad are running properly.

Many scripts contain unnecessary pvscan (or vgscan) commands for historical reasons. To avoid disrupting the system with extraneous disk scanning, an ordinary pvscan (without --cache) will simply read metadata from
lvmetad like other LVM commands. It does not do anything beyond displaying the current state of the cache.

· When given specific device name arguments, pvscan --cache will only read the named devices.

· LVM udev rules and systemd services are used to initiate automatic device scanning.

· To prevent devices from being scanned by pvscan --cache, add them to lvm.conf(5) devices/global_filter. The devices/filter setting does not apply to system level scanning. For more information, see:
lvmconfig --withcomments devices/global_filter

· If lvmetad is started or restarted after devices are visible, or if the global_filter has changed, then all devices must be rescanned for metadata with the command pvscan --cache.

· lvmetad does not cache older metadata formats, e.g. lvm1, and will be temporarily disabled if they are seen.

· To notify lvmetad about a device that is no longer present, the major and minor numbers must be given, not the path.

Automatic activation

When event-driven system services detect a new LVM device, the first step is to automatically scan and cache the metadata from the device. This is done by pvscan --cache. A second step is to automatically activate LVs
that are present on the new device. This auto-activation is done by the same pvscan --cache command when the option --activate ay is included.

Auto-activation of VGs or LVs can be enabled/disabled using:
lvm.conf(5) activation/auto_activation_volume_list

For more information, see:
lvmconfig --withcomments activation/auto_activation_volume_list

When this setting is undefined, all LVs are auto-activated (when lvm is fully integrated with the event-driven system services.)

When a VG or LV is not auto-activated, traditional activation using vgchange or lvchange --activate is needed.

· pvscan auto-activation can be only done in combination with --cache.

· Auto-activation is designated by the "a" argument in --activate ay. This is meant to distinguish system generated commands from explicit user commands, although it can be used in any activation command. Whenever it is
used, the auto_activation_volume_list is applied.

· Auto-activation is not yet supported for LVs that are part of partial or clustered volume groups.

USAGE
Display PV information.

pvscan
[ -e|--exported ]
[ -n|--novolumegroup ]
[ -s|--short ]
[ -u|--uuid ]
[ COMMON_OPTIONS ]

Populate the lvmetad cache by scanning PVs.

pvscan --cache
[ -b|--background ]
[ -a|--activate ay ]
[ -j|--major Number ]
[ --minor Number ]
[ COMMON_OPTIONS ]
[ String|PV ... ]

Common options for command:
[ --ignorelockingfailure ]
[ --reportformat basic|json ]

Common options for lvm:
[ -d|--debug ]
[ -h|--help ]
[ -q|--quiet ]
[ -t|--test ]
[ -v|--verbose ]
[ -y|--yes ]
[ --commandprofile String ]
[ --config String ]
[ --driverloaded y|n ]
[ --longhelp ]
[ --profile String ]
[ --version ]

OPTIONS
-a|--activate y|n|ay
Auto-activate LVs in a VG when the PVs scanned have completed the VG. (Only ay is applicable.)

-b|--background
If the operation requires polling, this option causes the command to return before the operation is complete, and polling is done in the background.

--cache
Scan one or more devices and send the metadata to lvmetad.

--commandprofile String
The command profile to use for command configuration. See lvm.conf(5) for more information about profiles.

--config String
Config settings for the command. These override lvm.conf settings. The String arg uses the same format as lvm.conf, or may use section/field syntax. See lvm.conf(5) for more information about config.

-d|--debug ...
Set debug level. Repeat from 1 to 6 times to increase the detail of messages sent to the log file and/or syslog (if configured).

--driverloaded y|n
If set to no, the command will not attempt to use device-mapper. For testing and debugging.

-e|--exported
Only show PVs belonging to exported VGs.

-h|--help
Display help text.

--ignorelockingfailure
Allows a command to continue with read-only metadata operations after locking failures.

--longhelp
Display long help text.

-j|--major Number
The major number of a device.

--minor Number
The minor number of a device.

-n|--novolumegroup
Only show PVs not belonging to any VG.

--profile String
An alias for --commandprofile or --metadataprofile, depending on the command.

-q|--quiet ...
Suppress output and log messages. Overrides --debug and --verbose. Repeat once to also suppress any prompts with answer 'no'.

--reportformat basic|json
Overrides current output format for reports which is defined globally by the report/output_format setting in lvm.conf. basic is the original format with columns and rows. If there is more than one report per com‐
mand, each report is prefixed with the report name for identification. json produces report output in JSON format. See lvmreport(7) for more information.

-s|--short
Short listing format.

-t|--test
Run in test mode. Commands will not update metadata. This is implemented by disabling all metadata writing but nevertheless returning success to the calling function. This may lead to unusual error messages in
multi-stage operations if a tool relies on reading back metadata it believes has changed but hasn't.

-u|--uuid
Show UUIDs in addition to device names.

-v|--verbose ...
Set verbose level. Repeat from 1 to 4 times to increase the detail of messages sent to stdout and stderr.

--version
Display version information.

-y|--yes
Do not prompt for confirmation interactively but always assume the answer yes. Use with extreme caution. (For automatic no, see -qq.)

VARIABLES
PV
Physical Volume name, a device path under /dev. For commands managing physical extents, a PV positional arg generally accepts a suffix indicating a range (or multiple ranges) of physical extents (PEs). When the
first PE is omitted, it defaults to the start of the device, and when the last PE is omitted it defaults to end. Start and end range (inclusive): PV[:PE-PE]... Start and length range (counting from 0):
PV[:PE+PE]...

String
See the option description for information about the string content.

Size[UNIT]
Size is an input number that accepts an optional unit. Input units are always treated as base two values, regardless of capitalization, e.g. 'k' and 'K' both refer to 1024. The default input unit is specified by
letter, followed by |UNIT. UNIT represents other possible input units: bBsSkKmMgGtTpPeE. b|B is bytes, s|S is sectors of 512 bytes, k|K is kilobytes, m|M is megabytes, g|G is gigabytes, t|T is terabytes, p|P is
petabytes, e|E is exabytes. (This should not be confused with the output control --units, where capital letters mean multiple of 1000.)

ENVIRONMENT VARIABLES
See lvm(8) for information about environment variables used by lvm. For example, LVM_VG_NAME can generally be substituted for a required VG parameter.

SEE ALSO
lvm(8) lvm.conf(5) lvmconfig(8)

pvchange(8) pvck(8) pvcreate(8) pvdisplay(8) pvmove(8) pvremove(8) pvresize(8) pvs(8) pvscan(8)

vgcfgbackup(8) vgcfgrestore(8) vgchange(8) vgck(8) vgcreate(8) vgconvert(8) vgdisplay(8) vgexport(8) vgextend(8) vgimport(8) vgimportclone(8) vgmerge(8) vgmknodes(8) vgreduce(8) vgremove(8) vgrename(8) vgs(8) vgscan(8)
vgsplit(8)

lvcreate(8) lvchange(8) lvconvert(8) lvdisplay(8) lvextend(8) lvreduce(8) lvremove(8) lvrename(8) lvresize(8) lvs(8) lvscan(8)

lvm-fullreport(8) lvm-lvpoll(8) lvm2-activation-generator(8) blkdeactivate(8) lvmdump(8)

dmeventd(8) lvmetad(8) lvmpolld(8) lvmlockd(8) lvmlockctl(8) clvmd(8) cmirrord(8) lvmdbusd(8)

lvmsystemid(7) lvmreport(7) lvmraid(7) lvmthin(7) lvmcache(7)

Red Hat, Inc. LVM TOOLS 2.02.176(2) (2017-11-03) PVSCAN(8)

vgcfgbackup

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
VGCFGBACKUP(8)                                                                                         System Manager's Manual                                                                                        VGCFGBACKUP(8)

NAME
vgcfgbackup - Backup volume group configuration(s)

SYNOPSIS
vgcfgbackup
[ option_args ]
[ position_args ]

DESCRIPTION
vgcfgbackup creates back up files containing metadata of VGs. If no VGs are named, back up files are created for all VGs. See vgcfgrestore for information on using the back up files.

In a default installation, each VG is backed up into a separate file bearing the name of the VG in the directory /etc/lvm/backup.

To use an alternative back up file, use -f. In this case, when backing up multiple VGs, the file name is treated as a template, with %s replaced by the VG name.

NB. This DOES NOT back up the data content of LVs.

It may also be useful to regularly back up the files in /etc/lvm.

USAGE
vgcfgbackup
[ -f|--file String ]
[ --foreign ]
[ --ignorelockingfailure ]
[ --readonly ]
[ --reportformat basic|json ]
[ COMMON_OPTIONS ]
[ VG ... ]

Common options for lvm:
[ -d|--debug ]
[ -h|--help ]
[ -q|--quiet ]
[ -t|--test ]
[ -v|--verbose ]
[ -y|--yes ]
[ --commandprofile String ]
[ --config String ]
[ --driverloaded y|n ]
[ --longhelp ]
[ --profile String ]
[ --version ]

OPTIONS
--commandprofile String
The command profile to use for command configuration. See lvm.conf(5) for more information about profiles.

--config String
Config settings for the command. These override lvm.conf settings. The String arg uses the same format as lvm.conf, or may use section/field syntax. See lvm.conf(5) for more information about config.

-d|--debug ...
Set debug level. Repeat from 1 to 6 times to increase the detail of messages sent to the log file and/or syslog (if configured).

--driverloaded y|n
If set to no, the command will not attempt to use device-mapper. For testing and debugging.

-f|--file String
Write the backup to the named file. When backing up more than one VG, the file name is treated as a template, and %s is replaced by the VG name.

--foreign
Report/display foreign VGs that would otherwise be skipped. See lvmsystemid(7) for more information about foreign VGs.

-h|--help
Display help text.

--ignorelockingfailure
Allows a command to continue with read-only metadata operations after locking failures.

--longhelp
Display long help text.

--profile String
An alias for --commandprofile or --metadataprofile, depending on the command.

-q|--quiet ...
Suppress output and log messages. Overrides --debug and --verbose. Repeat once to also suppress any prompts with answer 'no'.

--readonly
Run the command in a special read-only mode which will read on-disk metadata without needing to take any locks. This can be used to peek inside metadata used by a virtual machine image while the virtual machine is
running. It can also be used to peek inside the metadata of clustered VGs when clustered locking is not configured or running. No attempt will be made to communicate with the device-mapper kernel driver, so this
option is unable to report whether or not LVs are actually in use.

--reportformat basic|json
Overrides current output format for reports which is defined globally by the report/output_format setting in lvm.conf. basic is the original format with columns and rows. If there is more than one report per com‐
mand, each report is prefixed with the report name for identification. json produces report output in JSON format. See lvmreport(7) for more information.

-t|--test
Run in test mode. Commands will not update metadata. This is implemented by disabling all metadata writing but nevertheless returning success to the calling function. This may lead to unusual error messages in
multi-stage operations if a tool relies on reading back metadata it believes has changed but hasn't.

-v|--verbose ...
Set verbose level. Repeat from 1 to 4 times to increase the detail of messages sent to stdout and stderr.

--version
Display version information.

-y|--yes
Do not prompt for confirmation interactively but always assume the answer yes. Use with extreme caution. (For automatic no, see -qq.)

VARIABLES
VG
Volume Group name. See lvm(8) for valid names.

String
See the option description for information about the string content.

Size[UNIT]
Size is an input number that accepts an optional unit. Input units are always treated as base two values, regardless of capitalization, e.g. 'k' and 'K' both refer to 1024. The default input unit is specified by
letter, followed by |UNIT. UNIT represents other possible input units: bBsSkKmMgGtTpPeE. b|B is bytes, s|S is sectors of 512 bytes, k|K is kilobytes, m|M is megabytes, g|G is gigabytes, t|T is terabytes, p|P is
petabytes, e|E is exabytes. (This should not be confused with the output control --units, where capital letters mean multiple of 1000.)

ENVIRONMENT VARIABLES
See lvm(8) for information about environment variables used by lvm. For example, LVM_VG_NAME can generally be substituted for a required VG parameter.

SEE ALSO
lvm(8) lvm.conf(5) lvmconfig(8)

pvchange(8) pvck(8) pvcreate(8) pvdisplay(8) pvmove(8) pvremove(8) pvresize(8) pvs(8) pvscan(8)

vgcfgbackup(8) vgcfgrestore(8) vgchange(8) vgck(8) vgcreate(8) vgconvert(8) vgdisplay(8) vgexport(8) vgextend(8) vgimport(8) vgimportclone(8) vgmerge(8) vgmknodes(8) vgreduce(8) vgremove(8) vgrename(8) vgs(8) vgscan(8)
vgsplit(8)

lvcreate(8) lvchange(8) lvconvert(8) lvdisplay(8) lvextend(8) lvreduce(8) lvremove(8) lvrename(8) lvresize(8) lvs(8) lvscan(8)

lvm-fullreport(8) lvm-lvpoll(8) lvm2-activation-generator(8) blkdeactivate(8) lvmdump(8)

dmeventd(8) lvmetad(8) lvmpolld(8) lvmlockd(8) lvmlockctl(8) clvmd(8) cmirrord(8) lvmdbusd(8)

lvmsystemid(7) lvmreport(7) lvmraid(7) lvmthin(7) lvmcache(7)

Red Hat, Inc. LVM TOOLS 2.02.176(2) (2017-11-03) VGCFGBACKUP(8)

vgcfgrestore

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
VGCFGRESTORE(8)                                                                                        System Manager's Manual                                                                                       VGCFGRESTORE(8)

NAME
vgcfgrestore - Restore volume group configuration

SYNOPSIS
vgcfgrestore option_args position_args
[ option_args ]
[ position_args ]

--commandprofile String
--config String
-d|--debug
--driverloaded y|n
-f|--file String
--force
-h|--help
-l|--list
--longhelp
-M|--metadatatype lvm2|lvm1
--profile String
-q|--quiet
-t|--test
-v|--verbose
--version
-y|--yes

DESCRIPTION
vgcfgrestore restores the metadata of a VG from a text back up file produced by vgcfgbackup. This writes VG metadata onto the devices specifed in back up file.

A back up file can be specified with --file. If no backup file is specified, the most recent one is used. Use --list for a list of the available back up and archive files of a VG.

WARNING: When a VG contains thin pools, changes to thin metadata cannot be reverted, and data loss may occur if thin metadata has changed. The force option is required to restore in this case.

USAGE
Restore VG metadata from last backup.

vgcfgrestore VG
[ COMMON_OPTIONS ]
-

Restore VG metadata from specified file.

vgcfgrestore -f|--file String VG
[ COMMON_OPTIONS ]
-

List all VG metadata backups.

vgcfgrestore -l|--list VG
[ COMMON_OPTIONS ]
-

List one VG metadata backup file.

vgcfgrestore -l|--list -f|--file String
[ COMMON_OPTIONS ]
[ VG ]
-

Common options for command:
[ -M|--metadatatype lvm2|lvm1 ]
[ --force ]

Common options for lvm:
[ -d|--debug ]
[ -h|--help ]
[ -q|--quiet ]
[ -t|--test ]
[ -v|--verbose ]
[ -y|--yes ]
[ --commandprofile String ]
[ --config String ]
[ --driverloaded y|n ]
[ --longhelp ]
[ --profile String ]
[ --version ]

OPTIONS
--commandprofile String
The command profile to use for command configuration. See lvm.conf(5) for more information about profiles.

--config String
Config settings for the command. These override lvm.conf settings. The String arg uses the same format as lvm.conf, or may use section/field syntax. See lvm.conf(5) for more information about config.

-d|--debug ...
Set debug level. Repeat from 1 to 6 times to increase the detail of messages sent to the log file and/or syslog (if configured).

--driverloaded y|n
If set to no, the command will not attempt to use device-mapper. For testing and debugging.

-f|--file String
Read metadata backup from the named file. Usually this file was created by vgcfgbackup.

--force ...
Force metadata restore even with thin pool LVs. Use with extreme caution. Most changes to thin metadata cannot be reverted. You may lose data if you restore metadata that does not match the thin pool kernel meta‐
data precisely.

-h|--help
Display help text.

-l|--list
List metadata backup and archive files pertaining to the VG. May be used with --file. Does not restore the VG.

--longhelp
Display long help text.

-M|--metadatatype lvm2|lvm1
Specifies the type of on-disk metadata to use. lvm2 (or just 2) is the current, standard format. lvm1 (or just 1) is a historical format that can be used for accessing old data.

--profile String
An alias for --commandprofile or --metadataprofile, depending on the command.

-q|--quiet ...
Suppress output and log messages. Overrides --debug and --verbose. Repeat once to also suppress any prompts with answer 'no'.

-t|--test
Run in test mode. Commands will not update metadata. This is implemented by disabling all metadata writing but nevertheless returning success to the calling function. This may lead to unusual error messages in
multi-stage operations if a tool relies on reading back metadata it believes has changed but hasn't.

-v|--verbose ...
Set verbose level. Repeat from 1 to 4 times to increase the detail of messages sent to stdout and stderr.

--version
Display version information.

-y|--yes
Do not prompt for confirmation interactively but always assume the answer yes. Use with extreme caution. (For automatic no, see -qq.)

VARIABLES
VG
Volume Group name. See lvm(8) for valid names.

String
See the option description for information about the string content.

Size[UNIT]
Size is an input number that accepts an optional unit. Input units are always treated as base two values, regardless of capitalization, e.g. 'k' and 'K' both refer to 1024. The default input unit is specified by
letter, followed by |UNIT. UNIT represents other possible input units: bBsSkKmMgGtTpPeE. b|B is bytes, s|S is sectors of 512 bytes, k|K is kilobytes, m|M is megabytes, g|G is gigabytes, t|T is terabytes, p|P is
petabytes, e|E is exabytes. (This should not be confused with the output control --units, where capital letters mean multiple of 1000.)

ENVIRONMENT VARIABLES
See lvm(8) for information about environment variables used by lvm. For example, LVM_VG_NAME can generally be substituted for a required VG parameter.

NOTES
To replace PVs, vgdisplay --partial --verbose will show the UUIDs and sizes of any PVs that are no longer present. If a PV in the VG is lost and you wish to substitute another of the same size, use pvcreate --restorefile
filename --uuid uuid (plus additional arguments as appropriate) to initialise it with the same UUID as the missing PV. Repeat for all other missing PVs in the VG. Then use vgcfgrestore --file filename to restore the VG's
metadata.

SEE ALSO
lvm(8) lvm.conf(5) lvmconfig(8)

pvchange(8) pvck(8) pvcreate(8) pvdisplay(8) pvmove(8) pvremove(8) pvresize(8) pvs(8) pvscan(8)

vgcfgbackup(8) vgcfgrestore(8) vgchange(8) vgck(8) vgcreate(8) vgconvert(8) vgdisplay(8) vgexport(8) vgextend(8) vgimport(8) vgimportclone(8) vgmerge(8) vgmknodes(8) vgreduce(8) vgremove(8) vgrename(8) vgs(8) vgscan(8)
vgsplit(8)

lvcreate(8) lvchange(8) lvconvert(8) lvdisplay(8) lvextend(8) lvreduce(8) lvremove(8) lvrename(8) lvresize(8) lvs(8) lvscan(8)

lvm-fullreport(8) lvm-lvpoll(8) lvm2-activation-generator(8) blkdeactivate(8) lvmdump(8)

dmeventd(8) lvmetad(8) lvmpolld(8) lvmlockd(8) lvmlockctl(8) clvmd(8) cmirrord(8) lvmdbusd(8)

lvmsystemid(7) lvmreport(7) lvmraid(7) lvmthin(7) lvmcache(7)

Red Hat, Inc. LVM TOOLS 2.02.176(2) (2017-11-03) VGCFGRESTORE(8)

vgchange

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
VGCHANGE(8)                                                                                            System Manager's Manual                                                                                           VGCHANGE(8)

NAME
vgchange - Change volume group attributes

SYNOPSIS
vgchange option_args position_args
[ option_args ]
[ position_args ]

-a|--activate y|n|ay
--activationmode partial|degraded|complete
--addtag Tag
--alloc contiguous|cling|cling_by_tags|normal|anywhere|inherit
-A|--autobackup y|n
-c|--clustered y|n
--commandprofile String
--config String
-d|--debug
--deltag Tag
--detachprofile
--driverloaded y|n
-f|--force
-h|--help
-K|--ignoreactivationskip
--ignorelockingfailure
--ignoremonitoring
--ignoreskippedcluster
--lockopt String
--lockstart
--lockstop
--locktype sanlock|dlm|none
-l|--logicalvolume Number
--longhelp
-p|--maxphysicalvolumes Number
--metadataprofile String
--monitor y|n
--noudevsync
-P|--partial
-s|--physicalextentsize Size[m|UNIT]
--poll y|n
--profile String
--pvmetadatacopies 0|1|2
-q|--quiet
--refresh
--reportformat basic|json
-x|--resizeable y|n
-S|--select String
--sysinit
--systemid String
-t|--test
-u|--uuid
-v|--verbose
--version
--[vg]metadatacopies all|unmanaged|Number
-y|--yes

DESCRIPTION
vgchange changes VG attributes, changes LV activation in the kernel, and includes other utilities for VG maintenance.

USAGE
Change a general VG attribute.
For options listed in parentheses, any one is
required, after which the others are optional.

vgchange
( -l|--logicalvolume Number,
-p|--maxphysicalvolumes Number,
-u|--uuid,
-c|--clustered y|n,
-s|--physicalextentsize Size[m|UNIT],
-x|--resizeable y|n,
--addtag Tag,
--deltag Tag,
--alloc contiguous|cling|cling_by_tags|normal|anywhere|inherit,
--pvmetadatacopies 0|1|2,
--[vg]metadatacopies all|unmanaged|Number,
--profile String,
--detachprofile,
--metadataprofile String )
[ -A|--autobackup y|n ]
[ -S|--select String ]
[ -f|--force ]
[ --poll y|n ]
[ --ignoremonitoring ]
[ --ignoreskippedcluster ]
[ --noudevsync ]
[ --reportformat basic|json ]
[ COMMON_OPTIONS ]
[ VG|Tag|Select ... ]
-

Start or stop monitoring LVs from dmeventd.

vgchange --monitor y|n
[ -A|--autobackup y|n ]
[ -S|--select String ]
[ -f|--force ]
[ --sysinit ]
[ --ignorelockingfailure ]
[ --poll y|n ]
[ --ignoremonitoring ]
[ --ignoreskippedcluster ]
[ --noudevsync ]
[ --reportformat basic|json ]
[ COMMON_OPTIONS ]
[ VG|Tag|Select ... ]
-

Start or stop processing LV conversions.

vgchange --poll y|n
[ -A|--autobackup y|n ]
[ -S|--select String ]
[ -f|--force ]
[ --ignorelockingfailure ]
[ --ignoremonitoring ]
[ --ignoreskippedcluster ]
[ --noudevsync ]
[ --reportformat basic|json ]
[ COMMON_OPTIONS ]
[ VG|Tag|Select ... ]
-

Activate or deactivate LVs.

vgchange -a|--activate y|n|ay
[ -K|--ignoreactivationskip ]
[ -P|--partial ]
[ -A|--autobackup y|n ]
[ -S|--select String ]
[ -f|--force ]
[ --activationmode partial|degraded|complete ]
[ --sysinit ]
[ --ignorelockingfailure ]
[ --monitor y|n ]
[ --poll y|n ]
[ --ignoremonitoring ]
[ --ignoreskippedcluster ]
[ --noudevsync ]
[ --reportformat basic|json ]
[ COMMON_OPTIONS ]
[ VG|Tag|Select ... ]
-

Reactivate LVs using the latest metadata.

vgchange --refresh
[ -A|--autobackup y|n ]
[ -S|--select String ]
[ -f|--force ]
[ --sysinit ]
[ --ignorelockingfailure ]
[ --poll y|n ]
[ --ignoremonitoring ]
[ --ignoreskippedcluster ]
[ --noudevsync ]
[ --reportformat basic|json ]
[ COMMON_OPTIONS ]
[ VG|Tag|Select ... ]
-

Change the system ID of a VG.

vgchange --systemid String VG
[ COMMON_OPTIONS ]
-

Start the lockspace of a shared VG in lvmlockd.

vgchange --lockstart
[ -S|--select String ]
[ --lockopt String ]
[ COMMON_OPTIONS ]
[ VG|Tag|Select ... ]
-

Stop the lockspace of a shared VG in lvmlockd.

vgchange --lockstop
[ -S|--select String ]
[ --lockopt String ]
[ COMMON_OPTIONS ]
[ VG|Tag|Select ... ]
-

Change the lock type for a shared VG.

vgchange --locktype sanlock|dlm|none VG
[ --lockopt String ]
[ COMMON_OPTIONS ]
-

Common options for command:

Common options for lvm:
[ -d|--debug ]
[ -h|--help ]
[ -q|--quiet ]
[ -t|--test ]
[ -v|--verbose ]
[ -y|--yes ]
[ --commandprofile String ]
[ --config String ]
[ --driverloaded y|n ]
[ --longhelp ]
[ --profile String ]
[ --version ]

OPTIONS
-a|--activate y|n|ay
Change the active state of LVs. An active LV can be used through a block device, allowing data on the LV to be accessed. y makes LVs active, or available. n makes LVs inactive, or unavailable. The block device
for the LV is added or removed from the system using device-mapper in the kernel. A symbolic link /dev/VGName/LVName pointing to the device node is also added/removed. All software and scripts should access the
device through the symbolic link and present this as the name of the device. The location and name of the underlying device node may depend on the distribution, configuration (e.g. udev), or release version. ay
specifies autoactivation, in which case an LV is activated only if it matches an item in lvm.conf activation/auto_activation_volume_list. If the list is not set, all LVs are considered to match, and if if the list
is set but empty, no LVs match. Autoactivation should be used during system boot to make it possible to select which LVs should be automatically activated by the system. See lvmlockd(8) for more information about
activation options ey and sy for shared VGs. See clvmd(8) for more information about activation options ey, sy, ly and ln for clustered VGs.

--activationmode partial|degraded|complete
Determines if LV activation is allowed when PVs are missing, e.g. because of a device failure. complete only allows LVs with no missing PVs to be activated, and is the most restrictive mode. degraded allows RAID
LVs with missing PVs to be activated. (This does not include the "mirror" type, see "raid1" instead.) partial allows any LV with missing PVs to be activated, and should only be used for recovery or repair. For
default, see lvm.conf/activation_mode. See lvmraid(7) for more information.

--addtag Tag
Adds a tag to a PV, VG or LV. This option can be repeated to add multiple tags at once. See lvm(8) for information about tags.

--alloc contiguous|cling|cling_by_tags|normal|anywhere|inherit
Determines the allocation policy when a command needs to allocate Physical Extents (PEs) from the VG. Each VG and LV has an allocation policy which can be changed with vgchange/lvchange, or overriden on the command
line. normal applies common sense rules such as not placing parallel stripes on the same PV. inherit applies the VG policy to an LV. contiguous requires new PEs be placed adjacent to existing PEs. cling places
new PEs on the same PV as existing PEs in the same stripe of the LV. If there are sufficient PEs for an allocation, but normal does not use them, anywhere will use them even if it reduces performance, e.g. by
placing two stripes on the same PV. Optional positional PV args on the command line can also be used to limit which PVs the command will use for allocation. See lvm(8) for more information about allocation.

-A|--autobackup y|n
Specifies if metadata should be backed up automatically after a change. Enabling this is strongly advised! See vgcfgbackup(8) for more information.

-c|--clustered y|n
Change the clustered property of a VG using clvmd. See clvmd(8) for more information about clustered VGs.

--commandprofile String
The command profile to use for command configuration. See lvm.conf(5) for more information about profiles.

--config String
Config settings for the command. These override lvm.conf settings. The String arg uses the same format as lvm.conf, or may use section/field syntax. See lvm.conf(5) for more information about config.

-d|--debug ...
Set debug level. Repeat from 1 to 6 times to increase the detail of messages sent to the log file and/or syslog (if configured).

--deltag Tag
Deletes a tag from a PV, VG or LV. This option can be repeated to delete multiple tags at once. See lvm(8) for information about tags.

--detachprofile
Detaches a metadata profile from a VG or LV. See lvm.conf(5) for more information about profiles.

--driverloaded y|n
If set to no, the command will not attempt to use device-mapper. For testing and debugging.

-f|--force ...
Override various checks, confirmations and protections. Use with extreme caution.

-h|--help
Display help text.

-K|--ignoreactivationskip
Ignore the "activation skip" LV flag during activation to allow LVs with the flag set to be activated.

--ignorelockingfailure
Allows a command to continue with read-only metadata operations after locking failures.

--ignoremonitoring
Do not interact with dmeventd unless --monitor is specified. Do not use this if dmeventd is already monitoring a device.

--ignoreskippedcluster
Use to avoid exiting with an non-zero status code if the command is run without clustered locking and clustered VGs are skipped.

--lockopt String
Used to pass options for special cases to lvmlockd. See lvmlockd(8) for more information.

--lockstart
Start the lockspace of a shared VG in lvmlockd. lvmlockd locks becomes available for the VG, allowing LVM to use the VG. See lvmlockd(8) for more information.

--lockstop
Stop the lockspace of a shared VG in lvmlockd. lvmlockd locks become unavailable for the VG, preventing LVM from using the VG. See lvmlockd(8) for more information.

--locktype sanlock|dlm|none
Change the VG lock type to or from a shared lock type used with lvmlockd. See lvmlockd(8) for more information.

-l|--logicalvolume Number
Sets the maximum number of LVs allowed in a VG.

--longhelp
Display long help text.

-p|--maxphysicalvolumes Number
Sets the maximum number of PVs that can belong to the VG. The value 0 removes any limitation. For large numbers of PVs, also see options --pvmetadatacopies, and --vgmetadatacopies for improving performance.

--metadataprofile String
The metadata profile to use for command configuration. See lvm.conf(5) for more information about profiles.

--monitor y|n
Start (yes) or stop (no) monitoring an LV with dmeventd. dmeventd monitors kernel events for an LV, and performs automated maintenance for the LV in reponse to specific events. See dmeventd(8) for more informa‐
tion.

--noudevsync
Disables udev synchronisation. The process will not wait for notification from udev. It will continue irrespective of any possible udev processing in the background. Only use this if udev is not running or has
rules that ignore the devices LVM creates.

-P|--partial
Commands will do their best to activate LVs with missing PV extents. Missing extents may be replaced with error or zero segments according to the lvm.conf missing_stripe_filler setting. Metadata may not be
changed with this option.

-s|--physicalextentsize Size[m|UNIT]
Sets the physical extent size of PVs in the VG. The value must be either a power of 2 of at least 1 sector (where the sector size is the largest sector size of the PVs currently used in the VG), or at least
128KiB. Once this value has been set, it is difficult to change without recreating the VG, unless no extents need moving. Before increasing the physical extent size, you might need to use lvresize, pvresize
and/or pvmove so that everything fits. For example, every contiguous range of extents used in a LV must start and end on an extent boundary.

--poll y|n
When yes, start the background transformation of an LV. An incomplete transformation, e.g. pvmove or lvconvert interrupted by reboot or crash, can be restarted from the last checkpoint with --poll y. When no,
background transformation of an LV will not occur, and the transformation will not complete. It may not be appropriate to immediately poll an LV after activation, in which case --poll n can be used to defer polling
until a later --poll y command.

--profile String
An alias for --commandprofile or --metadataprofile, depending on the command.

--pvmetadatacopies 0|1|2
The number of metadata areas to set aside on a PV for storing VG metadata. When 2, one copy of the VG metadata is stored at the front of the PV and a second copy is stored at the end. When 1, one copy of the VG
metadata is stored at the front of the PV (starting in the 5th sector). When 0, no copies of the VG metadata are stored on the given PV. This may be useful in VGs containing many PVs (this places limitations on
the ability to use vgsplit later.)

-q|--quiet ...
Suppress output and log messages. Overrides --debug and --verbose. Repeat once to also suppress any prompts with answer 'no'.

--refresh
If the LV is active, reload its metadata. This is not necessary in normal operation, but may be useful if something has gone wrong, or if some form of manual LV sharing is being used.

--reportformat basic|json
Overrides current output format for reports which is defined globally by the report/output_format setting in lvm.conf. basic is the original format with columns and rows. If there is more than one report per com‐
mand, each report is prefixed with the report name for identification. json produces report output in JSON format. See lvmreport(7) for more information.

-x|--resizeable y|n
Enables or disables the addition or removal of PVs to/from a VG (by vgextend/vgreduce).

-S|--select String
Select objects for processing and reporting based on specified criteria. The criteria syntax is described by --select help and lvmreport(7). For reporting commands, one row is displayed for each object matching
the criteria. See --options help for selectable object fields. Rows can be displayed with an additional "selected" field (-o selected) showing 1 if the row matches the selection and 0 otherwise. For non-report‐
ing commands which process LVM entities, the selection is used to choose items to process.

--sysinit
Indicates that vgchange/lvchange is being invoked from early system initialisation scripts (e.g. rc.sysinit or an initrd), before writable filesystems are available. As such, some functionality needs to be disabled
and this option acts as a shortcut which selects an appropriate set of options. Currently, this is equivalent to using --ignorelockingfailure, --ignoremonitoring, --poll n, and setting env var LVM_SUPPRESS_LOCK‐
ING_FAILURE_MESSAGES. When used in conjunction with lvmetad enabled and running, vgchange/lvchange skip autoactivation, and defer to pvscan autoactivation.

--systemid String
Changes the system ID of the VG. Using this option requires caution because the VG may become foreign to the host running the command, leaving the host unable to access it. See lvmsystemid(7) for more informa‐
tion.

-t|--test
Run in test mode. Commands will not update metadata. This is implemented by disabling all metadata writing but nevertheless returning success to the calling function. This may lead to unusual error messages in
multi-stage operations if a tool relies on reading back metadata it believes has changed but hasn't.

-u|--uuid
Generate new random UUID for specified VGs.

-v|--verbose ...
Set verbose level. Repeat from 1 to 4 times to increase the detail of messages sent to stdout and stderr.

--version
Display version information.

--[vg]metadatacopies all|unmanaged|Number
Number of copies of the VG metadata that are kept. VG metadata is kept in VG metadata areas on PVs in the VG, i.e. reserved space at the start and/or end of the PVs. Keeping a copy of the VG metadata on every PV
can reduce performance in VGs containing a large number of PVs. When this number is set to a non-zero value, LVM will automatically choose PVs on which to store metadata, using the metadataignore flags on PVs to
achieve the specified number. The number can also be replaced with special string values: unmanaged causes LVM to not automatically manage the PV metadataignore flags. all causes LVM to first clear the meta‐
dataignore flags on all PVs, and then to become unmanaged.

-y|--yes
Do not prompt for confirmation interactively but always assume the answer yes. Use with extreme caution. (For automatic no, see -qq.)

VARIABLES
VG
Volume Group name. See lvm(8) for valid names.

Tag
Tag name. See lvm(8) for information about tag names and using tags in place of a VG, LV or PV.

Select
Select indicates that a required positional parameter can be omitted if the --select option is used. No arg appears in this position.

String
See the option description for information about the string content.

Size[UNIT]
Size is an input number that accepts an optional unit. Input units are always treated as base two values, regardless of capitalization, e.g. 'k' and 'K' both refer to 1024. The default input unit is specified by
letter, followed by |UNIT. UNIT represents other possible input units: bBsSkKmMgGtTpPeE. b|B is bytes, s|S is sectors of 512 bytes, k|K is kilobytes, m|M is megabytes, g|G is gigabytes, t|T is terabytes, p|P is
petabytes, e|E is exabytes. (This should not be confused with the output control --units, where capital letters mean multiple of 1000.)

ENVIRONMENT VARIABLES
See lvm(8) for information about environment variables used by lvm. For example, LVM_VG_NAME can generally be substituted for a required VG parameter.

NOTES
If vgchange recognizes COW snapshot LVs that were dropped because they ran out of space, it displays a message informing the administrator that the snapshots should be removed.

EXAMPLES
Activate all LVs in all VGs on all existing devices.
vgchange -a y

Change the maximum number of LVs for an inactive VG.
vgchange -l 128 vg00

SEE ALSO
lvm(8) lvm.conf(5) lvmconfig(8)

pvchange(8) pvck(8) pvcreate(8) pvdisplay(8) pvmove(8) pvremove(8) pvresize(8) pvs(8) pvscan(8)

vgcfgbackup(8) vgcfgrestore(8) vgchange(8) vgck(8) vgcreate(8) vgconvert(8) vgdisplay(8) vgexport(8) vgextend(8) vgimport(8) vgimportclone(8) vgmerge(8) vgmknodes(8) vgreduce(8) vgremove(8) vgrename(8) vgs(8) vgscan(8)
vgsplit(8)

lvcreate(8) lvchange(8) lvconvert(8) lvdisplay(8) lvextend(8) lvreduce(8) lvremove(8) lvrename(8) lvresize(8) lvs(8) lvscan(8)

lvm-fullreport(8) lvm-lvpoll(8) lvm2-activation-generator(8) blkdeactivate(8) lvmdump(8)

dmeventd(8) lvmetad(8) lvmpolld(8) lvmlockd(8) lvmlockctl(8) clvmd(8) cmirrord(8) lvmdbusd(8)

lvmsystemid(7) lvmreport(7) lvmraid(7) lvmthin(7) lvmcache(7)

Red Hat, Inc. LVM TOOLS 2.02.176(2) (2017-11-03) VGCHANGE(8)

vgck

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
VGCK(8)                                                                                                System Manager's Manual                                                                                               VGCK(8)

NAME
vgck - Check the consistency of volume group(s)

SYNOPSIS
vgck
[ option_args ]
[ position_args ]

DESCRIPTION
vgck checks LVM metadata for consistency.

USAGE
vgck
[ --reportformat basic|json ]
[ COMMON_OPTIONS ]
[ VG|Tag ... ]

Common options for lvm:
[ -d|--debug ]
[ -h|--help ]
[ -q|--quiet ]
[ -t|--test ]
[ -v|--verbose ]
[ -y|--yes ]
[ --commandprofile String ]
[ --config String ]
[ --driverloaded y|n ]
[ --longhelp ]
[ --profile String ]
[ --version ]

OPTIONS
--commandprofile String
The command profile to use for command configuration. See lvm.conf(5) for more information about profiles.

--config String
Config settings for the command. These override lvm.conf settings. The String arg uses the same format as lvm.conf, or may use section/field syntax. See lvm.conf(5) for more information about config.

-d|--debug ...
Set debug level. Repeat from 1 to 6 times to increase the detail of messages sent to the log file and/or syslog (if configured).

--driverloaded y|n
If set to no, the command will not attempt to use device-mapper. For testing and debugging.

-h|--help
Display help text.

--longhelp
Display long help text.

--profile String
An alias for --commandprofile or --metadataprofile, depending on the command.

-q|--quiet ...
Suppress output and log messages. Overrides --debug and --verbose. Repeat once to also suppress any prompts with answer 'no'.

--reportformat basic|json
Overrides current output format for reports which is defined globally by the report/output_format setting in lvm.conf. basic is the original format with columns and rows. If there is more than one report per com‐
mand, each report is prefixed with the report name for identification. json produces report output in JSON format. See lvmreport(7) for more information.

-t|--test
Run in test mode. Commands will not update metadata. This is implemented by disabling all metadata writing but nevertheless returning success to the calling function. This may lead to unusual error messages in
multi-stage operations if a tool relies on reading back metadata it believes has changed but hasn't.

-v|--verbose ...
Set verbose level. Repeat from 1 to 4 times to increase the detail of messages sent to stdout and stderr.

--version
Display version information.

-y|--yes
Do not prompt for confirmation interactively but always assume the answer yes. Use with extreme caution. (For automatic no, see -qq.)

VARIABLES
VG
Volume Group name. See lvm(8) for valid names.

Tag
Tag name. See lvm(8) for information about tag names and using tags in place of a VG, LV or PV.

String
See the option description for information about the string content.

Size[UNIT]
Size is an input number that accepts an optional unit. Input units are always treated as base two values, regardless of capitalization, e.g. 'k' and 'K' both refer to 1024. The default input unit is specified by
letter, followed by |UNIT. UNIT represents other possible input units: bBsSkKmMgGtTpPeE. b|B is bytes, s|S is sectors of 512 bytes, k|K is kilobytes, m|M is megabytes, g|G is gigabytes, t|T is terabytes, p|P is
petabytes, e|E is exabytes. (This should not be confused with the output control --units, where capital letters mean multiple of 1000.)

ENVIRONMENT VARIABLES
See lvm(8) for information about environment variables used by lvm. For example, LVM_VG_NAME can generally be substituted for a required VG parameter.

SEE ALSO
lvm(8) lvm.conf(5) lvmconfig(8)

pvchange(8) pvck(8) pvcreate(8) pvdisplay(8) pvmove(8) pvremove(8) pvresize(8) pvs(8) pvscan(8)

vgcfgbackup(8) vgcfgrestore(8) vgchange(8) vgck(8) vgcreate(8) vgconvert(8) vgdisplay(8) vgexport(8) vgextend(8) vgimport(8) vgimportclone(8) vgmerge(8) vgmknodes(8) vgreduce(8) vgremove(8) vgrename(8) vgs(8) vgscan(8)
vgsplit(8)

lvcreate(8) lvchange(8) lvconvert(8) lvdisplay(8) lvextend(8) lvreduce(8) lvremove(8) lvrename(8) lvresize(8) lvs(8) lvscan(8)

lvm-fullreport(8) lvm-lvpoll(8) lvm2-activation-generator(8) blkdeactivate(8) lvmdump(8)

dmeventd(8) lvmetad(8) lvmpolld(8) lvmlockd(8) lvmlockctl(8) clvmd(8) cmirrord(8) lvmdbusd(8)

lvmsystemid(7) lvmreport(7) lvmraid(7) lvmthin(7) lvmcache(7)

Red Hat, Inc. LVM TOOLS 2.02.176(2) (2017-11-03) VGCK(8)

vgconvert

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
VGCONVERT(8)                                                                                           System Manager's Manual                                                                                          VGCONVERT(8)

NAME
vgconvert - Change volume group metadata format

SYNOPSIS
vgconvert position_args
[ option_args ]

DESCRIPTION
vgconvert converts VG metadata from one format to another. The new metadata format must be able to fit into the space provided by the old format.

Because the LVM1 format should no longer be used, this command is no longer needed in general.

USAGE
vgconvert VG ...
[ -f|--force ]
[ -M|--metadatatype lvm2|lvm1 ]
[ --labelsector Number ]
[ --bootloaderareasize Size[m|UNIT] ]
[ --pvmetadatacopies 0|1|2 ]
[ --metadatasize Size[m|UNIT] ]
[ --reportformat basic|json ]
[ COMMON_OPTIONS ]

Common options for lvm:
[ -d|--debug ]
[ -h|--help ]
[ -q|--quiet ]
[ -t|--test ]
[ -v|--verbose ]
[ -y|--yes ]
[ --commandprofile String ]
[ --config String ]
[ --driverloaded y|n ]
[ --longhelp ]
[ --profile String ]
[ --version ]

OPTIONS
--bootloaderareasize Size[m|UNIT]
Create a separate bootloader area of specified size besides PV's data area. The bootloader area is an area of reserved space on the PV from which LVM will not allocate any extents and it's kept untouched. This is
primarily aimed for use with bootloaders to embed their own data or metadata. The start of the bootloader area is always aligned, see also --dataalignment and --dataalignmentoffset. The bootloader area size may
eventually end up increased due to the alignment, but it's never less than the size that is requested. To see the bootloader area start and size of an existing PV use pvs -o +pv_ba_start,pv_ba_size.

--commandprofile String
The command profile to use for command configuration. See lvm.conf(5) for more information about profiles.

--config String
Config settings for the command. These override lvm.conf settings. The String arg uses the same format as lvm.conf, or may use section/field syntax. See lvm.conf(5) for more information about config.

-d|--debug ...
Set debug level. Repeat from 1 to 6 times to increase the detail of messages sent to the log file and/or syslog (if configured).

--driverloaded y|n
If set to no, the command will not attempt to use device-mapper. For testing and debugging.

-f|--force ...
Override various checks, confirmations and protections. Use with extreme caution.

-h|--help
Display help text.

--labelsector Number
By default the PV is labelled with an LVM2 identifier in its second sector (sector 1). This lets you use a different sector near the start of the disk (between 0 and 3 inclusive - see LABEL_SCAN_SECTORS in the
source). Use with care.

--longhelp
Display long help text.

--metadatasize Size[m|UNIT]
The approximate amount of space used for each VG metadata area. The size may be rounded.

-M|--metadatatype lvm2|lvm1
Specifies the type of on-disk metadata to use. lvm2 (or just 2) is the current, standard format. lvm1 (or just 1) is a historical format that can be used for accessing old data.

--profile String
An alias for --commandprofile or --metadataprofile, depending on the command.

--pvmetadatacopies 0|1|2
The number of metadata areas to set aside on a PV for storing VG metadata. When 2, one copy of the VG metadata is stored at the front of the PV and a second copy is stored at the end. When 1, one copy of the VG
metadata is stored at the front of the PV (starting in the 5th sector). When 0, no copies of the VG metadata are stored on the given PV. This may be useful in VGs containing many PVs (this places limitations on
the ability to use vgsplit later.)

-q|--quiet ...
Suppress output and log messages. Overrides --debug and --verbose. Repeat once to also suppress any prompts with answer 'no'.

--reportformat basic|json
Overrides current output format for reports which is defined globally by the report/output_format setting in lvm.conf. basic is the original format with columns and rows. If there is more than one report per com‐
mand, each report is prefixed with the report name for identification. json produces report output in JSON format. See lvmreport(7) for more information.

-t|--test
Run in test mode. Commands will not update metadata. This is implemented by disabling all metadata writing but nevertheless returning success to the calling function. This may lead to unusual error messages in
multi-stage operations if a tool relies on reading back metadata it believes has changed but hasn't.

-v|--verbose ...
Set verbose level. Repeat from 1 to 4 times to increase the detail of messages sent to stdout and stderr.

--version
Display version information.

-y|--yes
Do not prompt for confirmation interactively but always assume the answer yes. Use with extreme caution. (For automatic no, see -qq.)

VARIABLES
VG
Volume Group name. See lvm(8) for valid names.

String
See the option description for information about the string content.

Size[UNIT]
Size is an input number that accepts an optional unit. Input units are always treated as base two values, regardless of capitalization, e.g. 'k' and 'K' both refer to 1024. The default input unit is specified by
letter, followed by |UNIT. UNIT represents other possible input units: bBsSkKmMgGtTpPeE. b|B is bytes, s|S is sectors of 512 bytes, k|K is kilobytes, m|M is megabytes, g|G is gigabytes, t|T is terabytes, p|P is
petabytes, e|E is exabytes. (This should not be confused with the output control --units, where capital letters mean multiple of 1000.)

ENVIRONMENT VARIABLES
See lvm(8) for information about environment variables used by lvm. For example, LVM_VG_NAME can generally be substituted for a required VG parameter.

SEE ALSO
lvm(8) lvm.conf(5) lvmconfig(8)

pvchange(8) pvck(8) pvcreate(8) pvdisplay(8) pvmove(8) pvremove(8) pvresize(8) pvs(8) pvscan(8)

vgcfgbackup(8) vgcfgrestore(8) vgchange(8) vgck(8) vgcreate(8) vgconvert(8) vgdisplay(8) vgexport(8) vgextend(8) vgimport(8) vgimportclone(8) vgmerge(8) vgmknodes(8) vgreduce(8) vgremove(8) vgrename(8) vgs(8) vgscan(8)
vgsplit(8)

lvcreate(8) lvchange(8) lvconvert(8) lvdisplay(8) lvextend(8) lvreduce(8) lvremove(8) lvrename(8) lvresize(8) lvs(8) lvscan(8)

lvm-fullreport(8) lvm-lvpoll(8) lvm2-activation-generator(8) blkdeactivate(8) lvmdump(8)

dmeventd(8) lvmetad(8) lvmpolld(8) lvmlockd(8) lvmlockctl(8) clvmd(8) cmirrord(8) lvmdbusd(8)

lvmsystemid(7) lvmreport(7) lvmraid(7) lvmthin(7) lvmcache(7)

Red Hat, Inc. LVM TOOLS 2.02.176(2) (2017-11-03) VGCONVERT(8)

vgcreate

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
VGCREATE(8)                                                                                            System Manager's Manual                                                                                           VGCREATE(8)

NAME
vgcreate - Create a volume group

SYNOPSIS
vgcreate position_args
[ option_args ]

DESCRIPTION
vgcreate creates a new VG on block devices. If the devices were not previously intialized as PVs with pvcreate(8), vgcreate will inititialize them, making them PVs. The pvcreate options for initializing devices are also
available with vgcreate.

USAGE
vgcreate VG_new PV ...
[ -A|--autobackup y|n ]
[ -c|--clustered y|n ]
[ -l|--maxlogicalvolumes Number ]
[ -p|--maxphysicalvolumes Number ]
[ -M|--metadatatype lvm2|lvm1 ]
[ -s|--physicalextentsize Size[m|UNIT] ]
[ -f|--force ]
[ -Z|--zero y|n ]
[ --addtag Tag ]
[ --alloc contiguous|cling|cling_by_tags|normal|anywhere|inherit ]
[ --metadataprofile String ]
[ --labelsector Number ]
[ --metadatasize Size[m|UNIT] ]
[ --pvmetadatacopies 0|1|2 ]
[ --[vg]metadatacopies all|unmanaged|Number ]
[ --reportformat basic|json ]
[ --dataalignment Size[k|UNIT] ]
[ --dataalignmentoffset Size[k|UNIT] ]
[ --shared ]
[ --systemid String ]
[ --locktype sanlock|dlm|none ]
[ --lockopt String ]
[ COMMON_OPTIONS ]

Common options for lvm:
[ -d|--debug ]
[ -h|--help ]
[ -q|--quiet ]
[ -t|--test ]
[ -v|--verbose ]
[ -y|--yes ]
[ --commandprofile String ]
[ --config String ]
[ --driverloaded y|n ]
[ --longhelp ]
[ --profile String ]
[ --version ]

OPTIONS
--addtag Tag
Adds a tag to a PV, VG or LV. This option can be repeated to add multiple tags at once. See lvm(8) for information about tags.

--alloc contiguous|cling|cling_by_tags|normal|anywhere|inherit
Determines the allocation policy when a command needs to allocate Physical Extents (PEs) from the VG. Each VG and LV has an allocation policy which can be changed with vgchange/lvchange, or overriden on the command
line. normal applies common sense rules such as not placing parallel stripes on the same PV. inherit applies the VG policy to an LV. contiguous requires new PEs be placed adjacent to existing PEs. cling places
new PEs on the same PV as existing PEs in the same stripe of the LV. If there are sufficient PEs for an allocation, but normal does not use them, anywhere will use them even if it reduces performance, e.g. by
placing two stripes on the same PV. Optional positional PV args on the command line can also be used to limit which PVs the command will use for allocation. See lvm(8) for more information about allocation.

-A|--autobackup y|n
Specifies if metadata should be backed up automatically after a change. Enabling this is strongly advised! See vgcfgbackup(8) for more information.

-c|--clustered y|n
Create a clustered VG using clvmd if LVM is compiled with cluster support. This allows multiple hosts to share a VG on shared devices. clvmd and a lock manager must be configured and running. (A clustered VG
using clvmd is different from a shared VG using lvmlockd.) See clvmd(8) for more information about clustered VGs.

--commandprofile String
The command profile to use for command configuration. See lvm.conf(5) for more information about profiles.

--config String
Config settings for the command. These override lvm.conf settings. The String arg uses the same format as lvm.conf, or may use section/field syntax. See lvm.conf(5) for more information about config.

--dataalignment Size[k|UNIT]
Align the start of the data to a multiple of this number. Also specify an appropriate Physical Extent size when creating a VG. To see the location of the first Physical Extent of an existing PV, use pvs -o
+pe_start. In addition, it may be shifted by an alignment offset. See lvm.conf/data_alignment_offset_detection and --dataalignmentoffset.

--dataalignmentoffset Size[k|UNIT]
Shift the start of the data area by this additional offset.

-d|--debug ...
Set debug level. Repeat from 1 to 6 times to increase the detail of messages sent to the log file and/or syslog (if configured).

--driverloaded y|n
If set to no, the command will not attempt to use device-mapper. For testing and debugging.

-f|--force ...
Override various checks, confirmations and protections. Use with extreme caution.

-h|--help
Display help text.

--labelsector Number
By default the PV is labelled with an LVM2 identifier in its second sector (sector 1). This lets you use a different sector near the start of the disk (between 0 and 3 inclusive - see LABEL_SCAN_SECTORS in the
source). Use with care.

--lockopt String
Used to pass options for special cases to lvmlockd. See lvmlockd(8) for more information.

--locktype sanlock|dlm|none
Specify the VG lock type directly in place of using --shared. See lvmlockd(8) for more information.

--longhelp
Display long help text.

-l|--maxlogicalvolumes Number
Sets the maximum number of LVs allowed in a VG.

-p|--maxphysicalvolumes Number
Sets the maximum number of PVs that can belong to the VG. The value 0 removes any limitation. For large numbers of PVs, also see options --pvmetadatacopies, and --vgmetadatacopies for improving performance.

--metadataprofile String
The metadata profile to use for command configuration. See lvm.conf(5) for more information about profiles.

--metadatasize Size[m|UNIT]
The approximate amount of space used for each VG metadata area. The size may be rounded.

-M|--metadatatype lvm2|lvm1
Specifies the type of on-disk metadata to use. lvm2 (or just 2) is the current, standard format. lvm1 (or just 1) is a historical format that can be used for accessing old data.

-s|--physicalextentsize Size[m|UNIT]
Sets the physical extent size of PVs in the VG. The value must be either a power of 2 of at least 1 sector (where the sector size is the largest sector size of the PVs currently used in the VG), or at least
128KiB. Once this value has been set, it is difficult to change without recreating the VG, unless no extents need moving.

--profile String
An alias for --commandprofile or --metadataprofile, depending on the command.

--pvmetadatacopies 0|1|2
The number of metadata areas to set aside on a PV for storing VG metadata. When 2, one copy of the VG metadata is stored at the front of the PV and a second copy is stored at the end. When 1, one copy of the VG
metadata is stored at the front of the PV (starting in the 5th sector). When 0, no copies of the VG metadata are stored on the given PV. This may be useful in VGs containing many PVs (this places limitations on
the ability to use vgsplit later.)

-q|--quiet ...
Suppress output and log messages. Overrides --debug and --verbose. Repeat once to also suppress any prompts with answer 'no'.

--reportformat basic|json
Overrides current output format for reports which is defined globally by the report/output_format setting in lvm.conf. basic is the original format with columns and rows. If there is more than one report per com‐
mand, each report is prefixed with the report name for identification. json produces report output in JSON format. See lvmreport(7) for more information.

--shared
Create a shared VG using lvmlockd if LVM is compiled with lockd support. lvmlockd will select lock type sanlock or dlm depending on which lock manager is running. This allows multiple hosts to share a VG on shared
devices. lvmlockd and a lock manager must be configured and running. (A shared VG using lvmlockd is different from a clustered VG using clvmd.) See lvmlockd(8) for more information about shared VGs.

--systemid String
Specifies the system ID that will be given to the new VG, overriding the system ID of the host running the command. A VG is normally created without this option, in which case the new VG is given the system ID of
the host creating it. Using this option requires caution because the system ID of the new VG may not match the system ID of the host running the command, leaving the VG inaccessible to the host. See lvmsystemid(7)
for more information.

-t|--test
Run in test mode. Commands will not update metadata. This is implemented by disabling all metadata writing but nevertheless returning success to the calling function. This may lead to unusual error messages in
multi-stage operations if a tool relies on reading back metadata it believes has changed but hasn't.

-v|--verbose ...
Set verbose level. Repeat from 1 to 4 times to increase the detail of messages sent to stdout and stderr.

--version
Display version information.

--[vg]metadatacopies all|unmanaged|Number
Number of copies of the VG metadata that are kept. VG metadata is kept in VG metadata areas on PVs in the VG, i.e. reserved space at the start and/or end of the PVs. Keeping a copy of the VG metadata on every PV
can reduce performance in VGs containing a large number of PVs. When this number is set to a non-zero value, LVM will automatically choose PVs on which to store metadata, using the metadataignore flags on PVs to
achieve the specified number. The number can also be replaced with special string values: unmanaged causes LVM to not automatically manage the PV metadataignore flags. all causes LVM to first clear the meta‐
dataignore flags on all PVs, and then to become unmanaged.

-y|--yes
Do not prompt for confirmation interactively but always assume the answer yes. Use with extreme caution. (For automatic no, see -qq.)

-Z|--zero y|n
Controls if the first 4 sectors (2048 bytes) of the device are wiped. The default is to wipe these sectors unless either or both of --restorefile or --uuid are specified.

VARIABLES
VG
Volume Group name. See lvm(8) for valid names.

PV
Physical Volume name, a device path under /dev. For commands managing physical extents, a PV positional arg generally accepts a suffix indicating a range (or multiple ranges) of physical extents (PEs). When the
first PE is omitted, it defaults to the start of the device, and when the last PE is omitted it defaults to end. Start and end range (inclusive): PV[:PE-PE]... Start and length range (counting from 0):
PV[:PE+PE]...

String
See the option description for information about the string content.

Size[UNIT]
Size is an input number that accepts an optional unit. Input units are always treated as base two values, regardless of capitalization, e.g. 'k' and 'K' both refer to 1024. The default input unit is specified by
letter, followed by |UNIT. UNIT represents other possible input units: bBsSkKmMgGtTpPeE. b|B is bytes, s|S is sectors of 512 bytes, k|K is kilobytes, m|M is megabytes, g|G is gigabytes, t|T is terabytes, p|P is
petabytes, e|E is exabytes. (This should not be confused with the output control --units, where capital letters mean multiple of 1000.)

ENVIRONMENT VARIABLES
See lvm(8) for information about environment variables used by lvm. For example, LVM_VG_NAME can generally be substituted for a required VG parameter.

EXAMPLES
Create a VG with two PVs, using the default physical extent size.
vgcreate myvg /dev/sdk1 /dev/sdl1

SEE ALSO
lvm(8) lvm.conf(5) lvmconfig(8)

pvchange(8) pvck(8) pvcreate(8) pvdisplay(8) pvmove(8) pvremove(8) pvresize(8) pvs(8) pvscan(8)

vgcfgbackup(8) vgcfgrestore(8) vgchange(8) vgck(8) vgcreate(8) vgconvert(8) vgdisplay(8) vgexport(8) vgextend(8) vgimport(8) vgimportclone(8) vgmerge(8) vgmknodes(8) vgreduce(8) vgremove(8) vgrename(8) vgs(8) vgscan(8)
vgsplit(8)

lvcreate(8) lvchange(8) lvconvert(8) lvdisplay(8) lvextend(8) lvreduce(8) lvremove(8) lvrename(8) lvresize(8) lvs(8) lvscan(8)

lvm-fullreport(8) lvm-lvpoll(8) lvm2-activation-generator(8) blkdeactivate(8) lvmdump(8)

dmeventd(8) lvmetad(8) lvmpolld(8) lvmlockd(8) lvmlockctl(8) clvmd(8) cmirrord(8) lvmdbusd(8)

lvmsystemid(7) lvmreport(7) lvmraid(7) lvmthin(7) lvmcache(7)

Red Hat, Inc. LVM TOOLS 2.02.176(2) (2017-11-03) VGCREATE(8)

vgdisplay

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
VGDISPLAY(8)                                                                                           System Manager's Manual                                                                                          VGDISPLAY(8)

NAME
vgdisplay - Display volume group information

SYNOPSIS
vgdisplay
[ option_args ]
[ position_args ]

DESCRIPTION
vgdisplay shows the attributes of VGs, and the associated PVs and LVs.

vgs(8) is a preferred alternative that shows the same information and more, using a more compact and configurable output format.

USAGE
vgdisplay
[ -A|--activevolumegroups ]
[ -c|--colon ]
[ -C|--columns ]
[ -o|--options String ]
[ -S|--select String ]
[ -s|--short ]
[ -O|--sort String ]
[ --aligned ]
[ --binary ]
[ --configreport log|vg|lv|pv|pvseg|seg ]
[ --foreign ]
[ --ignorelockingfailure ]
[ --ignoreskippedcluster ]
[ --logonly ]
[ --noheadings ]
[ --nosuffix ]
[ --readonly ]
[ --reportformat basic|json ]
[ --shared ]
[ --separator String ]
[ --unbuffered ]
[ --units r|R|h|H|b|B|s|S|k|K|m|M|g|G|t|T|p|P|e|E ]
[ COMMON_OPTIONS ]
[ VG|Tag ... ]

Common options for lvm:
[ -d|--debug ]
[ -h|--help ]
[ -q|--quiet ]
[ -t|--test ]
[ -v|--verbose ]
[ -y|--yes ]
[ --commandprofile String ]
[ --config String ]
[ --driverloaded y|n ]
[ --longhelp ]
[ --profile String ]
[ --version ]

OPTIONS
-A|--activevolumegroups
Only select active VGs. The VG is considered active if at least one of its LVs is active.

--aligned
Use with --separator to align the output columns

--binary
Use binary values "0" or "1" instead of descriptive literal values for columns that have exactly two valid values to report (not counting the "unknown" value which denotes that the value could not be determined).

-c|--colon
Generate colon separated output for easier parsing in scripts or programs. Also see vgs(8) which provides considerably more control over the output.

-C|--columns
Display output in columns, the equivalent of vgs(8). Options listed are the same as options given in vgs(8).

--commandprofile String
The command profile to use for command configuration. See lvm.conf(5) for more information about profiles.

--config String
Config settings for the command. These override lvm.conf settings. The String arg uses the same format as lvm.conf, or may use section/field syntax. See lvm.conf(5) for more information about config.

--configreport log|vg|lv|pv|pvseg|seg
See lvmreport(7).

-d|--debug ...
Set debug level. Repeat from 1 to 6 times to increase the detail of messages sent to the log file and/or syslog (if configured).

--driverloaded y|n
If set to no, the command will not attempt to use device-mapper. For testing and debugging.

--foreign
Report/display foreign VGs that would otherwise be skipped. See lvmsystemid(7) for more information about foreign VGs.

-h|--help
Display help text.

--ignorelockingfailure
Allows a command to continue with read-only metadata operations after locking failures.

--ignoreskippedcluster
Use to avoid exiting with an non-zero status code if the command is run without clustered locking and clustered VGs are skipped.

--logonly
Suppress command report and display only log report.

--longhelp
Display long help text.

--noheadings
Suppress the headings line that is normally the first line of output. Useful if grepping the output.

--nosuffix
Suppress the suffix on output sizes. Use with --units (except h and H) if processing the output.

-o|--options String
Comma-separated, ordered list of fields to display in columns. String arg syntax is: [+|-|#]Field1[,Field2 ...] The prefix + will append the specified fields to the default fields, - will remove the specified
fields from the default fields, and # will compact specified fields (removing them when empty for all rows.) Use -o help to view the list of all available fields. Use separate lists of fields to add, remove or
compact by repeating the -o option: -o+field1,field2 -o-field3,field4 -o#field5. These lists are evaluated from left to right. Use field name lv_all to view all LV fields, vg_all all VG fields, pv_all all PV
fields, pvseg_all all PV segment fields, seg_all all LV segment fields, and pvseg_all all PV segment columns. See the lvm.conf report section for more config options. See lvmreport(7) for more information about
reporting.

--profile String
An alias for --commandprofile or --metadataprofile, depending on the command.

-q|--quiet ...
Suppress output and log messages. Overrides --debug and --verbose. Repeat once to also suppress any prompts with answer 'no'.

--readonly
Run the command in a special read-only mode which will read on-disk metadata without needing to take any locks. This can be used to peek inside metadata used by a virtual machine image while the virtual machine is
running. It can also be used to peek inside the metadata of clustered VGs when clustered locking is not configured or running. No attempt will be made to communicate with the device-mapper kernel driver, so this
option is unable to report whether or not LVs are actually in use.

--reportformat basic|json
Overrides current output format for reports which is defined globally by the report/output_format setting in lvm.conf. basic is the original format with columns and rows. If there is more than one report per com‐
mand, each report is prefixed with the report name for identification. json produces report output in JSON format. See lvmreport(7) for more information.

-S|--select String
Select objects for processing and reporting based on specified criteria. The criteria syntax is described by --select help and lvmreport(7). For reporting commands, one row is displayed for each object matching
the criteria. See --options help for selectable object fields. Rows can be displayed with an additional "selected" field (-o selected) showing 1 if the row matches the selection and 0 otherwise. For non-report‐
ing commands which process LVM entities, the selection is used to choose items to process.

--separator String
String to use to separate each column. Useful if grepping the output.

--shared
Report/display shared VGs that would otherwise be skipped when lvmlockd is not being used on the host. See lvmlockd(8) for more information about shared VGs.

-s|--short
Give a short listing showing the existence of VGs.

-O|--sort String
Comma-separated ordered list of columns to sort by. Replaces the default selection. Precede any column with - for a reverse sort on that column.

-t|--test
Run in test mode. Commands will not update metadata. This is implemented by disabling all metadata writing but nevertheless returning success to the calling function. This may lead to unusual error messages in
multi-stage operations if a tool relies on reading back metadata it believes has changed but hasn't.

--unbuffered
Produce output immediately without sorting or aligning the columns properly.

--units r|R|h|H|b|B|s|S|k|K|m|M|g|G|t|T|p|P|e|E
All sizes are output in these units: human-(r)eadable with '<' rounding indicator, (h)uman-readable, (b)ytes, (s)ectors, (k)ilobytes, (m)egabytes, (g)igabytes, (t)erabytes, (p)etabytes, (e)xabytes. Capitalise to
use multiples of 1000 (S.I.) instead of 1024. Custom units can be specified, e.g. --units 3M.

-v|--verbose ...
Set verbose level. Repeat from 1 to 4 times to increase the detail of messages sent to stdout and stderr.

--version
Display version information.

-y|--yes
Do not prompt for confirmation interactively but always assume the answer yes. Use with extreme caution. (For automatic no, see -qq.)

VARIABLES
VG
Volume Group name. See lvm(8) for valid names.

Tag
Tag name. See lvm(8) for information about tag names and using tags in place of a VG, LV or PV.

String
See the option description for information about the string content.

Size[UNIT]
Size is an input number that accepts an optional unit. Input units are always treated as base two values, regardless of capitalization, e.g. 'k' and 'K' both refer to 1024. The default input unit is specified by
letter, followed by |UNIT. UNIT represents other possible input units: bBsSkKmMgGtTpPeE. b|B is bytes, s|S is sectors of 512 bytes, k|K is kilobytes, m|M is megabytes, g|G is gigabytes, t|T is terabytes, p|P is
petabytes, e|E is exabytes. (This should not be confused with the output control --units, where capital letters mean multiple of 1000.)

ENVIRONMENT VARIABLES
See lvm(8) for information about environment variables used by lvm. For example, LVM_VG_NAME can generally be substituted for a required VG parameter.

SEE ALSO
lvm(8) lvm.conf(5) lvmconfig(8)

pvchange(8) pvck(8) pvcreate(8) pvdisplay(8) pvmove(8) pvremove(8) pvresize(8) pvs(8) pvscan(8)

vgcfgbackup(8) vgcfgrestore(8) vgchange(8) vgck(8) vgcreate(8) vgconvert(8) vgdisplay(8) vgexport(8) vgextend(8) vgimport(8) vgimportclone(8) vgmerge(8) vgmknodes(8) vgreduce(8) vgremove(8) vgrename(8) vgs(8) vgscan(8)
vgsplit(8)

lvcreate(8) lvchange(8) lvconvert(8) lvdisplay(8) lvextend(8) lvreduce(8) lvremove(8) lvrename(8) lvresize(8) lvs(8) lvscan(8)

lvm-fullreport(8) lvm-lvpoll(8) lvm2-activation-generator(8) blkdeactivate(8) lvmdump(8)

dmeventd(8) lvmetad(8) lvmpolld(8) lvmlockd(8) lvmlockctl(8) clvmd(8) cmirrord(8) lvmdbusd(8)

lvmsystemid(7) lvmreport(7) lvmraid(7) lvmthin(7) lvmcache(7)

Red Hat, Inc. LVM TOOLS 2.02.176(2) (2017-11-03) VGDISPLAY(8)

vgexport

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
VGEXPORT(8)                                                                                            System Manager's Manual                                                                                           VGEXPORT(8)

NAME
vgexport - Unregister volume group(s) from the system

SYNOPSIS
vgexport option_args position_args
[ option_args ]

DESCRIPTION
vgexport makes inactive VGs unknown to the system. In this state, all the PVs in the VG can be moved to a different system, from which vgimport(8) can then be run.

Most LVM tools ignore exported VGs.

vgexport clears the VG system ID, and vgimport sets the VG system ID to match the host running vgimport (if the host has a system ID).

USAGE
Export specified VGs.

vgexport VG|Tag|Select ...
[ -S|--select String ]
[ COMMON_OPTIONS ]

Export all VGs.

vgexport -a|--all
[ COMMON_OPTIONS ]

Common options for command:
[ --reportformat basic|json ]

Common options for lvm:
[ -d|--debug ]
[ -h|--help ]
[ -q|--quiet ]
[ -t|--test ]
[ -v|--verbose ]
[ -y|--yes ]
[ --commandprofile String ]
[ --config String ]
[ --driverloaded y|n ]
[ --longhelp ]
[ --profile String ]
[ --version ]

OPTIONS
-a|--all

--commandprofile String
The command profile to use for command configuration. See lvm.conf(5) for more information about profiles.

--config String
Config settings for the command. These override lvm.conf settings. The String arg uses the same format as lvm.conf, or may use section/field syntax. See lvm.conf(5) for more information about config.

-d|--debug ...
Set debug level. Repeat from 1 to 6 times to increase the detail of messages sent to the log file and/or syslog (if configured).

--driverloaded y|n
If set to no, the command will not attempt to use device-mapper. For testing and debugging.

-h|--help
Display help text.

--longhelp
Display long help text.

--profile String
An alias for --commandprofile or --metadataprofile, depending on the command.

-q|--quiet ...
Suppress output and log messages. Overrides --debug and --verbose. Repeat once to also suppress any prompts with answer 'no'.

--reportformat basic|json
Overrides current output format for reports which is defined globally by the report/output_format setting in lvm.conf. basic is the original format with columns and rows. If there is more than one report per com‐
mand, each report is prefixed with the report name for identification. json produces report output in JSON format. See lvmreport(7) for more information.

-S|--select String
Select objects for processing and reporting based on specified criteria. The criteria syntax is described by --select help and lvmreport(7). For reporting commands, one row is displayed for each object matching
the criteria. See --options help for selectable object fields. Rows can be displayed with an additional "selected" field (-o selected) showing 1 if the row matches the selection and 0 otherwise. For non-report‐
ing commands which process LVM entities, the selection is used to choose items to process.

-t|--test
Run in test mode. Commands will not update metadata. This is implemented by disabling all metadata writing but nevertheless returning success to the calling function. This may lead to unusual error messages in
multi-stage operations if a tool relies on reading back metadata it believes has changed but hasn't.

-v|--verbose ...
Set verbose level. Repeat from 1 to 4 times to increase the detail of messages sent to stdout and stderr.

--version
Display version information.

-y|--yes
Do not prompt for confirmation interactively but always assume the answer yes. Use with extreme caution. (For automatic no, see -qq.)

VARIABLES
VG
Volume Group name. See lvm(8) for valid names.

Tag
Tag name. See lvm(8) for information about tag names and using tags in place of a VG, LV or PV.

Select
Select indicates that a required positional parameter can be omitted if the --select option is used. No arg appears in this position.

String
See the option description for information about the string content.

Size[UNIT]
Size is an input number that accepts an optional unit. Input units are always treated as base two values, regardless of capitalization, e.g. 'k' and 'K' both refer to 1024. The default input unit is specified by
letter, followed by |UNIT. UNIT represents other possible input units: bBsSkKmMgGtTpPeE. b|B is bytes, s|S is sectors of 512 bytes, k|K is kilobytes, m|M is megabytes, g|G is gigabytes, t|T is terabytes, p|P is
petabytes, e|E is exabytes. (This should not be confused with the output control --units, where capital letters mean multiple of 1000.)

ENVIRONMENT VARIABLES
See lvm(8) for information about environment variables used by lvm. For example, LVM_VG_NAME can generally be substituted for a required VG parameter.

SEE ALSO
lvm(8) lvm.conf(5) lvmconfig(8)

pvchange(8) pvck(8) pvcreate(8) pvdisplay(8) pvmove(8) pvremove(8) pvresize(8) pvs(8) pvscan(8)

vgcfgbackup(8) vgcfgrestore(8) vgchange(8) vgck(8) vgcreate(8) vgconvert(8) vgdisplay(8) vgexport(8) vgextend(8) vgimport(8) vgimportclone(8) vgmerge(8) vgmknodes(8) vgreduce(8) vgremove(8) vgrename(8) vgs(8) vgscan(8)
vgsplit(8)

lvcreate(8) lvchange(8) lvconvert(8) lvdisplay(8) lvextend(8) lvreduce(8) lvremove(8) lvrename(8) lvresize(8) lvs(8) lvscan(8)

lvm-fullreport(8) lvm-lvpoll(8) lvm2-activation-generator(8) blkdeactivate(8) lvmdump(8)

dmeventd(8) lvmetad(8) lvmpolld(8) lvmlockd(8) lvmlockctl(8) clvmd(8) cmirrord(8) lvmdbusd(8)

lvmsystemid(7) lvmreport(7) lvmraid(7) lvmthin(7) lvmcache(7)

Red Hat, Inc. LVM TOOLS 2.02.176(2) (2017-11-03) VGEXPORT(8)

vgextend

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
VGEXTEND(8)                                                                                            System Manager's Manual                                                                                           VGEXTEND(8)

NAME
vgextend - Add physical volumes to a volume group

SYNOPSIS
vgextend position_args
[ option_args ]

DESCRIPTION
vgextend adds one or more PVs to a VG. This increases the space available for LVs in the VG.

Also, PVs that have gone missing and then returned, e.g. due to a transient device failure, can be added back to the VG without re-initializing them (see --restoremissing).

If the specified PVs have not yet been initialized with pvcreate, vgextend will initialize them. In this case pvcreate options can be used, e.g. --labelsector, --metadatasize, --metadataignore, --pvmetadatacopies,
--dataalignment, --dataalignmentoffset.

USAGE
vgextend VG PV ...
[ -A|--autobackup y|n ]
[ -f|--force ]
[ -Z|--zero y|n ]
[ -M|--metadatatype lvm2|lvm1 ]
[ --labelsector Number ]
[ --metadatasize Size[m|UNIT] ]
[ --pvmetadatacopies 0|1|2 ]
[ --metadataignore y|n ]
[ --dataalignment Size[k|UNIT] ]
[ --dataalignmentoffset Size[k|UNIT] ]
[ --reportformat basic|json ]
[ --restoremissing ]
[ COMMON_OPTIONS ]

Common options for lvm:
[ -d|--debug ]
[ -h|--help ]
[ -q|--quiet ]
[ -t|--test ]
[ -v|--verbose ]
[ -y|--yes ]
[ --commandprofile String ]
[ --config String ]
[ --driverloaded y|n ]
[ --longhelp ]
[ --profile String ]
[ --version ]

OPTIONS
-A|--autobackup y|n
Specifies if metadata should be backed up automatically after a change. Enabling this is strongly advised! See vgcfgbackup(8) for more information.

--commandprofile String
The command profile to use for command configuration. See lvm.conf(5) for more information about profiles.

--config String
Config settings for the command. These override lvm.conf settings. The String arg uses the same format as lvm.conf, or may use section/field syntax. See lvm.conf(5) for more information about config.

--dataalignment Size[k|UNIT]
Align the start of the data to a multiple of this number. Also specify an appropriate Physical Extent size when creating a VG. To see the location of the first Physical Extent of an existing PV, use pvs -o
+pe_start. In addition, it may be shifted by an alignment offset. See lvm.conf/data_alignment_offset_detection and --dataalignmentoffset.

--dataalignmentoffset Size[k|UNIT]
Shift the start of the data area by this additional offset.

-d|--debug ...
Set debug level. Repeat from 1 to 6 times to increase the detail of messages sent to the log file and/or syslog (if configured).

--driverloaded y|n
If set to no, the command will not attempt to use device-mapper. For testing and debugging.

-f|--force ...
Override various checks, confirmations and protections. Use with extreme caution.

-h|--help
Display help text.

--labelsector Number
By default the PV is labelled with an LVM2 identifier in its second sector (sector 1). This lets you use a different sector near the start of the disk (between 0 and 3 inclusive - see LABEL_SCAN_SECTORS in the
source). Use with care.

--longhelp
Display long help text.

--metadataignore y|n
Specifies the metadataignore property of a PV. If yes, metadata areas on the PV are ignored, and lvm will not store metadata in the metadata areas of the PV. If no, lvm will store metadata on the PV.

--metadatasize Size[m|UNIT]
The approximate amount of space used for each VG metadata area. The size may be rounded.

-M|--metadatatype lvm2|lvm1
Specifies the type of on-disk metadata to use. lvm2 (or just 2) is the current, standard format. lvm1 (or just 1) is a historical format that can be used for accessing old data.

--profile String
An alias for --commandprofile or --metadataprofile, depending on the command.

--pvmetadatacopies 0|1|2
The number of metadata areas to set aside on a PV for storing VG metadata. When 2, one copy of the VG metadata is stored at the front of the PV and a second copy is stored at the end. When 1, one copy of the VG
metadata is stored at the front of the PV (starting in the 5th sector). When 0, no copies of the VG metadata are stored on the given PV. This may be useful in VGs containing many PVs (this places limitations on
the ability to use vgsplit later.)

-q|--quiet ...
Suppress output and log messages. Overrides --debug and --verbose. Repeat once to also suppress any prompts with answer 'no'.

--reportformat basic|json
Overrides current output format for reports which is defined globally by the report/output_format setting in lvm.conf. basic is the original format with columns and rows. If there is more than one report per com‐
mand, each report is prefixed with the report name for identification. json produces report output in JSON format. See lvmreport(7) for more information.

--restoremissing
Add a PV back into a VG after the PV was missing and then returned, e.g. due to a transient failure. The PV is not reinitialized.

-t|--test
Run in test mode. Commands will not update metadata. This is implemented by disabling all metadata writing but nevertheless returning success to the calling function. This may lead to unusual error messages in
multi-stage operations if a tool relies on reading back metadata it believes has changed but hasn't.

-v|--verbose ...
Set verbose level. Repeat from 1 to 4 times to increase the detail of messages sent to stdout and stderr.

--version
Display version information.

-y|--yes
Do not prompt for confirmation interactively but always assume the answer yes. Use with extreme caution. (For automatic no, see -qq.)

-Z|--zero y|n
Controls if the first 4 sectors (2048 bytes) of the device are wiped. The default is to wipe these sectors unless either or both of --restorefile or --uuid are specified.

VARIABLES
VG
Volume Group name. See lvm(8) for valid names.

PV
Physical Volume name, a device path under /dev. For commands managing physical extents, a PV positional arg generally accepts a suffix indicating a range (or multiple ranges) of physical extents (PEs). When the
first PE is omitted, it defaults to the start of the device, and when the last PE is omitted it defaults to end. Start and end range (inclusive): PV[:PE-PE]... Start and length range (counting from 0):
PV[:PE+PE]...

String
See the option description for information about the string content.

Size[UNIT]
Size is an input number that accepts an optional unit. Input units are always treated as base two values, regardless of capitalization, e.g. 'k' and 'K' both refer to 1024. The default input unit is specified by
letter, followed by |UNIT. UNIT represents other possible input units: bBsSkKmMgGtTpPeE. b|B is bytes, s|S is sectors of 512 bytes, k|K is kilobytes, m|M is megabytes, g|G is gigabytes, t|T is terabytes, p|P is
petabytes, e|E is exabytes. (This should not be confused with the output control --units, where capital letters mean multiple of 1000.)

ENVIRONMENT VARIABLES
See lvm(8) for information about environment variables used by lvm. For example, LVM_VG_NAME can generally be substituted for a required VG parameter.

EXAMPLES
Add two PVs to a VG.
vgextend vg00 /dev/sda4 /dev/sdn1

SEE ALSO
lvm(8) lvm.conf(5) lvmconfig(8)

pvchange(8) pvck(8) pvcreate(8) pvdisplay(8) pvmove(8) pvremove(8) pvresize(8) pvs(8) pvscan(8)

vgcfgbackup(8) vgcfgrestore(8) vgchange(8) vgck(8) vgcreate(8) vgconvert(8) vgdisplay(8) vgexport(8) vgextend(8) vgimport(8) vgimportclone(8) vgmerge(8) vgmknodes(8) vgreduce(8) vgremove(8) vgrename(8) vgs(8) vgscan(8)
vgsplit(8)

lvcreate(8) lvchange(8) lvconvert(8) lvdisplay(8) lvextend(8) lvreduce(8) lvremove(8) lvrename(8) lvresize(8) lvs(8) lvscan(8)

lvm-fullreport(8) lvm-lvpoll(8) lvm2-activation-generator(8) blkdeactivate(8) lvmdump(8)

dmeventd(8) lvmetad(8) lvmpolld(8) lvmlockd(8) lvmlockctl(8) clvmd(8) cmirrord(8) lvmdbusd(8)

lvmsystemid(7) lvmreport(7) lvmraid(7) lvmthin(7) lvmcache(7)

Red Hat, Inc. LVM TOOLS 2.02.176(2) (2017-11-03) VGEXTEND(8)

vgimport

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
VGIMPORT(8)                                                                                            System Manager's Manual                                                                                           VGIMPORT(8)

NAME
vgimport - Register exported volume group with system

SYNOPSIS
vgimport option_args position_args
[ option_args ]

DESCRIPTION
vgimport makes exported VGs known to the system again, perhaps after moving the PVs from a different system.

vgexport clears the VG system ID, and vgimport sets the VG system ID to match the host running vgimport (if the host has a system ID).

USAGE
Import specified VGs.

vgimport VG|Tag|Select ...
[ -S|--select String ]
[ COMMON_OPTIONS ]

Import all VGs.

vgimport -a|--all
[ COMMON_OPTIONS ]

Common options for command:
[ -f|--force ]
[ --reportformat basic|json ]

Common options for lvm:
[ -d|--debug ]
[ -h|--help ]
[ -q|--quiet ]
[ -t|--test ]
[ -v|--verbose ]
[ -y|--yes ]
[ --commandprofile String ]
[ --config String ]
[ --driverloaded y|n ]
[ --longhelp ]
[ --profile String ]
[ --version ]

OPTIONS
-a|--all
Import all visible VGs.

--commandprofile String
The command profile to use for command configuration. See lvm.conf(5) for more information about profiles.

--config String
Config settings for the command. These override lvm.conf settings. The String arg uses the same format as lvm.conf, or may use section/field syntax. See lvm.conf(5) for more information about config.

-d|--debug ...
Set debug level. Repeat from 1 to 6 times to increase the detail of messages sent to the log file and/or syslog (if configured).

--driverloaded y|n
If set to no, the command will not attempt to use device-mapper. For testing and debugging.

-f|--force ...
Override various checks, confirmations and protections. Use with extreme caution.

-h|--help
Display help text.

--longhelp
Display long help text.

--profile String
An alias for --commandprofile or --metadataprofile, depending on the command.

-q|--quiet ...
Suppress output and log messages. Overrides --debug and --verbose. Repeat once to also suppress any prompts with answer 'no'.

--reportformat basic|json
Overrides current output format for reports which is defined globally by the report/output_format setting in lvm.conf. basic is the original format with columns and rows. If there is more than one report per com‐
mand, each report is prefixed with the report name for identification. json produces report output in JSON format. See lvmreport(7) for more information.

-S|--select String
Select objects for processing and reporting based on specified criteria. The criteria syntax is described by --select help and lvmreport(7). For reporting commands, one row is displayed for each object matching
the criteria. See --options help for selectable object fields. Rows can be displayed with an additional "selected" field (-o selected) showing 1 if the row matches the selection and 0 otherwise. For non-report‐
ing commands which process LVM entities, the selection is used to choose items to process.

-t|--test
Run in test mode. Commands will not update metadata. This is implemented by disabling all metadata writing but nevertheless returning success to the calling function. This may lead to unusual error messages in
multi-stage operations if a tool relies on reading back metadata it believes has changed but hasn't.

-v|--verbose ...
Set verbose level. Repeat from 1 to 4 times to increase the detail of messages sent to stdout and stderr.

--version
Display version information.

-y|--yes
Do not prompt for confirmation interactively but always assume the answer yes. Use with extreme caution. (For automatic no, see -qq.)

VARIABLES
VG
Volume Group name. See lvm(8) for valid names.

Tag
Tag name. See lvm(8) for information about tag names and using tags in place of a VG, LV or PV.

Select
Select indicates that a required positional parameter can be omitted if the --select option is used. No arg appears in this position.

String
See the option description for information about the string content.

Size[UNIT]
Size is an input number that accepts an optional unit. Input units are always treated as base two values, regardless of capitalization, e.g. 'k' and 'K' both refer to 1024. The default input unit is specified by
letter, followed by |UNIT. UNIT represents other possible input units: bBsSkKmMgGtTpPeE. b|B is bytes, s|S is sectors of 512 bytes, k|K is kilobytes, m|M is megabytes, g|G is gigabytes, t|T is terabytes, p|P is
petabytes, e|E is exabytes. (This should not be confused with the output control --units, where capital letters mean multiple of 1000.)

ENVIRONMENT VARIABLES
See lvm(8) for information about environment variables used by lvm. For example, LVM_VG_NAME can generally be substituted for a required VG parameter.

SEE ALSO
lvm(8) lvm.conf(5) lvmconfig(8)

pvchange(8) pvck(8) pvcreate(8) pvdisplay(8) pvmove(8) pvremove(8) pvresize(8) pvs(8) pvscan(8)

vgcfgbackup(8) vgcfgrestore(8) vgchange(8) vgck(8) vgcreate(8) vgconvert(8) vgdisplay(8) vgexport(8) vgextend(8) vgimport(8) vgimportclone(8) vgmerge(8) vgmknodes(8) vgreduce(8) vgremove(8) vgrename(8) vgs(8) vgscan(8)
vgsplit(8)

lvcreate(8) lvchange(8) lvconvert(8) lvdisplay(8) lvextend(8) lvreduce(8) lvremove(8) lvrename(8) lvresize(8) lvs(8) lvscan(8)

lvm-fullreport(8) lvm-lvpoll(8) lvm2-activation-generator(8) blkdeactivate(8) lvmdump(8)

dmeventd(8) lvmetad(8) lvmpolld(8) lvmlockd(8) lvmlockctl(8) clvmd(8) cmirrord(8) lvmdbusd(8)

lvmsystemid(7) lvmreport(7) lvmraid(7) lvmthin(7) lvmcache(7)

Red Hat, Inc. LVM TOOLS 2.02.176(2) (2017-11-03) VGIMPORT(8)

vgimportclone

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
VGIMPORTCLONE(8)                                                                                       System Manager's Manual                                                                                      VGIMPORTCLONE(8)

NAME
vgimportclone - Import a VG from cloned PVs

SYNOPSIS
vgimportclone position_args
[ option_args ]

DESCRIPTION
vgimportclone imports a VG from duplicated PVs, e.g. created by a hardware snapshot of existing PVs.

A duplicated VG cannot used until it is made to coexist with the original VG. vgimportclone renames the VG associated with the specified PVs and changes the associated VG and PV UUIDs.

USAGE
vgimportclone PV ...
[ -n|--basevgname VG ]
[ -i|--import ]
[ COMMON_OPTIONS ]

Common options for lvm:
[ -d|--debug ]
[ -h|--help ]
[ -q|--quiet ]
[ -t|--test ]
[ -v|--verbose ]
[ -y|--yes ]
[ --commandprofile String ]
[ --config String ]
[ --driverloaded y|n ]
[ --longhelp ]
[ --profile String ]
[ --version ]

OPTIONS
-n|--basevgname String
By default the snapshot VG will be renamed to the original name plus a numeric suffix to avoid duplicate naming (e.g. 'test_vg' would be renamed to 'test_vg1'). This option will override the base VG name that is
used for all VG renames. If a VG already exists with the specified name a numeric suffix will be added (like the previous example) to make it unique.

--commandprofile String
The command profile to use for command configuration. See lvm.conf(5) for more information about profiles.

--config String
Config settings for the command. These override lvm.conf settings. The String arg uses the same format as lvm.conf, or may use section/field syntax. See lvm.conf(5) for more information about config.

-d|--debug ...
Set debug level. Repeat from 1 to 6 times to increase the detail of messages sent to the log file and/or syslog (if configured).

--driverloaded y|n
If set to no, the command will not attempt to use device-mapper. For testing and debugging.

-h|--help
Display help text.

-i|--import
Import exported VGs. Otherwise VGs that have been exported will not be changed (nor will their associated PVs).

--longhelp
Display long help text.

--profile String
An alias for --commandprofile or --metadataprofile, depending on the command.

-q|--quiet ...
Suppress output and log messages. Overrides --debug and --verbose. Repeat once to also suppress any prompts with answer 'no'.

-t|--test
Run in test mode. Commands will not update metadata. This is implemented by disabling all metadata writing but nevertheless returning success to the calling function. This may lead to unusual error messages in
multi-stage operations if a tool relies on reading back metadata it believes has changed but hasn't.

-v|--verbose ...
Set verbose level. Repeat from 1 to 4 times to increase the detail of messages sent to stdout and stderr.

--version
Display version information.

-y|--yes
Do not prompt for confirmation interactively but always assume the answer yes. Use with extreme caution. (For automatic no, see -qq.)

VARIABLES
PV
Physical Volume name, a device path under /dev. For commands managing physical extents, a PV positional arg generally accepts a suffix indicating a range (or multiple ranges) of physical extents (PEs). When the
first PE is omitted, it defaults to the start of the device, and when the last PE is omitted it defaults to end. Start and end range (inclusive): PV[:PE-PE]... Start and length range (counting from 0):
PV[:PE+PE]...

String
See the option description for information about the string content.

Size[UNIT]
Size is an input number that accepts an optional unit. Input units are always treated as base two values, regardless of capitalization, e.g. 'k' and 'K' both refer to 1024. The default input unit is specified by
letter, followed by |UNIT. UNIT represents other possible input units: bBsSkKmMgGtTpPeE. b|B is bytes, s|S is sectors of 512 bytes, k|K is kilobytes, m|M is megabytes, g|G is gigabytes, t|T is terabytes, p|P is
petabytes, e|E is exabytes. (This should not be confused with the output control --units, where capital letters mean multiple of 1000.)

ENVIRONMENT VARIABLES
See lvm(8) for information about environment variables used by lvm. For example, LVM_VG_NAME can generally be substituted for a required VG parameter.

EXAMPLES
An original VG "vg00" has PVs "/dev/sda" and "/dev/sdb". The corresponding PVs from a hardware snapshot are "/dev/sdc" and "/dev/sdd". Rename the VG associated with "/dev/sdc" and "/dev/sdd" from "vg00" to "vg00_snap"
(and change associated UUIDs).
vgimportclone --basevgname vg00_snap /dev/sdc /dev/sdd

SEE ALSO
lvm(8) lvm.conf(5) lvmconfig(8)

pvchange(8) pvck(8) pvcreate(8) pvdisplay(8) pvmove(8) pvremove(8) pvresize(8) pvs(8) pvscan(8)

vgcfgbackup(8) vgcfgrestore(8) vgchange(8) vgck(8) vgcreate(8) vgconvert(8) vgdisplay(8) vgexport(8) vgextend(8) vgimport(8) vgimportclone(8) vgmerge(8) vgmknodes(8) vgreduce(8) vgremove(8) vgrename(8) vgs(8) vgscan(8)
vgsplit(8)

lvcreate(8) lvchange(8) lvconvert(8) lvdisplay(8) lvextend(8) lvreduce(8) lvremove(8) lvrename(8) lvresize(8) lvs(8) lvscan(8)

lvm-fullreport(8) lvm-lvpoll(8) lvm2-activation-generator(8) blkdeactivate(8) lvmdump(8)

dmeventd(8) lvmetad(8) lvmpolld(8) lvmlockd(8) lvmlockctl(8) clvmd(8) cmirrord(8) lvmdbusd(8)

lvmsystemid(7) lvmreport(7) lvmraid(7) lvmthin(7) lvmcache(7)

Red Hat, Inc. LVM TOOLS 2.02.176(2) (2017-11-03) VGIMPORTCLONE(8)

vgmerge

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
VGMERGE(8)                                                                                             System Manager's Manual                                                                                            VGMERGE(8)

NAME
vgmerge - Merge volume groups

SYNOPSIS
vgmerge position_args
[ option_args ]

DESCRIPTION
vgmerge merges two existing VGs. The inactive source VG is merged into the destination VG if physical extent sizes are equal and PV and LV summaries of both VGs fit into the destination VG's limits.

USAGE
vgmerge VG VG
[ -A|--autobackup y|n ]
[ -l|--list ]
[ COMMON_OPTIONS ]

Common options for lvm:
[ -d|--debug ]
[ -h|--help ]
[ -q|--quiet ]
[ -t|--test ]
[ -v|--verbose ]
[ -y|--yes ]
[ --commandprofile String ]
[ --config String ]
[ --driverloaded y|n ]
[ --longhelp ]
[ --profile String ]
[ --version ]

OPTIONS
-A|--autobackup y|n
Specifies if metadata should be backed up automatically after a change. Enabling this is strongly advised! See vgcfgbackup(8) for more information.

--commandprofile String
The command profile to use for command configuration. See lvm.conf(5) for more information about profiles.

--config String
Config settings for the command. These override lvm.conf settings. The String arg uses the same format as lvm.conf, or may use section/field syntax. See lvm.conf(5) for more information about config.

-d|--debug ...
Set debug level. Repeat from 1 to 6 times to increase the detail of messages sent to the log file and/or syslog (if configured).

--driverloaded y|n
If set to no, the command will not attempt to use device-mapper. For testing and debugging.

-h|--help
Display help text.

-l|--list
Display merged destination VG like vgdisplay -v.

--longhelp
Display long help text.

--profile String
An alias for --commandprofile or --metadataprofile, depending on the command.

-q|--quiet ...
Suppress output and log messages. Overrides --debug and --verbose. Repeat once to also suppress any prompts with answer 'no'.

-t|--test
Run in test mode. Commands will not update metadata. This is implemented by disabling all metadata writing but nevertheless returning success to the calling function. This may lead to unusual error messages in
multi-stage operations if a tool relies on reading back metadata it believes has changed but hasn't.

-v|--verbose ...
Set verbose level. Repeat from 1 to 4 times to increase the detail of messages sent to stdout and stderr.

--version
Display version information.

-y|--yes
Do not prompt for confirmation interactively but always assume the answer yes. Use with extreme caution. (For automatic no, see -qq.)

VARIABLES
VG
Volume Group name. See lvm(8) for valid names.

String
See the option description for information about the string content.

Size[UNIT]
Size is an input number that accepts an optional unit. Input units are always treated as base two values, regardless of capitalization, e.g. 'k' and 'K' both refer to 1024. The default input unit is specified by
letter, followed by |UNIT. UNIT represents other possible input units: bBsSkKmMgGtTpPeE. b|B is bytes, s|S is sectors of 512 bytes, k|K is kilobytes, m|M is megabytes, g|G is gigabytes, t|T is terabytes, p|P is
petabytes, e|E is exabytes. (This should not be confused with the output control --units, where capital letters mean multiple of 1000.)

ENVIRONMENT VARIABLES
See lvm(8) for information about environment variables used by lvm. For example, LVM_VG_NAME can generally be substituted for a required VG parameter.

EXAMPLES
Merge an inactive VG named "vg00" into the active or inactive VG named "databases", giving verbose runtime information.
vgmerge -v databases vg00

SEE ALSO
lvm(8) lvm.conf(5) lvmconfig(8)

pvchange(8) pvck(8) pvcreate(8) pvdisplay(8) pvmove(8) pvremove(8) pvresize(8) pvs(8) pvscan(8)

vgcfgbackup(8) vgcfgrestore(8) vgchange(8) vgck(8) vgcreate(8) vgconvert(8) vgdisplay(8) vgexport(8) vgextend(8) vgimport(8) vgimportclone(8) vgmerge(8) vgmknodes(8) vgreduce(8) vgremove(8) vgrename(8) vgs(8) vgscan(8)
vgsplit(8)

lvcreate(8) lvchange(8) lvconvert(8) lvdisplay(8) lvextend(8) lvreduce(8) lvremove(8) lvrename(8) lvresize(8) lvs(8) lvscan(8)

lvm-fullreport(8) lvm-lvpoll(8) lvm2-activation-generator(8) blkdeactivate(8) lvmdump(8)

dmeventd(8) lvmetad(8) lvmpolld(8) lvmlockd(8) lvmlockctl(8) clvmd(8) cmirrord(8) lvmdbusd(8)

lvmsystemid(7) lvmreport(7) lvmraid(7) lvmthin(7) lvmcache(7)

Red Hat, Inc. LVM TOOLS 2.02.176(2) (2017-11-03) VGMERGE(8)

vgmknodes

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
VGMKNODES(8)                                                                                           System Manager's Manual                                                                                          VGMKNODES(8)

NAME
vgmknodes - Create the special files for volume group devices in /dev

SYNOPSIS
vgmknodes
[ option_args ]
[ position_args ]

DESCRIPTION
vgmknodes checks the LVM device nodes in /dev that are needed for active LVs and creates any that are missing and removes unused ones.

This command should not usually be needed if all the system components are interoperating correctly.

USAGE
vgmknodes
[ --ignorelockingfailure ]
[ --refresh ]
[ --reportformat basic|json ]
[ COMMON_OPTIONS ]
[ VG|LV|Tag ... ]

Common options for lvm:
[ -d|--debug ]
[ -h|--help ]
[ -q|--quiet ]
[ -t|--test ]
[ -v|--verbose ]
[ -y|--yes ]
[ --commandprofile String ]
[ --config String ]
[ --driverloaded y|n ]
[ --longhelp ]
[ --profile String ]
[ --version ]

OPTIONS
--commandprofile String
The command profile to use for command configuration. See lvm.conf(5) for more information about profiles.

--config String
Config settings for the command. These override lvm.conf settings. The String arg uses the same format as lvm.conf, or may use section/field syntax. See lvm.conf(5) for more information about config.

-d|--debug ...
Set debug level. Repeat from 1 to 6 times to increase the detail of messages sent to the log file and/or syslog (if configured).

--driverloaded y|n
If set to no, the command will not attempt to use device-mapper. For testing and debugging.

-h|--help
Display help text.

--ignorelockingfailure
Allows a command to continue with read-only metadata operations after locking failures.

--longhelp
Display long help text.

--profile String
An alias for --commandprofile or --metadataprofile, depending on the command.

-q|--quiet ...
Suppress output and log messages. Overrides --debug and --verbose. Repeat once to also suppress any prompts with answer 'no'.

--refresh
If the LV is active, reload its metadata. This is not necessary in normal operation, but may be useful if something has gone wrong, or if some form of manual LV sharing is being used.

--reportformat basic|json
Overrides current output format for reports which is defined globally by the report/output_format setting in lvm.conf. basic is the original format with columns and rows. If there is more than one report per com‐
mand, each report is prefixed with the report name for identification. json produces report output in JSON format. See lvmreport(7) for more information.

-t|--test
Run in test mode. Commands will not update metadata. This is implemented by disabling all metadata writing but nevertheless returning success to the calling function. This may lead to unusual error messages in
multi-stage operations if a tool relies on reading back metadata it believes has changed but hasn't.

-v|--verbose ...
Set verbose level. Repeat from 1 to 4 times to increase the detail of messages sent to stdout and stderr.

--version
Display version information.

-y|--yes
Do not prompt for confirmation interactively but always assume the answer yes. Use with extreme caution. (For automatic no, see -qq.)

VARIABLES
VG
Volume Group name. See lvm(8) for valid names.

LV
Logical Volume name. See lvm(8) for valid names. An LV positional arg generally includes the VG name and LV name, e.g. VG/LV.

Tag
Tag name. See lvm(8) for information about tag names and using tags in place of a VG, LV or PV.

String
See the option description for information about the string content.

Size[UNIT]
Size is an input number that accepts an optional unit. Input units are always treated as base two values, regardless of capitalization, e.g. 'k' and 'K' both refer to 1024. The default input unit is specified by
letter, followed by |UNIT. UNIT represents other possible input units: bBsSkKmMgGtTpPeE. b|B is bytes, s|S is sectors of 512 bytes, k|K is kilobytes, m|M is megabytes, g|G is gigabytes, t|T is terabytes, p|P is
petabytes, e|E is exabytes. (This should not be confused with the output control --units, where capital letters mean multiple of 1000.)

ENVIRONMENT VARIABLES
See lvm(8) for information about environment variables used by lvm. For example, LVM_VG_NAME can generally be substituted for a required VG parameter.

SEE ALSO
lvm(8) lvm.conf(5) lvmconfig(8)

pvchange(8) pvck(8) pvcreate(8) pvdisplay(8) pvmove(8) pvremove(8) pvresize(8) pvs(8) pvscan(8)

vgcfgbackup(8) vgcfgrestore(8) vgchange(8) vgck(8) vgcreate(8) vgconvert(8) vgdisplay(8) vgexport(8) vgextend(8) vgimport(8) vgimportclone(8) vgmerge(8) vgmknodes(8) vgreduce(8) vgremove(8) vgrename(8) vgs(8) vgscan(8)
vgsplit(8)

lvcreate(8) lvchange(8) lvconvert(8) lvdisplay(8) lvextend(8) lvreduce(8) lvremove(8) lvrename(8) lvresize(8) lvs(8) lvscan(8)

lvm-fullreport(8) lvm-lvpoll(8) lvm2-activation-generator(8) blkdeactivate(8) lvmdump(8)

dmeventd(8) lvmetad(8) lvmpolld(8) lvmlockd(8) lvmlockctl(8) clvmd(8) cmirrord(8) lvmdbusd(8)

lvmsystemid(7) lvmreport(7) lvmraid(7) lvmthin(7) lvmcache(7)

Red Hat, Inc. LVM TOOLS 2.02.176(2) (2017-11-03) VGMKNODES(8)

vgreduce

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
VGREDUCE(8)                                                                                            System Manager's Manual                                                                                           VGREDUCE(8)

NAME
vgreduce - Remove physical volume(s) from a volume group

SYNOPSIS
vgreduce option_args position_args
[ option_args ]

-a|--all
-A|--autobackup y|n
--commandprofile String
--config String
-d|--debug
--driverloaded y|n
-f|--force
-h|--help
--longhelp
--mirrorsonly
--profile String
-q|--quiet
--removemissing
--reportformat basic|json
-t|--test
-v|--verbose
--version
-y|--yes

DESCRIPTION
vgreduce removes one or more unused PVs from a VG.

USAGE
Remove a PV from a VG.

vgreduce VG PV ...
[ COMMON_OPTIONS ]
-

Remove all unused PVs from a VG.

vgreduce -a|--all VG
[ COMMON_OPTIONS ]
-

Remove all missing PVs from a VG.

vgreduce --removemissing VG
[ --mirrorsonly ]
[ COMMON_OPTIONS ]
-

Common options for command:
[ -A|--autobackup y|n ]
[ -f|--force ]
[ --reportformat basic|json ]

Common options for lvm:
[ -d|--debug ]
[ -h|--help ]
[ -q|--quiet ]
[ -t|--test ]
[ -v|--verbose ]
[ -y|--yes ]
[ --commandprofile String ]
[ --config String ]
[ --driverloaded y|n ]
[ --longhelp ]
[ --profile String ]
[ --version ]

OPTIONS
-a|--all
Removes all empty PVs if none are named on the command line.

-A|--autobackup y|n
Specifies if metadata should be backed up automatically after a change. Enabling this is strongly advised! See vgcfgbackup(8) for more information.

--commandprofile String
The command profile to use for command configuration. See lvm.conf(5) for more information about profiles.

--config String
Config settings for the command. These override lvm.conf settings. The String arg uses the same format as lvm.conf, or may use section/field syntax. See lvm.conf(5) for more information about config.

-d|--debug ...
Set debug level. Repeat from 1 to 6 times to increase the detail of messages sent to the log file and/or syslog (if configured).

--driverloaded y|n
If set to no, the command will not attempt to use device-mapper. For testing and debugging.

-f|--force ...
Override various checks, confirmations and protections. Use with extreme caution.

-h|--help
Display help text.

--longhelp
Display long help text.

--mirrorsonly
Only remove missing PVs from mirror LVs.

--profile String
An alias for --commandprofile or --metadataprofile, depending on the command.

-q|--quiet ...
Suppress output and log messages. Overrides --debug and --verbose. Repeat once to also suppress any prompts with answer 'no'.

--removemissing
Removes all missing PVs from the VG, if there are no LVs allocated on them. This resumes normal operation of the VG (new LVs may again be created, changed and so on). If this is not possible because LVs are refer‐
encing the missing PVs, this option can be combined with --force to have the command remove any partial LVs. In this case, any LVs and dependent snapshots that were partly on the missing disks are removed com‐
pletely, including those parts on disks that are still present. If LVs spanned several disks, including ones that are lost, salvaging some data first may be possible by activating LVs in partial mode.

--reportformat basic|json
Overrides current output format for reports which is defined globally by the report/output_format setting in lvm.conf. basic is the original format with columns and rows. If there is more than one report per com‐
mand, each report is prefixed with the report name for identification. json produces report output in JSON format. See lvmreport(7) for more information.

-t|--test
Run in test mode. Commands will not update metadata. This is implemented by disabling all metadata writing but nevertheless returning success to the calling function. This may lead to unusual error messages in
multi-stage operations if a tool relies on reading back metadata it believes has changed but hasn't.

-v|--verbose ...
Set verbose level. Repeat from 1 to 4 times to increase the detail of messages sent to stdout and stderr.

--version
Display version information.

-y|--yes
Do not prompt for confirmation interactively but always assume the answer yes. Use with extreme caution. (For automatic no, see -qq.)

VARIABLES
VG
Volume Group name. See lvm(8) for valid names.

PV
Physical Volume name, a device path under /dev. For commands managing physical extents, a PV positional arg generally accepts a suffix indicating a range (or multiple ranges) of physical extents (PEs). When the
first PE is omitted, it defaults to the start of the device, and when the last PE is omitted it defaults to end. Start and end range (inclusive): PV[:PE-PE]... Start and length range (counting from 0):
PV[:PE+PE]...

String
See the option description for information about the string content.

Size[UNIT]
Size is an input number that accepts an optional unit. Input units are always treated as base two values, regardless of capitalization, e.g. 'k' and 'K' both refer to 1024. The default input unit is specified by
letter, followed by |UNIT. UNIT represents other possible input units: bBsSkKmMgGtTpPeE. b|B is bytes, s|S is sectors of 512 bytes, k|K is kilobytes, m|M is megabytes, g|G is gigabytes, t|T is terabytes, p|P is
petabytes, e|E is exabytes. (This should not be confused with the output control --units, where capital letters mean multiple of 1000.)

ENVIRONMENT VARIABLES
See lvm(8) for information about environment variables used by lvm. For example, LVM_VG_NAME can generally be substituted for a required VG parameter.

SEE ALSO
lvm(8) lvm.conf(5) lvmconfig(8)

pvchange(8) pvck(8) pvcreate(8) pvdisplay(8) pvmove(8) pvremove(8) pvresize(8) pvs(8) pvscan(8)

vgcfgbackup(8) vgcfgrestore(8) vgchange(8) vgck(8) vgcreate(8) vgconvert(8) vgdisplay(8) vgexport(8) vgextend(8) vgimport(8) vgimportclone(8) vgmerge(8) vgmknodes(8) vgreduce(8) vgremove(8) vgrename(8) vgs(8) vgscan(8)
vgsplit(8)

lvcreate(8) lvchange(8) lvconvert(8) lvdisplay(8) lvextend(8) lvreduce(8) lvremove(8) lvrename(8) lvresize(8) lvs(8) lvscan(8)

lvm-fullreport(8) lvm-lvpoll(8) lvm2-activation-generator(8) blkdeactivate(8) lvmdump(8)

dmeventd(8) lvmetad(8) lvmpolld(8) lvmlockd(8) lvmlockctl(8) clvmd(8) cmirrord(8) lvmdbusd(8)

lvmsystemid(7) lvmreport(7) lvmraid(7) lvmthin(7) lvmcache(7)

Red Hat, Inc. LVM TOOLS 2.02.176(2) (2017-11-03) VGREDUCE(8)

vgremove

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
VGREMOVE(8)                                                                                            System Manager's Manual                                                                                           VGREMOVE(8)

NAME
vgremove - Remove volume group(s)

SYNOPSIS
vgremove position_args
[ option_args ]

DESCRIPTION
vgremove removes one or more VGs. If LVs exist in the VG, a prompt is used to confirm LV removal.

If one or more PVs in the VG are lost, consider vgreduce --removemissing to make the VG metadata consistent again.

Repeat the force option (-ff) to forcibly remove LVs in the VG without confirmation.

USAGE
vgremove VG|Tag|Select ...
[ -f|--force ]
[ -S|--select String ]
[ --noudevsync ]
[ --reportformat basic|json ]
[ COMMON_OPTIONS ]

Common options for lvm:
[ -d|--debug ]
[ -h|--help ]
[ -q|--quiet ]
[ -t|--test ]
[ -v|--verbose ]
[ -y|--yes ]
[ --commandprofile String ]
[ --config String ]
[ --driverloaded y|n ]
[ --longhelp ]
[ --profile String ]
[ --version ]

OPTIONS
--commandprofile String
The command profile to use for command configuration. See lvm.conf(5) for more information about profiles.

--config String
Config settings for the command. These override lvm.conf settings. The String arg uses the same format as lvm.conf, or may use section/field syntax. See lvm.conf(5) for more information about config.

-d|--debug ...
Set debug level. Repeat from 1 to 6 times to increase the detail of messages sent to the log file and/or syslog (if configured).

--driverloaded y|n
If set to no, the command will not attempt to use device-mapper. For testing and debugging.

-f|--force ...
Override various checks, confirmations and protections. Use with extreme caution.

-h|--help
Display help text.

--longhelp
Display long help text.

--noudevsync
Disables udev synchronisation. The process will not wait for notification from udev. It will continue irrespective of any possible udev processing in the background. Only use this if udev is not running or has
rules that ignore the devices LVM creates.

--profile String
An alias for --commandprofile or --metadataprofile, depending on the command.

-q|--quiet ...
Suppress output and log messages. Overrides --debug and --verbose. Repeat once to also suppress any prompts with answer 'no'.

--reportformat basic|json
Overrides current output format for reports which is defined globally by the report/output_format setting in lvm.conf. basic is the original format with columns and rows. If there is more than one report per com‐
mand, each report is prefixed with the report name for identification. json produces report output in JSON format. See lvmreport(7) for more information.

-S|--select String
Select objects for processing and reporting based on specified criteria. The criteria syntax is described by --select help and lvmreport(7). For reporting commands, one row is displayed for each object matching
the criteria. See --options help for selectable object fields. Rows can be displayed with an additional "selected" field (-o selected) showing 1 if the row matches the selection and 0 otherwise. For non-report‐
ing commands which process LVM entities, the selection is used to choose items to process.

-t|--test
Run in test mode. Commands will not update metadata. This is implemented by disabling all metadata writing but nevertheless returning success to the calling function. This may lead to unusual error messages in
multi-stage operations if a tool relies on reading back metadata it believes has changed but hasn't.

-v|--verbose ...
Set verbose level. Repeat from 1 to 4 times to increase the detail of messages sent to stdout and stderr.

--version
Display version information.

-y|--yes
Do not prompt for confirmation interactively but always assume the answer yes. Use with extreme caution. (For automatic no, see -qq.)

VARIABLES
VG
Volume Group name. See lvm(8) for valid names.

Tag
Tag name. See lvm(8) for information about tag names and using tags in place of a VG, LV or PV.

Select
Select indicates that a required positional parameter can be omitted if the --select option is used. No arg appears in this position.

String
See the option description for information about the string content.

Size[UNIT]
Size is an input number that accepts an optional unit. Input units are always treated as base two values, regardless of capitalization, e.g. 'k' and 'K' both refer to 1024. The default input unit is specified by
letter, followed by |UNIT. UNIT represents other possible input units: bBsSkKmMgGtTpPeE. b|B is bytes, s|S is sectors of 512 bytes, k|K is kilobytes, m|M is megabytes, g|G is gigabytes, t|T is terabytes, p|P is
petabytes, e|E is exabytes. (This should not be confused with the output control --units, where capital letters mean multiple of 1000.)

ENVIRONMENT VARIABLES
See lvm(8) for information about environment variables used by lvm. For example, LVM_VG_NAME can generally be substituted for a required VG parameter.

SEE ALSO
lvm(8) lvm.conf(5) lvmconfig(8)

pvchange(8) pvck(8) pvcreate(8) pvdisplay(8) pvmove(8) pvremove(8) pvresize(8) pvs(8) pvscan(8)

vgcfgbackup(8) vgcfgrestore(8) vgchange(8) vgck(8) vgcreate(8) vgconvert(8) vgdisplay(8) vgexport(8) vgextend(8) vgimport(8) vgimportclone(8) vgmerge(8) vgmknodes(8) vgreduce(8) vgremove(8) vgrename(8) vgs(8) vgscan(8)
vgsplit(8)

lvcreate(8) lvchange(8) lvconvert(8) lvdisplay(8) lvextend(8) lvreduce(8) lvremove(8) lvrename(8) lvresize(8) lvs(8) lvscan(8)

lvm-fullreport(8) lvm-lvpoll(8) lvm2-activation-generator(8) blkdeactivate(8) lvmdump(8)

dmeventd(8) lvmetad(8) lvmpolld(8) lvmlockd(8) lvmlockctl(8) clvmd(8) cmirrord(8) lvmdbusd(8)

lvmsystemid(7) lvmreport(7) lvmraid(7) lvmthin(7) lvmcache(7)

Red Hat, Inc. LVM TOOLS 2.02.176(2) (2017-11-03) VGREMOVE(8)

vgrename

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
VGRENAME(8)                                                                                            System Manager's Manual                                                                                           VGRENAME(8)

NAME
vgrename - Rename a volume group

SYNOPSIS
vgrename position_args
[ option_args ]

DESCRIPTION
vgrename renames a VG.

All VGs visible to a system need to have different names, otherwise many LVM commands will refuse to run or give warning messages. VGs with the same name can occur when disks are moved between machines, or filters are
changed. If a newly connected disk has a VG with the same name as the VG containing the root filesystem, the machine may not boot correctly. When two VGs have the same name, the VG UUID can be used in place of the source
VG name.

USAGE
Rename a VG.

vgrename VG VG_new
[ COMMON_OPTIONS ]

Rename a VG by specifying the VG UUID.

vgrename String VG_new
[ COMMON_OPTIONS ]

Common options for command:
[ -A|--autobackup y|n ]
[ -f|--force ]
[ --reportformat basic|json ]

Common options for lvm:
[ -d|--debug ]
[ -h|--help ]
[ -q|--quiet ]
[ -t|--test ]
[ -v|--verbose ]
[ -y|--yes ]
[ --commandprofile String ]
[ --config String ]
[ --driverloaded y|n ]
[ --longhelp ]
[ --profile String ]
[ --version ]

OPTIONS
-A|--autobackup y|n
Specifies if metadata should be backed up automatically after a change. Enabling this is strongly advised! See vgcfgbackup(8) for more information.

--commandprofile String
The command profile to use for command configuration. See lvm.conf(5) for more information about profiles.

--config String
Config settings for the command. These override lvm.conf settings. The String arg uses the same format as lvm.conf, or may use section/field syntax. See lvm.conf(5) for more information about config.

-d|--debug ...
Set debug level. Repeat from 1 to 6 times to increase the detail of messages sent to the log file and/or syslog (if configured).

--driverloaded y|n
If set to no, the command will not attempt to use device-mapper. For testing and debugging.

-f|--force ...
Override various checks, confirmations and protections. Use with extreme caution.

-h|--help
Display help text.

--longhelp
Display long help text.

--profile String
An alias for --commandprofile or --metadataprofile, depending on the command.

-q|--quiet ...
Suppress output and log messages. Overrides --debug and --verbose. Repeat once to also suppress any prompts with answer 'no'.

--reportformat basic|json
Overrides current output format for reports which is defined globally by the report/output_format setting in lvm.conf. basic is the original format with columns and rows. If there is more than one report per com‐
mand, each report is prefixed with the report name for identification. json produces report output in JSON format. See lvmreport(7) for more information.

-t|--test
Run in test mode. Commands will not update metadata. This is implemented by disabling all metadata writing but nevertheless returning success to the calling function. This may lead to unusual error messages in
multi-stage operations if a tool relies on reading back metadata it believes has changed but hasn't.

-v|--verbose ...
Set verbose level. Repeat from 1 to 4 times to increase the detail of messages sent to stdout and stderr.

--version
Display version information.

-y|--yes
Do not prompt for confirmation interactively but always assume the answer yes. Use with extreme caution. (For automatic no, see -qq.)

VARIABLES
VG
Volume Group name. See lvm(8) for valid names.

String
See the option description for information about the string content.

Size[UNIT]
Size is an input number that accepts an optional unit. Input units are always treated as base two values, regardless of capitalization, e.g. 'k' and 'K' both refer to 1024. The default input unit is specified by
letter, followed by |UNIT. UNIT represents other possible input units: bBsSkKmMgGtTpPeE. b|B is bytes, s|S is sectors of 512 bytes, k|K is kilobytes, m|M is megabytes, g|G is gigabytes, t|T is terabytes, p|P is
petabytes, e|E is exabytes. (This should not be confused with the output control --units, where capital letters mean multiple of 1000.)

ENVIRONMENT VARIABLES
See lvm(8) for information about environment variables used by lvm. For example, LVM_VG_NAME can generally be substituted for a required VG parameter.

EXAMPLES
Rename VG "vg02" to "myvg":
vgrename vg02 myvg

Rename the VG with the specified UUID to "myvg".
vgrename Zvlifi-Ep3t-e0Ng-U42h-o0ye-KHu1-nl7Ns4 myvg

SEE ALSO
lvm(8) lvm.conf(5) lvmconfig(8)

pvchange(8) pvck(8) pvcreate(8) pvdisplay(8) pvmove(8) pvremove(8) pvresize(8) pvs(8) pvscan(8)

vgcfgbackup(8) vgcfgrestore(8) vgchange(8) vgck(8) vgcreate(8) vgconvert(8) vgdisplay(8) vgexport(8) vgextend(8) vgimport(8) vgimportclone(8) vgmerge(8) vgmknodes(8) vgreduce(8) vgremove(8) vgrename(8) vgs(8) vgscan(8)
vgsplit(8)

lvcreate(8) lvchange(8) lvconvert(8) lvdisplay(8) lvextend(8) lvreduce(8) lvremove(8) lvrename(8) lvresize(8) lvs(8) lvscan(8)

lvm-fullreport(8) lvm-lvpoll(8) lvm2-activation-generator(8) blkdeactivate(8) lvmdump(8)

dmeventd(8) lvmetad(8) lvmpolld(8) lvmlockd(8) lvmlockctl(8) clvmd(8) cmirrord(8) lvmdbusd(8)

lvmsystemid(7) lvmreport(7) lvmraid(7) lvmthin(7) lvmcache(7)

Red Hat, Inc. LVM TOOLS 2.02.176(2) (2017-11-03) VGRENAME(8)

vgs

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
VGS(8)                                                                                                 System Manager's Manual                                                                                                VGS(8)

NAME
vgs - Display information about volume groups

SYNOPSIS
vgs
[ option_args ]
[ position_args ]

DESCRIPTION
vgs produces formatted output about VGs.

USAGE
vgs
[ -a|--all ]
[ -o|--options String ]
[ -S|--select String ]
[ -O|--sort String ]
[ --aligned ]
[ --binary ]
[ --configreport log|vg|lv|pv|pvseg|seg ]
[ --foreign ]
[ --ignorelockingfailure ]
[ --ignoreskippedcluster ]
[ --logonly ]
[ --nameprefixes ]
[ --noheadings ]
[ --nolocking ]
[ --nosuffix ]
[ --readonly ]
[ --reportformat basic|json ]
[ --rows ]
[ --separator String ]
[ --shared ]
[ --trustcache ]
[ --unbuffered ]
[ --units r|R|h|H|b|B|s|S|k|K|m|M|g|G|t|T|p|P|e|E ]
[ --unquoted ]
[ COMMON_OPTIONS ]
[ VG|Tag ... ]

Common options for lvm:
[ -d|--debug ]
[ -h|--help ]
[ -q|--quiet ]
[ -t|--test ]
[ -v|--verbose ]
[ -y|--yes ]
[ --commandprofile String ]
[ --config String ]
[ --driverloaded y|n ]
[ --longhelp ]
[ --profile String ]
[ --version ]

OPTIONS
--aligned
Use with --separator to align the output columns

-a|--all
List all VGs. Equivalent to not specifying any VGs.

--binary
Use binary values "0" or "1" instead of descriptive literal values for columns that have exactly two valid values to report (not counting the "unknown" value which denotes that the value could not be determined).

--commandprofile String
The command profile to use for command configuration. See lvm.conf(5) for more information about profiles.

--config String
Config settings for the command. These override lvm.conf settings. The String arg uses the same format as lvm.conf, or may use section/field syntax. See lvm.conf(5) for more information about config.

--configreport log|vg|lv|pv|pvseg|seg
See lvmreport(7).

-d|--debug ...
Set debug level. Repeat from 1 to 6 times to increase the detail of messages sent to the log file and/or syslog (if configured).

--driverloaded y|n
If set to no, the command will not attempt to use device-mapper. For testing and debugging.

--foreign
Report/display foreign VGs that would otherwise be skipped. See lvmsystemid(7) for more information about foreign VGs.

-h|--help
Display help text.

--ignorelockingfailure
Allows a command to continue with read-only metadata operations after locking failures.

--ignoreskippedcluster
Use to avoid exiting with an non-zero status code if the command is run without clustered locking and clustered VGs are skipped.

--logonly
Suppress command report and display only log report.

--longhelp
Display long help text.

--nameprefixes
Add an "LVM2_" prefix plus the field name to the output. Useful with --noheadings to produce a list of field=value pairs that can be used to set environment variables (for example, in udev rules).

--noheadings
Suppress the headings line that is normally the first line of output. Useful if grepping the output.

--nolocking
Disable locking.

--nosuffix
Suppress the suffix on output sizes. Use with --units (except h and H) if processing the output.

-o|--options String
Comma-separated, ordered list of fields to display in columns. String arg syntax is: [+|-|#]Field1[,Field2 ...] The prefix + will append the specified fields to the default fields, - will remove the specified
fields from the default fields, and # will compact specified fields (removing them when empty for all rows.) Use -o help to view the list of all available fields. Use separate lists of fields to add, remove or
compact by repeating the -o option: -o+field1,field2 -o-field3,field4 -o#field5. These lists are evaluated from left to right. Use field name lv_all to view all LV fields, vg_all all VG fields, pv_all all PV
fields, pvseg_all all PV segment fields, seg_all all LV segment fields, and pvseg_all all PV segment columns. See the lvm.conf report section for more config options. See lvmreport(7) for more information about
reporting.

--profile String
An alias for --commandprofile or --metadataprofile, depending on the command.

-q|--quiet ...
Suppress output and log messages. Overrides --debug and --verbose. Repeat once to also suppress any prompts with answer 'no'.

--readonly
Run the command in a special read-only mode which will read on-disk metadata without needing to take any locks. This can be used to peek inside metadata used by a virtual machine image while the virtual machine is
running. It can also be used to peek inside the metadata of clustered VGs when clustered locking is not configured or running. No attempt will be made to communicate with the device-mapper kernel driver, so this
option is unable to report whether or not LVs are actually in use.

--reportformat basic|json
Overrides current output format for reports which is defined globally by the report/output_format setting in lvm.conf. basic is the original format with columns and rows. If there is more than one report per com‐
mand, each report is prefixed with the report name for identification. json produces report output in JSON format. See lvmreport(7) for more information.

--rows
Output columns as rows.

-S|--select String
Select objects for processing and reporting based on specified criteria. The criteria syntax is described by --select help and lvmreport(7). For reporting commands, one row is displayed for each object matching
the criteria. See --options help for selectable object fields. Rows can be displayed with an additional "selected" field (-o selected) showing 1 if the row matches the selection and 0 otherwise. For non-report‐
ing commands which process LVM entities, the selection is used to choose items to process.

--separator String
String to use to separate each column. Useful if grepping the output.

--shared
Report/display shared VGs that would otherwise be skipped when lvmlockd is not being used on the host. See lvmlockd(8) for more information about shared VGs.

-O|--sort String
Comma-separated ordered list of columns to sort by. Replaces the default selection. Precede any column with - for a reverse sort on that column.

-t|--test
Run in test mode. Commands will not update metadata. This is implemented by disabling all metadata writing but nevertheless returning success to the calling function. This may lead to unusual error messages in
multi-stage operations if a tool relies on reading back metadata it believes has changed but hasn't.

--trustcache
Avoids certain device scanning during command processing. Do not use.

--unbuffered
Produce output immediately without sorting or aligning the columns properly.

--units r|R|h|H|b|B|s|S|k|K|m|M|g|G|t|T|p|P|e|E
All sizes are output in these units: human-(r)eadable with '<' rounding indicator, (h)uman-readable, (b)ytes, (s)ectors, (k)ilobytes, (m)egabytes, (g)igabytes, (t)erabytes, (p)etabytes, (e)xabytes. Capitalise to
use multiples of 1000 (S.I.) instead of 1024. Custom units can be specified, e.g. --units 3M.

--unquoted
When used with --nameprefixes, output values in the field=value pairs are not quoted.

-v|--verbose ...
Set verbose level. Repeat from 1 to 4 times to increase the detail of messages sent to stdout and stderr.

--version
Display version information.

-y|--yes
Do not prompt for confirmation interactively but always assume the answer yes. Use with extreme caution. (For automatic no, see -qq.)

VARIABLES
VG
Volume Group name. See lvm(8) for valid names.

Tag
Tag name. See lvm(8) for information about tag names and using tags in place of a VG, LV or PV.

String
See the option description for information about the string content.

Size[UNIT]
Size is an input number that accepts an optional unit. Input units are always treated as base two values, regardless of capitalization, e.g. 'k' and 'K' both refer to 1024. The default input unit is specified by
letter, followed by |UNIT. UNIT represents other possible input units: bBsSkKmMgGtTpPeE. b|B is bytes, s|S is sectors of 512 bytes, k|K is kilobytes, m|M is megabytes, g|G is gigabytes, t|T is terabytes, p|P is
petabytes, e|E is exabytes. (This should not be confused with the output control --units, where capital letters mean multiple of 1000.)

ENVIRONMENT VARIABLES
See lvm(8) for information about environment variables used by lvm. For example, LVM_VG_NAME can generally be substituted for a required VG parameter.

NOTES
The vg_attr bits are:

1 Permissions: (w)riteable, (r)ead-only

2 Resi(z)eable

3 E(x)ported

4 (p)artial: one or more physical volumes belonging to the volume group are missing from the system

5 Allocation policy: (c)ontiguous, c(l)ing, (n)ormal, (a)nywhere

6 (c)lustered, (s)hared

SEE ALSO
lvm(8) lvm.conf(5) lvmconfig(8)

pvchange(8) pvck(8) pvcreate(8) pvdisplay(8) pvmove(8) pvremove(8) pvresize(8) pvs(8) pvscan(8)

vgcfgbackup(8) vgcfgrestore(8) vgchange(8) vgck(8) vgcreate(8) vgconvert(8) vgdisplay(8) vgexport(8) vgextend(8) vgimport(8) vgimportclone(8) vgmerge(8) vgmknodes(8) vgreduce(8) vgremove(8) vgrename(8) vgs(8) vgscan(8)
vgsplit(8)

lvcreate(8) lvchange(8) lvconvert(8) lvdisplay(8) lvextend(8) lvreduce(8) lvremove(8) lvrename(8) lvresize(8) lvs(8) lvscan(8)

lvm-fullreport(8) lvm-lvpoll(8) lvm2-activation-generator(8) blkdeactivate(8) lvmdump(8)

dmeventd(8) lvmetad(8) lvmpolld(8) lvmlockd(8) lvmlockctl(8) clvmd(8) cmirrord(8) lvmdbusd(8)

lvmsystemid(7) lvmreport(7) lvmraid(7) lvmthin(7) lvmcache(7)

Red Hat, Inc. LVM TOOLS 2.02.176(2) (2017-11-03) VGS(8)

vgscan

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
VGSCAN(8)                                                                                              System Manager's Manual                                                                                             VGSCAN(8)

NAME
vgscan - Search for all volume groups

SYNOPSIS
vgscan
[ option_args ]

DESCRIPTION
vgscan scans all supported LVM block devices in the system for VGs.

USAGE
vgscan
[ --cache ]
[ --ignorelockingfailure ]
[ --mknodes ]
[ --notifydbus ]
[ --reportformat basic|json ]
[ COMMON_OPTIONS ]

Common options for lvm:
[ -d|--debug ]
[ -h|--help ]
[ -q|--quiet ]
[ -t|--test ]
[ -v|--verbose ]
[ -y|--yes ]
[ --commandprofile String ]
[ --config String ]
[ --driverloaded y|n ]
[ --longhelp ]
[ --profile String ]
[ --version ]

OPTIONS
--cache
Scan all devices and send the metadata to lvmetad.

--commandprofile String
The command profile to use for command configuration. See lvm.conf(5) for more information about profiles.

--config String
Config settings for the command. These override lvm.conf settings. The String arg uses the same format as lvm.conf, or may use section/field syntax. See lvm.conf(5) for more information about config.

-d|--debug ...
Set debug level. Repeat from 1 to 6 times to increase the detail of messages sent to the log file and/or syslog (if configured).

--driverloaded y|n
If set to no, the command will not attempt to use device-mapper. For testing and debugging.

-h|--help
Display help text.

--ignorelockingfailure
Allows a command to continue with read-only metadata operations after locking failures.

--longhelp
Display long help text.

--mknodes
Also checks the LVM special files in /dev that are needed for active LVs and creates any missing ones and removes unused ones.

--notifydbus
Send a notification to D-Bus. The command will exit with an error if LVM is not built with support for D-Bus notification, or if the notify_dbus config setting is disabled.

--profile String
An alias for --commandprofile or --metadataprofile, depending on the command.

-q|--quiet ...
Suppress output and log messages. Overrides --debug and --verbose. Repeat once to also suppress any prompts with answer 'no'.

--reportformat basic|json
Overrides current output format for reports which is defined globally by the report/output_format setting in lvm.conf. basic is the original format with columns and rows. If there is more than one report per com‐
mand, each report is prefixed with the report name for identification. json produces report output in JSON format. See lvmreport(7) for more information.

-t|--test
Run in test mode. Commands will not update metadata. This is implemented by disabling all metadata writing but nevertheless returning success to the calling function. This may lead to unusual error messages in
multi-stage operations if a tool relies on reading back metadata it believes has changed but hasn't.

-v|--verbose ...
Set verbose level. Repeat from 1 to 4 times to increase the detail of messages sent to stdout and stderr.

--version
Display version information.

-y|--yes
Do not prompt for confirmation interactively but always assume the answer yes. Use with extreme caution. (For automatic no, see -qq.)

VARIABLES
String
See the option description for information about the string content.

Size[UNIT]
Size is an input number that accepts an optional unit. Input units are always treated as base two values, regardless of capitalization, e.g. 'k' and 'K' both refer to 1024. The default input unit is specified by
letter, followed by |UNIT. UNIT represents other possible input units: bBsSkKmMgGtTpPeE. b|B is bytes, s|S is sectors of 512 bytes, k|K is kilobytes, m|M is megabytes, g|G is gigabytes, t|T is terabytes, p|P is
petabytes, e|E is exabytes. (This should not be confused with the output control --units, where capital letters mean multiple of 1000.)

ENVIRONMENT VARIABLES
See lvm(8) for information about environment variables used by lvm. For example, LVM_VG_NAME can generally be substituted for a required VG parameter.

SEE ALSO
lvm(8) lvm.conf(5) lvmconfig(8)

pvchange(8) pvck(8) pvcreate(8) pvdisplay(8) pvmove(8) pvremove(8) pvresize(8) pvs(8) pvscan(8)

vgcfgbackup(8) vgcfgrestore(8) vgchange(8) vgck(8) vgcreate(8) vgconvert(8) vgdisplay(8) vgexport(8) vgextend(8) vgimport(8) vgimportclone(8) vgmerge(8) vgmknodes(8) vgreduce(8) vgremove(8) vgrename(8) vgs(8) vgscan(8)
vgsplit(8)

lvcreate(8) lvchange(8) lvconvert(8) lvdisplay(8) lvextend(8) lvreduce(8) lvremove(8) lvrename(8) lvresize(8) lvs(8) lvscan(8)

lvm-fullreport(8) lvm-lvpoll(8) lvm2-activation-generator(8) blkdeactivate(8) lvmdump(8)

dmeventd(8) lvmetad(8) lvmpolld(8) lvmlockd(8) lvmlockctl(8) clvmd(8) cmirrord(8) lvmdbusd(8)

lvmsystemid(7) lvmreport(7) lvmraid(7) lvmthin(7) lvmcache(7)

Red Hat, Inc. LVM TOOLS 2.02.176(2) (2017-11-03) VGSCAN(8)

vgsplit

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
VGSPLIT(8)                                                                                             System Manager's Manual                                                                                            VGSPLIT(8)

NAME
vgsplit - Move physical volumes into a new or existing volume group

SYNOPSIS
vgsplit option_args position_args
[ option_args ]

DESCRIPTION
vgsplit moves one or more PVs from a source VG to a destination VG. The PVs can be specified explicitly or implicitly by naming an LV, in which case on PVs underlying the LV are moved.

If the destination VG does not exist, a new VG is created (command options can be used to specify properties of the new VG, also see vgcreate(8).)

LVs cannot be split between VGs; each LV must be entirely on the PVs in the source or destination VG.

vgsplit can only move complete PVs. (See pvmove(8) for moving part of a PV.)

USAGE
Split a VG by specified PVs.

vgsplit VG VG PV ...
[ COMMON_OPTIONS ]

Split a VG by PVs in a specified LV.

vgsplit -n|--name LV VG VG
[ COMMON_OPTIONS ]

Common options for command:
[ -A|--autobackup y|n ]
[ -c|--clustered y|n ]
[ -l|--maxlogicalvolumes Number ]
[ -p|--maxphysicalvolumes Number ]
[ -M|--metadatatype lvm2|lvm1 ]
[ --alloc contiguous|cling|cling_by_tags|normal|anywhere|inherit ]
[ --[vg]metadatacopies all|unmanaged|Number ]

Common options for lvm:
[ -d|--debug ]
[ -h|--help ]
[ -q|--quiet ]
[ -t|--test ]
[ -v|--verbose ]
[ -y|--yes ]
[ --commandprofile String ]
[ --config String ]
[ --driverloaded y|n ]
[ --longhelp ]
[ --profile String ]
[ --version ]

OPTIONS
--alloc contiguous|cling|cling_by_tags|normal|anywhere|inherit
Determines the allocation policy when a command needs to allocate Physical Extents (PEs) from the VG. Each VG and LV has an allocation policy which can be changed with vgchange/lvchange, or overriden on the command
line. normal applies common sense rules such as not placing parallel stripes on the same PV. inherit applies the VG policy to an LV. contiguous requires new PEs be placed adjacent to existing PEs. cling places
new PEs on the same PV as existing PEs in the same stripe of the LV. If there are sufficient PEs for an allocation, but normal does not use them, anywhere will use them even if it reduces performance, e.g. by
placing two stripes on the same PV. Optional positional PV args on the command line can also be used to limit which PVs the command will use for allocation. See lvm(8) for more information about allocation.

-A|--autobackup y|n
Specifies if metadata should be backed up automatically after a change. Enabling this is strongly advised! See vgcfgbackup(8) for more information.

-c|--clustered y|n
Specifies the clustered property of the new VG.

--commandprofile String
The command profile to use for command configuration. See lvm.conf(5) for more information about profiles.

--config String
Config settings for the command. These override lvm.conf settings. The String arg uses the same format as lvm.conf, or may use section/field syntax. See lvm.conf(5) for more information about config.

-d|--debug ...
Set debug level. Repeat from 1 to 6 times to increase the detail of messages sent to the log file and/or syslog (if configured).

--driverloaded y|n
If set to no, the command will not attempt to use device-mapper. For testing and debugging.

-h|--help
Display help text.

--longhelp
Display long help text.

-l|--maxlogicalvolumes Number
Sets the maximum number of LVs allowed in a VG.

-p|--maxphysicalvolumes Number
Sets the maximum number of PVs that can belong to the VG. The value 0 removes any limitation. For large numbers of PVs, also see options --pvmetadatacopies, and --vgmetadatacopies for improving performance.

-M|--metadatatype lvm2|lvm1
Specifies the type of on-disk metadata to use. lvm2 (or just 2) is the current, standard format. lvm1 (or just 1) is a historical format that can be used for accessing old data.

-n|--name String
Move only PVs used by the named LV.

--profile String
An alias for --commandprofile or --metadataprofile, depending on the command.

-q|--quiet ...
Suppress output and log messages. Overrides --debug and --verbose. Repeat once to also suppress any prompts with answer 'no'.

-t|--test
Run in test mode. Commands will not update metadata. This is implemented by disabling all metadata writing but nevertheless returning success to the calling function. This may lead to unusual error messages in
multi-stage operations if a tool relies on reading back metadata it believes has changed but hasn't.

-v|--verbose ...
Set verbose level. Repeat from 1 to 4 times to increase the detail of messages sent to stdout and stderr.

--version
Display version information.

--[vg]metadatacopies all|unmanaged|Number
Number of copies of the VG metadata that are kept. VG metadata is kept in VG metadata areas on PVs in the VG, i.e. reserved space at the start and/or end of the PVs. Keeping a copy of the VG metadata on every PV
can reduce performance in VGs containing a large number of PVs. When this number is set to a non-zero value, LVM will automatically choose PVs on which to store metadata, using the metadataignore flags on PVs to
achieve the specified number. The number can also be replaced with special string values: unmanaged causes LVM to not automatically manage the PV metadataignore flags. all causes LVM to first clear the meta‐
dataignore flags on all PVs, and then to become unmanaged.

-y|--yes
Do not prompt for confirmation interactively but always assume the answer yes. Use with extreme caution. (For automatic no, see -qq.)

VARIABLES
VG
Volume Group name. See lvm(8) for valid names.

PV
Physical Volume name, a device path under /dev. For commands managing physical extents, a PV positional arg generally accepts a suffix indicating a range (or multiple ranges) of physical extents (PEs). When the
first PE is omitted, it defaults to the start of the device, and when the last PE is omitted it defaults to end. Start and end range (inclusive): PV[:PE-PE]... Start and length range (counting from 0):
PV[:PE+PE]...

String
See the option description for information about the string content.

Size[UNIT]
Size is an input number that accepts an optional unit. Input units are always treated as base two values, regardless of capitalization, e.g. 'k' and 'K' both refer to 1024. The default input unit is specified by
letter, followed by |UNIT. UNIT represents other possible input units: bBsSkKmMgGtTpPeE. b|B is bytes, s|S is sectors of 512 bytes, k|K is kilobytes, m|M is megabytes, g|G is gigabytes, t|T is terabytes, p|P is
petabytes, e|E is exabytes. (This should not be confused with the output control --units, where capital letters mean multiple of 1000.)

ENVIRONMENT VARIABLES
See lvm(8) for information about environment variables used by lvm. For example, LVM_VG_NAME can generally be substituted for a required VG parameter.

SEE ALSO
lvm(8) lvm.conf(5) lvmconfig(8)

pvchange(8) pvck(8) pvcreate(8) pvdisplay(8) pvmove(8) pvremove(8) pvresize(8) pvs(8) pvscan(8)

vgcfgbackup(8) vgcfgrestore(8) vgchange(8) vgck(8) vgcreate(8) vgconvert(8) vgdisplay(8) vgexport(8) vgextend(8) vgimport(8) vgimportclone(8) vgmerge(8) vgmknodes(8) vgreduce(8) vgremove(8) vgrename(8) vgs(8) vgscan(8)
vgsplit(8)

lvcreate(8) lvchange(8) lvconvert(8) lvdisplay(8) lvextend(8) lvreduce(8) lvremove(8) lvrename(8) lvresize(8) lvs(8) lvscan(8)

lvm-fullreport(8) lvm-lvpoll(8) lvm2-activation-generator(8) blkdeactivate(8) lvmdump(8)

dmeventd(8) lvmetad(8) lvmpolld(8) lvmlockd(8) lvmlockctl(8) clvmd(8) cmirrord(8) lvmdbusd(8)

lvmsystemid(7) lvmreport(7) lvmraid(7) lvmthin(7) lvmcache(7)

Red Hat, Inc. LVM TOOLS 2.02.176(2) (2017-11-03) VGSPLIT(8)

lvchange

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
LVCHANGE(8)                                                                                            System Manager's Manual                                                                                           LVCHANGE(8)

NAME
lvchange - Change the attributes of logical volume(s)

SYNOPSIS
lvchange option_args position_args
[ option_args ]

-a|--activate y|n|ay
--activationmode partial|degraded|complete
--addtag Tag
--alloc contiguous|cling|cling_by_tags|normal|anywhere|inherit
-A|--autobackup y|n
--cachemode writethrough|writeback|passthrough
--cachepolicy String
--cachesettings String
--commandprofile String
--config String
-C|--contiguous y|n
-d|--debug
--deltag Tag
--detachprofile
--discards passdown|nopassdown|ignore
--driverloaded y|n
--errorwhenfull y|n
-f|--force
-h|--help
-K|--ignoreactivationskip
--ignorelockingfailure
--ignoremonitoring
--ignoreskippedcluster
--longhelp
-j|--major Number
--[raid]maxrecoveryrate Size[k|UNIT]
--metadataprofile String
--minor Number
--[raid]minrecoveryrate Size[k|UNIT]
--monitor y|n
--noudevsync
-P|--partial
-p|--permission rw|r
-M|--persistent y|n
--poll y|n
--profile String
-q|--quiet
-r|--readahead auto|none|Number
--rebuild PV
--refresh
--reportformat basic|json
--resync
-S|--select String
-k|--setactivationskip y|n
--[raid]syncaction check|repair
--sysinit
-t|--test
-v|--verbose
--version
--[raid]writebehind Number
--[raid]writemostly PV[:t|n|y]
-y|--yes
-Z|--zero y|n

DESCRIPTION
lvchange changes LV attributes in the VG, changes LV activation in the kernel, and includes other utilities for LV maintenance.

USAGE
Change a general LV attribute.
For options listed in parentheses, any one is
required, after which the others are optional.

lvchange
( -C|--contiguous y|n,
-p|--permission rw|r,
-r|--readahead auto|none|Number,
-k|--setactivationskip y|n,
-Z|--zero y|n,
-M|--persistent n,
--addtag Tag,
--deltag Tag,
--alloc contiguous|cling|cling_by_tags|normal|anywhere|inherit,
--detachprofile,
--metadataprofile String,
--profile String,
--errorwhenfull y|n,
--discards passdown|nopassdown|ignore,
--cachemode writethrough|writeback|passthrough,
--cachepolicy String,
--cachesettings String,
--[raid]minrecoveryrate Size[k|UNIT],
--[raid]maxrecoveryrate Size[k|UNIT],
--[raid]writebehind Number,
--[raid]writemostly PV[:t|n|y] )
VG|LV|Tag|Select ...
[ -a|--activate y|n|ay ]
[ --poll y|n ]
[ --monitor y|n ]
[ COMMON_OPTIONS ]
-

Resyncronize a mirror or raid LV.

lvchange --resync VG|LV_mirror_raid|Tag|Select ...
[ -a|--activate y|n|ay ]
[ COMMON_OPTIONS ]
-

Resynchronize or check a raid LV.

lvchange --syncaction check|repair VG|LV_raid|Tag|Select ...
[ COMMON_OPTIONS ]
-

Reconstruct data on specific PVs of a raid LV.

lvchange --rebuild PV VG|LV_raid|Tag|Select ...
[ COMMON_OPTIONS ]
-

Activate or deactivate an LV.

lvchange -a|--activate y|n|ay VG|LV|Tag|Select ...
[ -P|--partial ]
[ -K|--ignoreactivationskip ]
[ --activationmode partial|degraded|complete ]
[ --poll y|n ]
[ --monitor y|n ]
[ --ignorelockingfailure ]
[ --sysinit ]
[ COMMON_OPTIONS ]
-

Reactivate an LV using the latest metadata.

lvchange --refresh VG|LV|Tag|Select ...
[ -P|--partial ]
[ --activationmode partial|degraded|complete ]
[ --poll y|n ]
[ --monitor y|n ]
[ COMMON_OPTIONS ]
-

Start or stop monitoring an LV from dmeventd.

lvchange --monitor y|n VG|LV|Tag|Select ...
[ COMMON_OPTIONS ]
-

Start or stop processing an LV conversion.

lvchange --poll y|n VG|LV|Tag|Select ...
[ --monitor y|n ]
[ COMMON_OPTIONS ]
-

Make the minor device number persistent for an LV.

lvchange -M|--persistent y --minor Number LV
[ -j|--major Number ]
[ -a|--activate y|n|ay ]
[ --poll y|n ]
[ --monitor y|n ]
[ COMMON_OPTIONS ]
-

Common options for command:
[ -A|--autobackup y|n ]
[ -f|--force ]
[ -S|--select String ]
[ --ignoremonitoring ]
[ --ignoreskippedcluster ]
[ --noudevsync ]
[ --reportformat basic|json ]

Common options for lvm:
[ -d|--debug ]
[ -h|--help ]
[ -q|--quiet ]
[ -t|--test ]
[ -v|--verbose ]
[ -y|--yes ]
[ --commandprofile String ]
[ --config String ]
[ --driverloaded y|n ]
[ --longhelp ]
[ --profile String ]
[ --version ]

OPTIONS
-a|--activate y|n|ay
Change the active state of LVs. An active LV can be used through a block device, allowing data on the LV to be accessed. y makes LVs active, or available. n makes LVs inactive, or unavailable. The block device
for the LV is added or removed from the system using device-mapper in the kernel. A symbolic link /dev/VGName/LVName pointing to the device node is also added/removed. All software and scripts should access the
device through the symbolic link and present this as the name of the device. The location and name of the underlying device node may depend on the distribution, configuration (e.g. udev), or release version. ay
specifies autoactivation, in which case an LV is activated only if it matches an item in lvm.conf activation/auto_activation_volume_list. If the list is not set, all LVs are considered to match, and if if the list
is set but empty, no LVs match. Autoactivation should be used during system boot to make it possible to select which LVs should be automatically activated by the system. See lvmlockd(8) for more information about
activation options ey and sy for shared VGs. See clvmd(8) for more information about activation options ey, sy, ly and ln for clustered VGs.

--activationmode partial|degraded|complete
Determines if LV activation is allowed when PVs are missing, e.g. because of a device failure. complete only allows LVs with no missing PVs to be activated, and is the most restrictive mode. degraded allows RAID
LVs with missing PVs to be activated. (This does not include the "mirror" type, see "raid1" instead.) partial allows any LV with missing PVs to be activated, and should only be used for recovery or repair. For
default, see lvm.conf/activation_mode. See lvmraid(7) for more information.

--addtag Tag
Adds a tag to a PV, VG or LV. This option can be repeated to add multiple tags at once. See lvm(8) for information about tags.

--alloc contiguous|cling|cling_by_tags|normal|anywhere|inherit
Determines the allocation policy when a command needs to allocate Physical Extents (PEs) from the VG. Each VG and LV has an allocation policy which can be changed with vgchange/lvchange, or overriden on the command
line. normal applies common sense rules such as not placing parallel stripes on the same PV. inherit applies the VG policy to an LV. contiguous requires new PEs be placed adjacent to existing PEs. cling places
new PEs on the same PV as existing PEs in the same stripe of the LV. If there are sufficient PEs for an allocation, but normal does not use them, anywhere will use them even if it reduces performance, e.g. by
placing two stripes on the same PV. Optional positional PV args on the command line can also be used to limit which PVs the command will use for allocation. See lvm(8) for more information about allocation.

-A|--autobackup y|n
Specifies if metadata should be backed up automatically after a change. Enabling this is strongly advised! See vgcfgbackup(8) for more information.

--cachemode writethrough|writeback|passthrough
Specifies when writes to a cache LV should be considered complete. writeback considers a write complete as soon as it is stored in the cache pool. writethough considers a write complete only when it has been
stored in both the cache pool and on the origin LV. While writethrough may be slower for writes, it is more resilient if something should happen to a device associated with the cache pool LV. With passthrough, all
reads are served from the origin LV (all reads miss the cache) and all writes are forwarded to the origin LV; additionally, write hits cause cache block invalidates. See lvmcache(7) for more information.

--cachepolicy String
Specifies the cache policy for a cache LV. See lvmcache(7) for more information.

--cachesettings String
Specifies tunable values for a cache LV in "Key = Value" form. Repeat this option to specify multiple values. (The default values should usually be adequate.) The special string value default switches settings
back to their default kernel values and removes them from the list of settings stored in LVM metadata. See lvmcache(7) for more information.

--commandprofile String
The command profile to use for command configuration. See lvm.conf(5) for more information about profiles.

--config String
Config settings for the command. These override lvm.conf settings. The String arg uses the same format as lvm.conf, or may use section/field syntax. See lvm.conf(5) for more information about config.

-C|--contiguous y|n
Sets or resets the contiguous allocation policy for LVs. Default is no contiguous allocation based on a next free principle. It is only possible to change a non-contiguous allocation policy to contiguous if all
of the allocated physical extents in the LV are already contiguous.

-d|--debug ...
Set debug level. Repeat from 1 to 6 times to increase the detail of messages sent to the log file and/or syslog (if configured).

--deltag Tag
Deletes a tag from a PV, VG or LV. This option can be repeated to delete multiple tags at once. See lvm(8) for information about tags.

--detachprofile
Detaches a metadata profile from a VG or LV. See lvm.conf(5) for more information about profiles.

--discards passdown|nopassdown|ignore
Specifies how the device-mapper thin pool layer in the kernel should handle discards. ignore causes the thin pool to ignore discards. nopassdown causes the thin pool to process discards itself to allow reuse of
unneeded extents in the thin pool. passdown causes the thin pool to process discards itself (like nopassdown) and pass the discards to the underlying device. See lvmthin(7) for more information.

--driverloaded y|n
If set to no, the command will not attempt to use device-mapper. For testing and debugging.

--errorwhenfull y|n
Specifies thin pool behavior when data space is exhausted. When yes, device-mapper will immediately return an error when a thin pool is full and an I/O request requires space. When no, device-mapper will queue
these I/O requests for a period of time to allow the thin pool to be extended. Errors are returned if no space is available after the timeout. (Also see dm-thin-pool kernel module option no_space_timeout.) See
lvmthin(7) for more information.

-f|--force ...
Override various checks, confirmations and protections. Use with extreme caution.

-h|--help
Display help text.

-K|--ignoreactivationskip
Ignore the "activation skip" LV flag during activation to allow LVs with the flag set to be activated.

--ignorelockingfailure
Allows a command to continue with read-only metadata operations after locking failures.

--ignoremonitoring
Do not interact with dmeventd unless --monitor is specified. Do not use this if dmeventd is already monitoring a device.

--ignoreskippedcluster
Use to avoid exiting with an non-zero status code if the command is run without clustered locking and clustered VGs are skipped.

--longhelp
Display long help text.

-j|--major Number
Sets the major number of an LV block device.

--[raid]maxrecoveryrate Size[k|UNIT]
Sets the maximum recovery rate for a RAID LV. The rate value is an amount of data per second for each device in the array. Setting the rate to 0 means it will be unbounded. See lvmraid(7) for more information.

--metadataprofile String
The metadata profile to use for command configuration. See lvm.conf(5) for more information about profiles.

--minor Number
Sets the minor number of an LV block device.

--[raid]minrecoveryrate Size[k|UNIT]
Sets the minimum recovery rate for a RAID LV. The rate value is an amount of data per second for each device in the array. Setting the rate to 0 means it will be unbounded. See lvmraid(7) for more information.

--monitor y|n
Start (yes) or stop (no) monitoring an LV with dmeventd. dmeventd monitors kernel events for an LV, and performs automated maintenance for the LV in reponse to specific events. See dmeventd(8) for more informa‐
tion.

--noudevsync
Disables udev synchronisation. The process will not wait for notification from udev. It will continue irrespective of any possible udev processing in the background. Only use this if udev is not running or has
rules that ignore the devices LVM creates.

-P|--partial
Commands will do their best to activate LVs with missing PV extents. Missing extents may be replaced with error or zero segments according to the lvm.conf missing_stripe_filler setting. Metadata may not be
changed with this option.

-p|--permission rw|r
Set access permission to read only r or read and write rw.

-M|--persistent y|n
When yes, makes the specified minor number persistent.

--poll y|n
When yes, start the background transformation of an LV. An incomplete transformation, e.g. pvmove or lvconvert interrupted by reboot or crash, can be restarted from the last checkpoint with --poll y. When no,
background transformation of an LV will not occur, and the transformation will not complete. It may not be appropriate to immediately poll an LV after activation, in which case --poll n can be used to defer polling
until a later --poll y command.

--profile String
An alias for --commandprofile or --metadataprofile, depending on the command.

-q|--quiet ...
Suppress output and log messages. Overrides --debug and --verbose. Repeat once to also suppress any prompts with answer 'no'.

-r|--readahead auto|none|Number
Sets read ahead sector count of an LV. auto is the default which allows the kernel to choose a suitable value automatically. none is equivalent to zero.

--rebuild PV
Selects a PV to rebuild in a raid LV. Multiple PVs can be rebuilt by repeating this option. Use this option in place of --resync or --syncaction repair when the PVs with corrupted data are known, and their data
should be reconstructed rather than reconstructing default (rotating) data. See lvmraid(7) for more information.

--refresh
If the LV is active, reload its metadata. This is not necessary in normal operation, but may be useful if something has gone wrong, or if some form of manual LV sharing is being used.

--reportformat basic|json
Overrides current output format for reports which is defined globally by the report/output_format setting in lvm.conf. basic is the original format with columns and rows. If there is more than one report per com‐
mand, each report is prefixed with the report name for identification. json produces report output in JSON format. See lvmreport(7) for more information.

--resync
Initiates mirror synchronization. Synchronization generally happens automatically, but this option forces it to run. Also see --rebuild to synchronize a specific PV. During synchronization, data is read from the
primary mirror device and copied to the others. This can take considerable time, during which the LV is without a complete redundant copy of the data. See lvmraid(7) for more information.

-S|--select String
Select objects for processing and reporting based on specified criteria. The criteria syntax is described by --select help and lvmreport(7). For reporting commands, one row is displayed for each object matching
the criteria. See --options help for selectable object fields. Rows can be displayed with an additional "selected" field (-o selected) showing 1 if the row matches the selection and 0 otherwise. For non-report‐
ing commands which process LVM entities, the selection is used to choose items to process.

-k|--setactivationskip y|n
Persistently sets (yes) or clears (no) the "activation skip" flag on an LV. An LV with this flag set is not activated unless the --ignoreactivationskip option is used by the activation command. This flag is set
by default on new thin snapshot LVs. The flag is not applied to deactivation. The current value of the flag is indicated in the lvs lv_attr bits.

--[raid]syncaction check|repair
Initiate different types of RAID synchronization. This causes the RAID LV to read all data and parity blocks in the array and check for discrepancies (mismatches between mirrors or incorrect parity values). check
will count but not correct discrepancies. repair will correct discrepancies. See lvs for reporting discrepancies found or repaired.

--sysinit
Indicates that vgchange/lvchange is being invoked from early system initialisation scripts (e.g. rc.sysinit or an initrd), before writable filesystems are available. As such, some functionality needs to be disabled
and this option acts as a shortcut which selects an appropriate set of options. Currently, this is equivalent to using --ignorelockingfailure, --ignoremonitoring, --poll n, and setting env var LVM_SUPPRESS_LOCK‐
ING_FAILURE_MESSAGES. When used in conjunction with lvmetad enabled and running, vgchange/lvchange skip autoactivation, and defer to pvscan autoactivation.

-t|--test
Run in test mode. Commands will not update metadata. This is implemented by disabling all metadata writing but nevertheless returning success to the calling function. This may lead to unusual error messages in
multi-stage operations if a tool relies on reading back metadata it believes has changed but hasn't.

-v|--verbose ...
Set verbose level. Repeat from 1 to 4 times to increase the detail of messages sent to stdout and stderr.

--version
Display version information.

--[raid]writebehind Number
The maximum number of outstanding writes that are allowed to devices in a RAID1 LV that is marked write-mostly. Once this value is exceeded, writes become synchronous (i.e. all writes to the constituent devices
must complete before the array signals the write has completed). Setting the value to zero clears the preference and allows the system to choose the value arbitrarily.

--[raid]writemostly PV[:t|n|y]
Mark a device in a RAID1 LV as write-mostly. All reads to these drives will be avoided unless absolutely necessary. This keeps the number of I/Os to the drive to a minimum. The default behavior is to set the
write-mostly attribute for the specified PV. It is also possible to remove the write-mostly flag by adding the suffix :n at the end of the PV name, or to toggle the value with the suffix :t. Repeat this option to
change the attribute on multiple PVs.

-y|--yes
Do not prompt for confirmation interactively but always assume the answer yes. Use with extreme caution. (For automatic no, see -qq.)

-Z|--zero y|n
Set zeroing mode for thin pool. Note: already provisioned blocks from pool in non-zero mode are not cleared in unwritten parts when setting --zero y.

VARIABLES
VG
Volume Group name. See lvm(8) for valid names.

LV
Logical Volume name. See lvm(8) for valid names. An LV positional arg generally includes the VG name and LV name, e.g. VG/LV. LV followed by _<type> indicates that an LV of the given type is required. (raid rep‐
resents raid<N> type)

Tag
Tag name. See lvm(8) for information about tag names and using tags in place of a VG, LV or PV.

Select
Select indicates that a required positional parameter can be omitted if the --select option is used. No arg appears in this position.

String
See the option description for information about the string content.

Size[UNIT]
Size is an input number that accepts an optional unit. Input units are always treated as base two values, regardless of capitalization, e.g. 'k' and 'K' both refer to 1024. The default input unit is specified by
letter, followed by |UNIT. UNIT represents other possible input units: bBsSkKmMgGtTpPeE. b|B is bytes, s|S is sectors of 512 bytes, k|K is kilobytes, m|M is megabytes, g|G is gigabytes, t|T is terabytes, p|P is
petabytes, e|E is exabytes. (This should not be confused with the output control --units, where capital letters mean multiple of 1000.)

ENVIRONMENT VARIABLES
See lvm(8) for information about environment variables used by lvm. For example, LVM_VG_NAME can generally be substituted for a required VG parameter.

EXAMPLES
Change LV permission to read-only:

lvchange -pr vg00/lvol1

SEE ALSO
lvm(8) lvm.conf(5) lvmconfig(8)

pvchange(8) pvck(8) pvcreate(8) pvdisplay(8) pvmove(8) pvremove(8) pvresize(8) pvs(8) pvscan(8)

vgcfgbackup(8) vgcfgrestore(8) vgchange(8) vgck(8) vgcreate(8) vgconvert(8) vgdisplay(8) vgexport(8) vgextend(8) vgimport(8) vgimportclone(8) vgmerge(8) vgmknodes(8) vgreduce(8) vgremove(8) vgrename(8) vgs(8) vgscan(8)
vgsplit(8)

lvcreate(8) lvchange(8) lvconvert(8) lvdisplay(8) lvextend(8) lvreduce(8) lvremove(8) lvrename(8) lvresize(8) lvs(8) lvscan(8)

lvm-fullreport(8) lvm-lvpoll(8) lvm2-activation-generator(8) blkdeactivate(8) lvmdump(8)

dmeventd(8) lvmetad(8) lvmpolld(8) lvmlockd(8) lvmlockctl(8) clvmd(8) cmirrord(8) lvmdbusd(8)

lvmsystemid(7) lvmreport(7) lvmraid(7) lvmthin(7) lvmcache(7)

Red Hat, Inc. LVM TOOLS 2.02.176(2) (2017-11-03) LVCHANGE(8)

lvconvert

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
LVCONVERT(8)                                                                                           System Manager's Manual                                                                                          LVCONVERT(8)

NAME
lvconvert - Change logical volume layout

SYNOPSIS
lvconvert option_args position_args
[ option_args ]
[ position_args ]

--alloc contiguous|cling|cling_by_tags|normal|anywhere|inherit
-b|--background
-H|--cache
--cachemetadataformat auto|1|2
--cachemode writethrough|writeback|passthrough
--cachepolicy String
--cachepool LV
--cachesettings String
-c|--chunksize Size[k|UNIT]
--commandprofile String
--config String
-d|--debug
--discards passdown|nopassdown|ignore
--driverloaded y|n
-f|--force
-h|--help
-i|--interval Number
--longhelp
--merge
--mergemirrors
--mergesnapshot
--mergethin
--metadataprofile String
--mirrorlog core|disk
-m|--mirrors [+|-]Number
-n|--name String
--noudevsync
--originname LV
--poolmetadata LV
--poolmetadatasize Size[m|UNIT]
--poolmetadataspare y|n
--profile String
-q|--quiet
-r|--readahead auto|none|Number
-R|--regionsize Size[m|UNIT]
--repair
--replace PV
-s|--snapshot
--splitcache
--splitmirrors Number
--splitsnapshot
--startpoll
--stripes Number
-I|--stripesize Size[k|UNIT]
--swapmetadata
-t|--test
-T|--thin
--thinpool LV
--trackchanges
--type linear|striped|snapshot|mirror|raid|thin|cache|thin-pool|cache-pool
--uncache
--usepolicies
-v|--verbose
--version
-y|--yes
-Z|--zero y|n

DESCRIPTION
lvconvert changes the LV type and includes utilities for LV data maintenance. The LV type controls data layout and redundancy. The LV type is also called the segment type or segtype.

To display the current LV type, run the command:

lvs -o name,segtype LV

In some cases, an LV is a single device mapper (dm) layer above physical devices. In other cases, hidden LVs (dm devices) are layered between the visible LV and physical devices. LVs in the middle layers are called sub
LVs. A command run on a visible LV sometimes operates on a sub LV rather than the specified LV. In other cases, a sub LV must be specified directly on the command line.

Sub LVs can be displayed with the command:

lvs -a

The linear type is equivalent to the striped type when one stripe exists. In that case, the types can sometimes be used interchangably.

In most cases, the mirror type is deprecated and the raid1 type should be used. They are both implementations of mirroring.

Striped raid types are raid0/raid0_meta, raid5 (an alias for raid5_ls), raid6 (an alias for raid6_zr) and raid10 (an alias for raid10_near).

As opposed to mirroring, raid5 and raid6 stripe data and calculate parity blocks. The parity blocks can be used for data block recovery in case devices fail. A maximum number of one device in a raid5 LV may fail, and two
in case of raid6. Striped raid types typically rotate the parity and data blocks for performance reasons, thus avoiding contention on a single device. Specific arrangements of parity and data blocks (layouts) can be used
to optimize I/O performance, or to convert between raid levels. See lvmraid(7) for more information.

Layouts of raid5 rotating parity blocks can be: left-asymmetric (raid5_la), left-symmetric (raid5_ls with alias raid5), right-asymmetric (raid5_ra), right-symmetric (raid5_rs) and raid5_n, which doesn't rotate parity
blocks. Layouts of raid6 are: zero-restart (raid6_zr with alias raid6), next-restart (raid6_nr), and next-continue (raid6_nc).

Layouts including _n allow for conversion between raid levels (raid5_n to raid6 or raid5_n to striped/raid0/raid0_meta). Additionally, special raid6 layouts for raid level conversions between raid5 and raid6 are:
raid6_ls_6, raid6_rs_6, raid6_la_6 and raid6_ra_6. Those correspond to their raid5 counterparts (e.g. raid5_rs can be directly converted to raid6_rs_6 and vice-versa).

raid10 (an alias for raid10_near) is currently limited to one data copy and even number of sub LVs. This is a mirror group layout, thus a single sub LV may fail per mirror group without data loss.

Striped raid types support converting the layout, their stripesize and their number of stripes.

The striped raid types combined with raid1 allow for conversion from linear-> striped/raid0/raid0_meta and vice-versa by e.g. linear <-> raid1 <-> raid5_n (then adding stripes) <-> striped/raid0/raid0_meta.

USAGE
Convert LV to linear.

lvconvert --type linear LV
[ COMMON_OPTIONS ]
[ PV ... ]
-

Convert LV to striped.

lvconvert --type striped LV
[ -I|--stripesize Size[k|UNIT] ]
[ -R|--regionsize Size[m|UNIT] ]
[ -i|--interval Number ]
[ --stripes Number ]
[ COMMON_OPTIONS ]
[ PV ... ]
-

Convert LV to raid or change raid layout
(a specific raid level must be used, e.g. raid1).

lvconvert --type raid LV
[ -m|--mirrors [+|-]Number ]
[ -I|--stripesize Size[k|UNIT] ]
[ -R|--regionsize Size[m|UNIT] ]
[ -i|--interval Number ]
[ --stripes Number ]
[ COMMON_OPTIONS ]
[ PV ... ]
-

Convert LV to raid1 or mirror, or change number of mirror images.

lvconvert -m|--mirrors [+|-]Number LV
[ -R|--regionsize Size[m|UNIT] ]
[ -i|--interval Number ]
[ --mirrorlog core|disk ]
[ COMMON_OPTIONS ]
[ PV ... ]
-

Convert raid LV to change number of stripe images.

lvconvert --stripes Number LV_raid
[ -i|--interval Number ]
[ -R|--regionsize Size[m|UNIT] ]
[ -I|--stripesize Size[k|UNIT] ]
[ COMMON_OPTIONS ]
[ PV ... ]
-

Convert raid LV to change the stripe size.

lvconvert -I|--stripesize Size[k|UNIT] LV_raid
[ -i|--interval Number ]
[ -R|--regionsize Size[m|UNIT] ]
[ COMMON_OPTIONS ]
-

Split images from a raid1 or mirror LV and use them to create a new LV.

lvconvert --splitmirrors Number -n|--name LV_new LV_cache_mirror_raid1
[ COMMON_OPTIONS ]
[ PV ... ]
-

Split images from a raid1 LV and track changes to origin.

lvconvert --splitmirrors Number --trackchanges LV_cache_raid1
[ COMMON_OPTIONS ]
[ PV ... ]
-

Merge LV images that were split from a raid1 LV.

lvconvert --mergemirrors VG|LV_linear_raid|Tag ...
[ COMMON_OPTIONS ]
-

Convert LV to a thin LV, using the original LV as an external origin.

lvconvert --type thin --thinpool LV LV_linear_striped_cache_raid
[ -T|--thin ]
[ -r|--readahead auto|none|Number ]
[ -c|--chunksize Size[k|UNIT] ]
[ -Z|--zero y|n ]
[ --originname LV_new ]
[ --poolmetadata LV ]
[ --poolmetadatasize Size[m|UNIT] ]
[ --poolmetadataspare y|n ]
[ --metadataprofile String ]
[ COMMON_OPTIONS ]
-

Convert LV to type cache.

lvconvert --type cache --cachepool LV LV_linear_striped_thinpool_raid
[ -H|--cache ]
[ -Z|--zero y|n ]
[ -r|--readahead auto|none|Number ]
[ -c|--chunksize Size[k|UNIT] ]
[ --cachemetadataformat auto|1|2 ]
[ --cachemode writethrough|writeback|passthrough ]
[ --cachepolicy String ]
[ --cachesettings String ]
[ --poolmetadata LV ]
[ --poolmetadatasize Size[m|UNIT] ]
[ --poolmetadataspare y|n ]
[ --metadataprofile String ]
[ COMMON_OPTIONS ]
-

Convert LV to type thin-pool.

lvconvert --type thin-pool LV_linear_striped_cache_raid
[ -I|--stripesize Size[k|UNIT] ]
[ -r|--readahead auto|none|Number ]
[ -c|--chunksize Size[k|UNIT] ]
[ -Z|--zero y|n ]
[ --stripes Number ]
[ --discards passdown|nopassdown|ignore ]
[ --poolmetadata LV ]
[ --poolmetadatasize Size[m|UNIT] ]
[ --poolmetadataspare y|n ]
[ --metadataprofile String ]
[ COMMON_OPTIONS ]
[ PV ... ]
-

Convert LV to type cache-pool.

lvconvert --type cache-pool LV_linear_striped_raid
[ -Z|--zero y|n ]
[ -r|--readahead auto|none|Number ]
[ -c|--chunksize Size[k|UNIT] ]
[ --cachemetadataformat auto|1|2 ]
[ --cachemode writethrough|writeback|passthrough ]
[ --cachepolicy String ]
[ --cachesettings String ]
[ --poolmetadata LV ]
[ --poolmetadatasize Size[m|UNIT] ]
[ --poolmetadataspare y|n ]
[ --metadataprofile String ]
[ COMMON_OPTIONS ]
[ PV ... ]
-

Separate and keep the cache pool from a cache LV.

lvconvert --splitcache LV_thinpool_cache_cachepool
[ COMMON_OPTIONS ]
-

Merge thin LV into its origin LV.

lvconvert --mergethin LV_thin ...
[ COMMON_OPTIONS ]
-

Merge COW snapshot LV into its origin.

lvconvert --mergesnapshot LV_snapshot ...
[ -i|--interval Number ]
[ COMMON_OPTIONS ]
-

Combine a former COW snapshot (second arg) with a former
origin LV (first arg) to reverse a splitsnapshot command.

lvconvert --type snapshot LV LV_linear
[ -s|--snapshot ]
[ -c|--chunksize Size[k|UNIT] ]
[ -Z|--zero y|n ]
[ COMMON_OPTIONS ]
-

Replace failed PVs in a raid or mirror LV.
Repair a thin pool.
Repair a cache pool.

lvconvert --repair LV_thinpool_cache_cachepool_mirror_raid
[ -i|--interval Number ]
[ --usepolicies ]
[ --poolmetadataspare y|n ]
[ COMMON_OPTIONS ]
[ PV ... ]
-

Replace specific PV(s) in a raid LV with another PV.

lvconvert --replace PV LV_raid
[ COMMON_OPTIONS ]
[ PV ... ]
-

Poll LV to continue conversion.

lvconvert --startpoll LV_mirror_raid
[ COMMON_OPTIONS ]
-

Common options for command:
[ -b|--background ]
[ -f|--force ]
[ --alloc contiguous|cling|cling_by_tags|normal|anywhere|inherit ]
[ --noudevsync ]

Common options for lvm:
[ -d|--debug ]
[ -h|--help ]
[ -q|--quiet ]
[ -t|--test ]
[ -v|--verbose ]
[ -y|--yes ]
[ --commandprofile String ]
[ --config String ]
[ --driverloaded y|n ]
[ --longhelp ]
[ --profile String ]
[ --version ]

OPTIONS
--alloc contiguous|cling|cling_by_tags|normal|anywhere|inherit
Determines the allocation policy when a command needs to allocate Physical Extents (PEs) from the VG. Each VG and LV has an allocation policy which can be changed with vgchange/lvchange, or overriden on the command
line. normal applies common sense rules such as not placing parallel stripes on the same PV. inherit applies the VG policy to an LV. contiguous requires new PEs be placed adjacent to existing PEs. cling places
new PEs on the same PV as existing PEs in the same stripe of the LV. If there are sufficient PEs for an allocation, but normal does not use them, anywhere will use them even if it reduces performance, e.g. by
placing two stripes on the same PV. Optional positional PV args on the command line can also be used to limit which PVs the command will use for allocation. See lvm(8) for more information about allocation.

-b|--background
If the operation requires polling, this option causes the command to return before the operation is complete, and polling is done in the background.

-H|--cache
Specifies the command is handling a cache LV or cache pool. See --type cache and --type cache-pool. See lvmcache(7) for more information about LVM caching.

--cachemetadataformat auto|1|2
Specifies the cache metadata format used by cache target.

--cachemode writethrough|writeback|passthrough
Specifies when writes to a cache LV should be considered complete. writeback considers a write complete as soon as it is stored in the cache pool. writethough considers a write complete only when it has been
stored in both the cache pool and on the origin LV. While writethrough may be slower for writes, it is more resilient if something should happen to a device associated with the cache pool LV. With passthrough, all
reads are served from the origin LV (all reads miss the cache) and all writes are forwarded to the origin LV; additionally, write hits cause cache block invalidates. See lvmcache(7) for more information.

--cachepolicy String
Specifies the cache policy for a cache LV. See lvmcache(7) for more information.

--cachepool LV
The name of a cache pool LV.

--cachesettings String
Specifies tunable values for a cache LV in "Key = Value" form. Repeat this option to specify multiple values. (The default values should usually be adequate.) The special string value default switches settings
back to their default kernel values and removes them from the list of settings stored in LVM metadata. See lvmcache(7) for more information.

-c|--chunksize Size[k|UNIT]
The size of chunks in a snapshot, cache pool or thin pool. For snapshots, the value must be a power of 2 between 4KiB and 512KiB and the default value is 4. For a cache pool the value must be between 32KiB and
1GiB and the default value is 64. For a thin pool the value must be between 64KiB and 1GiB and the default value starts with 64 and scales up to fit the pool metadata size within 128MiB, if the pool metadata size
is not specified. The value must be a multiple of 64KiB. See lvmthin(7) and lvmcache(7) for more information.

--commandprofile String
The command profile to use for command configuration. See lvm.conf(5) for more information about profiles.

--config String
Config settings for the command. These override lvm.conf settings. The String arg uses the same format as lvm.conf, or may use section/field syntax. See lvm.conf(5) for more information about config.

-d|--debug ...
Set debug level. Repeat from 1 to 6 times to increase the detail of messages sent to the log file and/or syslog (if configured).

--discards passdown|nopassdown|ignore
Specifies how the device-mapper thin pool layer in the kernel should handle discards. ignore causes the thin pool to ignore discards. nopassdown causes the thin pool to process discards itself to allow reuse of
unneeded extents in the thin pool. passdown causes the thin pool to process discards itself (like nopassdown) and pass the discards to the underlying device. See lvmthin(7) for more information.

--driverloaded y|n
If set to no, the command will not attempt to use device-mapper. For testing and debugging.

-f|--force ...
Override various checks, confirmations and protections. Use with extreme caution.

-h|--help
Display help text.

-i|--interval Number
Report progress at regular intervals.

--longhelp
Display long help text.

--merge
An alias for --mergethin, --mergemirrors, or --mergesnapshot, depending on the type of LV.

--mergemirrors
Merge LV images that were split from a raid1 LV. See --splitmirrors with --trackchanges.

--mergesnapshot
Merge COW snapshot LV into its origin. When merging a snapshot, if both the origin and snapshot LVs are not open, the merge will start immediately. Otherwise, the merge will start the first time either the origin
or snapshot LV are activated and both are closed. Merging a snapshot into an origin that cannot be closed, for example a root filesystem, is deferred until the next time the origin volume is activated. When merging
starts, the resulting LV will have the origin's name, minor number and UUID. While the merge is in progress, reads or writes to the origin appear as being directed to the snapshot being merged. When the merge fin‐
ishes, the merged snapshot is removed. Multiple snapshots may be specified on the command line or a @tag may be used to specify multiple snapshots be merged to their respective origin.

--mergethin
Merge thin LV into its origin LV. The origin thin LV takes the content of the thin snapshot, and the thin snapshot LV is removed. See lvmthin(7) for more information.

--metadataprofile String
The metadata profile to use for command configuration. See lvm.conf(5) for more information about profiles.

--mirrorlog core|disk
Specifies the type of mirror log for LVs with the "mirror" type (does not apply to the "raid1" type.) disk is a persistent log and requires a small amount of storage space, usually on a separate device from the
data being mirrored. core is not persistent; the log is kept only in memory. In this case, the mirror must be synchronized (by copying LV data from the first device to others) each time the LV is activated, e.g.
after reboot. mirrored is a persistent log that is itself mirrored, but should be avoided. Instead, use the raid1 type for log redundancy.

-m|--mirrors [+|-]Number
Specifies the number of mirror images in addition to the original LV image, e.g. --mirrors 1 means there are two images of the data, the original and one mirror image. Optional positional PV args on the command
line can specify the devices the images should be placed on. There are two mirroring implementations: "raid1" and "mirror". These are the names of the corresponding LV types, or "segment types". Use the --type
option to specify which to use (raid1 is default, and mirror is legacy) Use lvm.conf global/mirror_segtype_default and global/raid10_segtype_default to configure the default types. The plus prefix + can be used,
in which case the number is added to the current number of images, or the minus prefix - can be used, in which case the number is subtracted from the current number of images. See lvmraid(7) for more information.

-n|--name String
Specifies the name of a new LV. When unspecified, a default name of "lvol#" is generated, where # is a number generated by LVM.

--noudevsync
Disables udev synchronisation. The process will not wait for notification from udev. It will continue irrespective of any possible udev processing in the background. Only use this if udev is not running or has
rules that ignore the devices LVM creates.

--originname LV
Specifies the name to use for the external origin LV when converting an LV to a thin LV. The LV being converted becomes a read-only external origin with this name.

--poolmetadata LV
The name of a an LV to use for storing pool metadata.

--poolmetadatasize Size[m|UNIT]
Specifies the size of the new pool metadata LV.

--poolmetadataspare y|n
Enable or disable the automatic creation and management of a spare pool metadata LV in the VG. A spare metadata LV is reserved space that can be used when repairing a pool.

--profile String
An alias for --commandprofile or --metadataprofile, depending on the command.

-q|--quiet ...
Suppress output and log messages. Overrides --debug and --verbose. Repeat once to also suppress any prompts with answer 'no'.

-r|--readahead auto|none|Number
Sets read ahead sector count of an LV. auto is the default which allows the kernel to choose a suitable value automatically. none is equivalent to zero.

-R|--regionsize Size[m|UNIT]
Size of each raid or mirror synchronization region. lvm.conf activation/raid_region_size can be used to configure a default.

--repair
Replace failed PVs in a raid or mirror LV, or run a repair utility on a thin pool. See lvmraid(7) and lvmthin(7) for more information.

--replace PV
Replace a specific PV in a raid LV with another PV. The new PV to use can be optionally specified after the LV. Multiple PVs can be replaced by repeating this option. See lvmraid(7) for more information.

-s|--snapshot
Combine a former COW snapshot LV with a former origin LV to reverse a previous --splitsnapshot command.

--splitcache
Separates a cache pool from a cache LV, and keeps the unused cache pool LV. Before the separation, the cache is flushed. Also see --uncache.

--splitmirrors Number
Splits the specified number of images from a raid1 or mirror LV and uses them to create a new LV. If --trackchanges is also specified, changes to the raid1 LV are tracked while the split LV remains detached.

--splitsnapshot
Separates a COW snapshot from its origin LV. The LV that is split off contains the chunks that differ from the origin LV along with metadata describing them. This LV can be wiped and then destroyed with lvremove.

--startpoll
Start polling an LV to continue processing a conversion.

--stripes Number
Specifies the number of stripes in a striped LV. This is the number of PVs (devices) that a striped LV is spread across. Data that appears sequential in the LV is spread across multiple devices in units of the
stripe size (see --stripesize). This does not apply to existing allocated space, only newly allocated space can be striped.

-I|--stripesize Size[k|UNIT]
The amount of data that is written to one device before moving to the next in a striped LV.

--swapmetadata
Extracts the metadata LV from a pool and replaces it with another specified LV. The extracted LV is preserved and given the name of the LV that replaced it. Use for repair only. When the metadata LV is swapped
out of the pool, it can be activated directly and used with thin provisioning tools: cache_dump(8), cache_repair(8), cache_restore(8), thin_dump(8), thin_repair(8), thin_restore(8).

-t|--test
Run in test mode. Commands will not update metadata. This is implemented by disabling all metadata writing but nevertheless returning success to the calling function. This may lead to unusual error messages in
multi-stage operations if a tool relies on reading back metadata it believes has changed but hasn't.

-T|--thin
Specifies the command is handling a thin LV or thin pool. See --type thin, --type thin-pool, and --virtualsize. See lvmthin(7) for more information about LVM thin provisioning.

--thinpool LV
The name of a thin pool LV.

--trackchanges
Can be used with --splitmirrors on a raid1 LV. This causes changes to the original raid1 LV to be tracked while the split images remain detached. This allows the read-only detached image(s) to be merged efficiently
back into the raid1 LV later. Only the regions with changed data are resynchronized during merge. (This option only applies when using the raid1 LV type.)

--type linear|striped|snapshot|mirror|raid|thin|cache|thin-pool|cache-pool
The LV type, also known as "segment type" or "segtype". See usage descriptions for the specific ways to use these types. For more information about redundancy and performance (raid<N>, mirror, striped, linear)
see lvmraid(7). For thin provisioning (thin, thin-pool) see lvmthin(7). For performance caching (cache, cache-pool) see lvmcache(7). For copy-on-write snapshots (snapshot) see usage definitions. Several com‐
mands omit an explicit type option because the type is inferred from other options or shortcuts (e.g. --stripes, --mirrors, --snapshot, --virtualsize, --thin, --cache). Use inferred types with care because it can
lead to unexpected results.

--uncache
Separates a cache pool from a cache LV, and deletes the unused cache pool LV. Before the separation, the cache is flushed. Also see --splitcache.

--usepolicies
Perform an operation according to the policy configured in lvm.conf or a profile.

-v|--verbose ...
Set verbose level. Repeat from 1 to 4 times to increase the detail of messages sent to stdout and stderr.

--version
Display version information.

-y|--yes
Do not prompt for confirmation interactively but always assume the answer yes. Use with extreme caution. (For automatic no, see -qq.)

-Z|--zero y|n
For snapshots, this controls zeroing of the first 4KiB of data in the snapshot. If the LV is read-only, the snapshot will not be zeroed. For thin pools, this controls zeroing of provisioned blocks. Provisioning
of large zeroed chunks negatively impacts performance.

VARIABLES
VG
Volume Group name. See lvm(8) for valid names.

LV
Logical Volume name. See lvm(8) for valid names. An LV positional arg generally includes the VG name and LV name, e.g. VG/LV. LV followed by _<type> indicates that an LV of the given type is required. (raid rep‐
resents raid<N> type)

PV
Physical Volume name, a device path under /dev. For commands managing physical extents, a PV positional arg generally accepts a suffix indicating a range (or multiple ranges) of physical extents (PEs). When the
first PE is omitted, it defaults to the start of the device, and when the last PE is omitted it defaults to end. Start and end range (inclusive): PV[:PE-PE]... Start and length range (counting from 0):
PV[:PE+PE]...

Tag
Tag name. See lvm(8) for information about tag names and using tags in place of a VG, LV or PV.

String
See the option description for information about the string content.

Size[UNIT]
Size is an input number that accepts an optional unit. Input units are always treated as base two values, regardless of capitalization, e.g. 'k' and 'K' both refer to 1024. The default input unit is specified by
letter, followed by |UNIT. UNIT represents other possible input units: bBsSkKmMgGtTpPeE. b|B is bytes, s|S is sectors of 512 bytes, k|K is kilobytes, m|M is megabytes, g|G is gigabytes, t|T is terabytes, p|P is
petabytes, e|E is exabytes. (This should not be confused with the output control --units, where capital letters mean multiple of 1000.)

ENVIRONMENT VARIABLES
See lvm(8) for information about environment variables used by lvm. For example, LVM_VG_NAME can generally be substituted for a required VG parameter.

ADVANCED USAGE
Alternate command forms, advanced command usage, and listing of all valid syntax for completeness.

Convert LV to type mirror (also see type raid1),
(also see lvconvert --mirrors).

lvconvert --type mirror LV
[ -m|--mirrors [+|-]Number ]
[ -R|--regionsize Size[m|UNIT] ]
[ -i|--interval Number ]
[ --mirrorlog core|disk ]
[ COMMON_OPTIONS ]
[ PV ... ]
-

Change the region size of an LV.

lvconvert -R|--regionsize Size[m|UNIT] LV_raid
[ COMMON_OPTIONS ]
-

Change the type of mirror log used by a mirror LV.

lvconvert --mirrorlog core|disk LV_mirror
[ COMMON_OPTIONS ]
[ PV ... ]
-

Convert LV to a thin LV, using the original LV as an external origin
(infers --type thin).

lvconvert -T|--thin --thinpool LV LV_linear_striped_cache_raid
[ -r|--readahead auto|none|Number ]
[ -c|--chunksize Size[k|UNIT] ]
[ -Z|--zero y|n ]
[ --type thin ]
[ --originname LV_new ]
[ --poolmetadata LV ]
[ --poolmetadatasize Size[m|UNIT] ]
[ --poolmetadataspare y|n ]
[ --metadataprofile String ]
[ COMMON_OPTIONS ]
-

Convert LV to type cache (infers --type cache).

lvconvert -H|--cache --cachepool LV LV_linear_striped_thinpool_raid
[ -Z|--zero y|n ]
[ -r|--readahead auto|none|Number ]
[ -c|--chunksize Size[k|UNIT] ]
[ --type cache ]
[ --cachemetadataformat auto|1|2 ]
[ --cachemode writethrough|writeback|passthrough ]
[ --cachepolicy String ]
[ --cachesettings String ]
[ --poolmetadata LV ]
[ --poolmetadatasize Size[m|UNIT] ]
[ --poolmetadataspare y|n ]
[ --metadataprofile String ]
[ COMMON_OPTIONS ]
-

Separate and delete the cache pool from a cache LV.

lvconvert --uncache LV_thinpool_cache
[ COMMON_OPTIONS ]
-

Swap metadata LV in a thin pool or cache pool (for repair only).

lvconvert --swapmetadata --poolmetadata LV LV_thinpool_cachepool
[ -c|--chunksize Size[k|UNIT] ]
[ COMMON_OPTIONS ]
-

Merge LV that was split from a mirror (variant, use --mergemirrors).
Merge thin LV into its origin LV (variant, use --mergethin).
Merge COW snapshot LV into its origin (variant, use --mergesnapshot).

lvconvert --merge VG|LV_linear_striped_snapshot_thin_raid|Tag ...
[ -i|--interval Number ]
[ COMMON_OPTIONS ]
-

Separate a COW snapshot from its origin LV.

lvconvert --splitsnapshot LV_snapshot
[ COMMON_OPTIONS ]
-

Combine a former COW snapshot (second arg) with a former
origin LV (first arg) to reverse a splitsnapshot command.

lvconvert -s|--snapshot LV LV_linear
[ -c|--chunksize Size[k|UNIT] ]
[ -Z|--zero y|n ]
[ --type snapshot ]
[ COMMON_OPTIONS ]
-

Poll LV to continue conversion (also see --startpoll).

lvconvert LV_mirror_raid
[ COMMON_OPTIONS ]
-

NOTES
This previous command syntax would perform two different operations:
lvconvert --thinpool LV1 --poolmetadata LV2
If LV1 was not a thin pool, the command would convert LV1 to a thin pool, optionally using a specified LV for metadata. But, if LV1 was already a thin pool, the command would swap the current metadata LV with LV2 (for
repair purposes.)

In the same way, this previous command syntax would perform two different operations:
lvconvert --cachepool LV1 --poolmetadata LV2
If LV1 was not a cache pool, the command would convert LV1 to a cache pool, optionally using a specified LV for metadata. But, if LV1 was already a cache pool, the command would swap the current metadata LV with LV2 (for
repair purposes.)

EXAMPLES
Convert a linear LV to a two-way mirror LV.
lvconvert --type mirror --mirrors 1 vg/lvol1

Convert a linear LV to a two-way RAID1 LV.
lvconvert --type raid1 --mirrors 1 vg/lvol1

Convert a mirror LV to use an in-memory log.
lvconvert --mirrorlog core vg/lvol1

Convert a mirror LV to use a disk log.
lvconvert --mirrorlog disk vg/lvol1

Convert a mirror or raid1 LV to a linear LV.
lvconvert --type linear vg/lvol1

Convert a mirror LV to a raid1 LV with the same number of images.
lvconvert --type raid1 vg/lvol1

Convert a linear LV to a two-way mirror LV, allocating new extents from specific PV ranges.
lvconvert --mirrors 1 vg/lvol1 /dev/sda:0-15 /dev/sdb:0-15

Convert a mirror LV to a linear LV, freeing physical extents from a specific PV.
lvconvert --type linear vg/lvol1 /dev/sda

Split one image from a mirror or raid1 LV, making it a new LV.
lvconvert --splitmirrors 1 --name lv_split vg/lvol1

Split one image from a raid1 LV, and track changes made to the raid1 LV while the split image remains detached.
lvconvert --splitmirrors 1 --trackchanges vg/lvol1

Merge an image (that was previously created with --splitmirrors and --trackchanges) back into the original raid1 LV.
lvconvert --mergemirrors vg/lvol1_rimage_1

Replace PV /dev/sdb1 with PV /dev/sdf1 in a raid1/4/5/6/10 LV.
lvconvert --replace /dev/sdb1 vg/lvol1 /dev/sdf1

Replace 3 PVs /dev/sd[b-d]1 with PVs /dev/sd[f-h]1 in a raid1 LV.
lvconvert --replace /dev/sdb1 --replace /dev/sdc1 --replace /dev/sdd1
vg/lvol1 /dev/sd[fgh]1

Replace the maximum of 2 PVs /dev/sd[bc]1 with PVs /dev/sd[gh]1 in a raid6 LV.
lvconvert --replace /dev/sdb1 --replace /dev/sdc1 vg/lvol1 /dev/sd[gh]1

Convert an LV into a thin LV in the specified thin pool. The existing LV is used as an external read-only origin for the new thin LV.
lvconvert --type thin --thinpool vg/tpool1 vg/lvol1

Convert an LV into a thin LV in the specified thin pool. The existing LV is used as an external read-only origin for the new thin LV, and is renamed "external".
lvconvert --type thin --thinpool vg/tpool1
--originname external vg/lvol1

Convert an LV to a cache pool LV using another specified LV for cache pool metadata.
lvconvert --type cache-pool --poolmetadata vg/poolmeta1 vg/lvol1

Convert an LV to a cache LV using the specified cache pool and chunk size.
lvconvert --type cache --cachepool vg/cpool1 -c 128 vg/lvol1

Detach and keep the cache pool from a cache LV.
lvconvert --splitcache vg/lvol1

Detach and remove the cache pool from a cache LV.
lvconvert --uncache vg/lvol1

SEE ALSO
lvm(8) lvm.conf(5) lvmconfig(8)

pvchange(8) pvck(8) pvcreate(8) pvdisplay(8) pvmove(8) pvremove(8) pvresize(8) pvs(8) pvscan(8)

vgcfgbackup(8) vgcfgrestore(8) vgchange(8) vgck(8) vgcreate(8) vgconvert(8) vgdisplay(8) vgexport(8) vgextend(8) vgimport(8) vgimportclone(8) vgmerge(8) vgmknodes(8) vgreduce(8) vgremove(8) vgrename(8) vgs(8) vgscan(8)
vgsplit(8)

lvcreate(8) lvchange(8) lvconvert(8) lvdisplay(8) lvextend(8) lvreduce(8) lvremove(8) lvrename(8) lvresize(8) lvs(8) lvscan(8)

lvm-fullreport(8) lvm-lvpoll(8) lvm2-activation-generator(8) blkdeactivate(8) lvmdump(8)

dmeventd(8) lvmetad(8) lvmpolld(8) lvmlockd(8) lvmlockctl(8) clvmd(8) cmirrord(8) lvmdbusd(8)

lvmsystemid(7) lvmreport(7) lvmraid(7) lvmthin(7) lvmcache(7)

Red Hat, Inc. LVM TOOLS 2.02.176(2) (2017-11-03) LVCONVERT(8)

lvcreate

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
LVCREATE(8)                                                                                            System Manager's Manual                                                                                           LVCREATE(8)

NAME
lvcreate - Create a logical volume

SYNOPSIS
lvcreate option_args position_args
[ option_args ]
[ position_args ]

-a|--activate y|n|ay
--addtag Tag
--alloc contiguous|cling|cling_by_tags|normal|anywhere|inherit
-A|--autobackup y|n
-H|--cache
--cachemetadataformat auto|1|2
--cachemode writethrough|writeback|passthrough
--cachepolicy String
--cachepool LV
--cachesettings String
-c|--chunksize Size[k|UNIT]
--commandprofile String
--config String
-C|--contiguous y|n
-d|--debug
--discards passdown|nopassdown|ignore
--driverloaded y|n
--errorwhenfull y|n
-l|--extents Number[PERCENT]
-h|--help
-K|--ignoreactivationskip
--ignoremonitoring
--longhelp
-j|--major Number
--[raid]maxrecoveryrate Size[k|UNIT]
--metadataprofile String
--minor Number
--[raid]minrecoveryrate Size[k|UNIT]
--mirrorlog core|disk
-m|--mirrors Number
--monitor y|n
-n|--name String
--nosync
--noudevsync
-p|--permission rw|r
-M|--persistent y|n
--poolmetadatasize Size[m|UNIT]
--poolmetadataspare y|n
--profile String
-q|--quiet
-r|--readahead auto|none|Number
-R|--regionsize Size[m|UNIT]
--reportformat basic|json
-k|--setactivationskip y|n
-L|--size Size[m|UNIT]
-s|--snapshot
-i|--stripes Number
-I|--stripesize Size[k|UNIT]
-t|--test
-T|--thin
--thinpool LV
--type linear|striped|snapshot|mirror|raid|thin|cache|thin-pool|cache-pool
-v|--verbose
--version
-V|--virtualsize Size[m|UNIT]
-W|--wipesignatures y|n
-y|--yes
-Z|--zero y|n

DESCRIPTION
lvcreate creates a new LV in a VG. For standard LVs, this requires allocating logical extents from the VG's free physical extents. If there is not enough free space, the VG can be extended with other PVs (vgextend(8)), or
existing LVs can be reduced or removed (lvremove(8), lvreduce(8).)

To control which PVs a new LV will use, specify one or more PVs as position args at the end of the command line. lvcreate will allocate physical extents only from the specified PVs.

lvcreate can also create snapshots of existing LVs, e.g. for backup purposes. The data in a new snapshot LV represents the content of the original LV from the time the snapshot was created.

RAID LVs can be created by specifying an LV type when creating the LV (see lvmraid(7)). Different RAID levels require different numbers of unique PVs be available in the VG for allocation.

Thin pools (for thin provisioning) and cache pools (for caching) are represented by special LVs with types thin-pool and cache-pool (see lvmthin(7) and lvmcache(7)). The pool LVs are not usable as standard block devices,
but the LV names act as references to the pools.

Thin LVs are thinly provisioned from a thin pool, and are created with a virtual size rather than a physical size. A cache LV is the combination of a standard LV with a cache pool, used to cache active portions of the LV
to improve performance.

Usage notes
In the usage section below, --size Size can be replaced with --extents Number. See descriptions in the options section.

In the usage section below, --name is omitted from the required options, even though it is typically used. When the name is not specified, a new LV name is generated with the "lvol" prefix and a unique numeric suffix.

USAGE
Create a linear LV.

lvcreate -L|--size Size[m|UNIT] VG
[ -l|--extents Number[PERCENT] ]
[ --type linear ]
[ COMMON_OPTIONS ]
[ PV ... ]
-

Create a striped LV (infers --type striped).

lvcreate -i|--stripes Number -L|--size Size[m|UNIT] VG
[ -l|--extents Number[PERCENT] ]
[ -I|--stripesize Size[k|UNIT] ]
[ COMMON_OPTIONS ]
[ PV ... ]
-

Create a raid1 or mirror LV (infers --type raid1|mirror).

lvcreate -m|--mirrors Number -L|--size Size[m|UNIT] VG
[ -l|--extents Number[PERCENT] ]
[ -R|--regionsize Size[m|UNIT] ]
[ --mirrorlog core|disk ]
[ --[raid]minrecoveryrate Size[k|UNIT] ]
[ --[raid]maxrecoveryrate Size[k|UNIT] ]
[ COMMON_OPTIONS ]
[ PV ... ]
-

Create a raid LV (a specific raid level must be used, e.g. raid1).

lvcreate --type raid -L|--size Size[m|UNIT] VG
[ -l|--extents Number[PERCENT] ]
[ -m|--mirrors Number ]
[ -i|--stripes Number ]
[ -I|--stripesize Size[k|UNIT] ]
[ -R|--regionsize Size[m|UNIT] ]
[ --[raid]minrecoveryrate Size[k|UNIT] ]
[ --[raid]maxrecoveryrate Size[k|UNIT] ]
[ COMMON_OPTIONS ]
[ PV ... ]
-

Create a raid10 LV.

lvcreate -m|--mirrors Number -i|--stripes Number
-L|--size Size[m|UNIT] VG
[ -l|--extents Number[PERCENT] ]
[ -I|--stripesize Size[k|UNIT] ]
[ -R|--regionsize Size[m|UNIT] ]
[ --[raid]minrecoveryrate Size[k|UNIT] ]
[ --[raid]maxrecoveryrate Size[k|UNIT] ]
[ COMMON_OPTIONS ]
[ PV ... ]
-

Create a COW snapshot LV of an origin LV.

lvcreate -s|--snapshot -L|--size Size[m|UNIT] LV
[ -l|--extents Number[PERCENT] ]
[ -i|--stripes Number ]
[ -I|--stripesize Size[k|UNIT] ]
[ -c|--chunksize Size[k|UNIT] ]
[ --type snapshot ]
[ COMMON_OPTIONS ]
[ PV ... ]
-

Create a thin pool.

lvcreate --type thin-pool -L|--size Size[m|UNIT] VG
[ -l|--extents Number[PERCENT] ]
[ -c|--chunksize Size[k|UNIT] ]
[ -i|--stripes Number ]
[ -I|--stripesize Size[k|UNIT] ]
[ --thinpool LV_new ]
[ --poolmetadatasize Size[m|UNIT] ]
[ --poolmetadataspare y|n ]
[ --discards passdown|nopassdown|ignore ]
[ --errorwhenfull y|n ]
[ COMMON_OPTIONS ]
[ PV ... ]
-

Create a cache pool.

lvcreate --type cache-pool -L|--size Size[m|UNIT] VG
[ -l|--extents Number[PERCENT] ]
[ -H|--cache ]
[ -c|--chunksize Size[k|UNIT] ]
[ --poolmetadatasize Size[m|UNIT] ]
[ --poolmetadataspare y|n ]
[ --cachemode writethrough|writeback|passthrough ]
[ --cachepolicy String ]
[ --cachesettings String ]
[ --cachemetadataformat auto|1|2 ]
[ COMMON_OPTIONS ]
[ PV ... ]
-

Create a thin LV in a thin pool (infers --type thin).

lvcreate -V|--virtualsize Size[m|UNIT] --thinpool LV_thinpool VG
[ -T|--thin ]
[ --type thin ]
[ --discards passdown|nopassdown|ignore ]
[ --errorwhenfull y|n ]
[ COMMON_OPTIONS ]
-

Create a thin LV that is a snapshot of an existing thin LV
(infers --type thin).

lvcreate -s|--snapshot LV_thin
[ --type thin ]
[ --discards passdown|nopassdown|ignore ]
[ --errorwhenfull y|n ]
[ COMMON_OPTIONS ]
-

Create a thin LV that is a snapshot of an external origin LV.

lvcreate --type thin --thinpool LV_thinpool LV
[ -T|--thin ]
[ -c|--chunksize Size[k|UNIT] ]
[ --poolmetadatasize Size[m|UNIT] ]
[ --poolmetadataspare y|n ]
[ --discards passdown|nopassdown|ignore ]
[ --errorwhenfull y|n ]
[ COMMON_OPTIONS ]
-

Create a thin LV, first creating a thin pool for it,
where the new thin pool is named by the --thinpool arg.

lvcreate --type thin -V|--virtualsize Size[m|UNIT]
-L|--size Size[m|UNIT] --thinpool LV_new
[ -l|--extents Number[PERCENT] ]
[ -T|--thin ]
[ -c|--chunksize Size[k|UNIT] ]
[ -i|--stripes Number ]
[ -I|--stripesize Size[k|UNIT] ]
[ --poolmetadatasize Size[m|UNIT] ]
[ --poolmetadataspare y|n ]
[ --discards passdown|nopassdown|ignore ]
[ --errorwhenfull y|n ]
[ COMMON_OPTIONS ]
[ PV ... ]
-

Create a cache LV, first creating a new origin LV,
then combining it with the existing cache pool named
by the --cachepool arg.

lvcreate --type cache -L|--size Size[m|UNIT]
--cachepool LV_cachepool VG
[ -l|--extents Number[PERCENT] ]
[ -H|--cache ]
[ -c|--chunksize Size[k|UNIT] ]
[ -i|--stripes Number ]
[ -I|--stripesize Size[k|UNIT] ]
[ --poolmetadatasize Size[m|UNIT] ]
[ --poolmetadataspare y|n ]
[ --cachemode writethrough|writeback|passthrough ]
[ --cachepolicy String ]
[ --cachesettings String ]
[ --cachemetadataformat auto|1|2 ]
[ COMMON_OPTIONS ]
[ PV ... ]
-

Common options for command:
[ -a|--activate y|n|ay ]
[ -A|--autobackup y|n ]
[ -C|--contiguous y|n ]
[ -K|--ignoreactivationskip ]
[ -j|--major Number ]
[ -n|--name String ]
[ -p|--permission rw|r ]
[ -M|--persistent y|n ]
[ -r|--readahead auto|none|Number ]
[ -k|--setactivationskip y|n ]
[ -W|--wipesignatures y|n ]
[ -Z|--zero y|n ]
[ --addtag Tag ]
[ --alloc contiguous|cling|cling_by_tags|normal|anywhere|inherit ]
[ --ignoremonitoring ]
[ --metadataprofile String ]
[ --minor Number ]
[ --monitor y|n ]
[ --nosync ]
[ --noudevsync ]
[ --reportformat basic|json ]

Common options for lvm:
[ -d|--debug ]
[ -h|--help ]
[ -q|--quiet ]
[ -t|--test ]
[ -v|--verbose ]
[ -y|--yes ]
[ --commandprofile String ]
[ --config String ]
[ --driverloaded y|n ]
[ --longhelp ]
[ --profile String ]
[ --version ]

OPTIONS
-a|--activate y|n|ay
Controls the active state of the new LV. y makes the LV active, or available. New LVs are made active by default. n makes the LV inactive, or unavailable, only when possible. In some cases, creating an LV
requires it to be active. For example, COW snapshots of an active origin LV can only be created in the active state (this does not apply to thin snapshots). The --zero option normally requires the LV to be
active. If autoactivation ay is used, the LV is only activated if it matches an item in lvm.conf activation/auto_activation_volume_list. ay implies --zero n and --wipesignatures n. See lvmlockd(8) for more
information about activation options for shared VGs. See clvmd(8) for more information about activation options for clustered VGs.

--addtag Tag
Adds a tag to a PV, VG or LV. This option can be repeated to add multiple tags at once. See lvm(8) for information about tags.

--alloc contiguous|cling|cling_by_tags|normal|anywhere|inherit
Determines the allocation policy when a command needs to allocate Physical Extents (PEs) from the VG. Each VG and LV has an allocation policy which can be changed with vgchange/lvchange, or overriden on the command
line. normal applies common sense rules such as not placing parallel stripes on the same PV. inherit applies the VG policy to an LV. contiguous requires new PEs be placed adjacent to existing PEs. cling places
new PEs on the same PV as existing PEs in the same stripe of the LV. If there are sufficient PEs for an allocation, but normal does not use them, anywhere will use them even if it reduces performance, e.g. by
placing two stripes on the same PV. Optional positional PV args on the command line can also be used to limit which PVs the command will use for allocation. See lvm(8) for more information about allocation.

-A|--autobackup y|n
Specifies if metadata should be backed up automatically after a change. Enabling this is strongly advised! See vgcfgbackup(8) for more information.

-H|--cache
Specifies the command is handling a cache LV or cache pool. See --type cache and --type cache-pool. See lvmcache(7) for more information about LVM caching.

--cachemetadataformat auto|1|2
Specifies the cache metadata format used by cache target.

--cachemode writethrough|writeback|passthrough
Specifies when writes to a cache LV should be considered complete. writeback considers a write complete as soon as it is stored in the cache pool. writethough considers a write complete only when it has been
stored in both the cache pool and on the origin LV. While writethrough may be slower for writes, it is more resilient if something should happen to a device associated with the cache pool LV. With passthrough, all
reads are served from the origin LV (all reads miss the cache) and all writes are forwarded to the origin LV; additionally, write hits cause cache block invalidates. See lvmcache(7) for more information.

--cachepolicy String
Specifies the cache policy for a cache LV. See lvmcache(7) for more information.

--cachepool LV
The name of a cache pool LV.

--cachesettings String
Specifies tunable values for a cache LV in "Key = Value" form. Repeat this option to specify multiple values. (The default values should usually be adequate.) The special string value default switches settings
back to their default kernel values and removes them from the list of settings stored in LVM metadata. See lvmcache(7) for more information.

-c|--chunksize Size[k|UNIT]
The size of chunks in a snapshot, cache pool or thin pool. For snapshots, the value must be a power of 2 between 4KiB and 512KiB and the default value is 4. For a cache pool the value must be between 32KiB and
1GiB and the default value is 64. For a thin pool the value must be between 64KiB and 1GiB and the default value starts with 64 and scales up to fit the pool metadata size within 128MiB, if the pool metadata size
is not specified. The value must be a multiple of 64KiB. See lvmthin(7) and lvmcache(7) for more information.

--commandprofile String
The command profile to use for command configuration. See lvm.conf(5) for more information about profiles.

--config String
Config settings for the command. These override lvm.conf settings. The String arg uses the same format as lvm.conf, or may use section/field syntax. See lvm.conf(5) for more information about config.

-C|--contiguous y|n
Sets or resets the contiguous allocation policy for LVs. Default is no contiguous allocation based on a next free principle. It is only possible to change a non-contiguous allocation policy to contiguous if all
of the allocated physical extents in the LV are already contiguous.

-d|--debug ...
Set debug level. Repeat from 1 to 6 times to increase the detail of messages sent to the log file and/or syslog (if configured).

--discards passdown|nopassdown|ignore
Specifies how the device-mapper thin pool layer in the kernel should handle discards. ignore causes the thin pool to ignore discards. nopassdown causes the thin pool to process discards itself to allow reuse of
unneeded extents in the thin pool. passdown causes the thin pool to process discards itself (like nopassdown) and pass the discards to the underlying device. See lvmthin(7) for more information.

--driverloaded y|n
If set to no, the command will not attempt to use device-mapper. For testing and debugging.

--errorwhenfull y|n
Specifies thin pool behavior when data space is exhausted. When yes, device-mapper will immediately return an error when a thin pool is full and an I/O request requires space. When no, device-mapper will queue
these I/O requests for a period of time to allow the thin pool to be extended. Errors are returned if no space is available after the timeout. (Also see dm-thin-pool kernel module option no_space_timeout.) See
lvmthin(7) for more information.

-l|--extents Number[PERCENT]
Specifies the size of the new LV in logical extents. The --size and --extents options are alternate methods of specifying size. The total number of physical extents used will be greater when redundant data is
needed for RAID levels. An alternate syntax allows the size to be determined indirectly as a percentage of the size of a related VG, LV, or set of PVs. The suffix %VG denotes the total size of the VG, the suffix
%FREE the remaining free space in the VG, and the suffix %PVS the free space in the specified PVs. For a snapshot, the size can be expressed as a percentage of the total size of the origin LV with the suffix %ORI‐
GIN (100%ORIGIN provides space for the whole origin). When expressed as a percentage, the size defines an upper limit for the number of logical extents in the new LV. The precise number of logical extents in the
new LV is not determined until the command has completed.

-h|--help
Display help text.

-K|--ignoreactivationskip
Ignore the "activation skip" LV flag during activation to allow LVs with the flag set to be activated.

--ignoremonitoring
Do not interact with dmeventd unless --monitor is specified. Do not use this if dmeventd is already monitoring a device.

--longhelp
Display long help text.

-j|--major Number
Sets the major number of an LV block device.

--[raid]maxrecoveryrate Size[k|UNIT]
Sets the maximum recovery rate for a RAID LV. The rate value is an amount of data per second for each device in the array. Setting the rate to 0 means it will be unbounded. See lvmraid(7) for more information.

--metadataprofile String
The metadata profile to use for command configuration. See lvm.conf(5) for more information about profiles.

--minor Number
Sets the minor number of an LV block device.

--[raid]minrecoveryrate Size[k|UNIT]
Sets the minimum recovery rate for a RAID LV. The rate value is an amount of data per second for each device in the array. Setting the rate to 0 means it will be unbounded. See lvmraid(7) for more information.

--mirrorlog core|disk
Specifies the type of mirror log for LVs with the "mirror" type (does not apply to the "raid1" type.) disk is a persistent log and requires a small amount of storage space, usually on a separate device from the
data being mirrored. core is not persistent; the log is kept only in memory. In this case, the mirror must be synchronized (by copying LV data from the first device to others) each time the LV is activated, e.g.
after reboot. mirrored is a persistent log that is itself mirrored, but should be avoided. Instead, use the raid1 type for log redundancy.

-m|--mirrors Number
Specifies the number of mirror images in addition to the original LV image, e.g. --mirrors 1 means there are two images of the data, the original and one mirror image. Optional positional PV args on the command
line can specify the devices the images should be placed on. There are two mirroring implementations: "raid1" and "mirror". These are the names of the corresponding LV types, or "segment types". Use the --type
option to specify which to use (raid1 is default, and mirror is legacy) Use lvm.conf global/mirror_segtype_default and global/raid10_segtype_default to configure the default types. See the --nosync option for
avoiding initial image synchronization. See lvmraid(7) for more information.

--monitor y|n
Start (yes) or stop (no) monitoring an LV with dmeventd. dmeventd monitors kernel events for an LV, and performs automated maintenance for the LV in reponse to specific events. See dmeventd(8) for more informa‐
tion.

-n|--name String
Specifies the name of a new LV. When unspecified, a default name of "lvol#" is generated, where # is a number generated by LVM.

--nosync
Causes the creation of mirror, raid1, raid4, raid5 and raid10 to skip the initial synchronization. In case of mirror, raid1 and raid10, any data written afterwards will be mirrored, but the original contents will
not be copied. In case of raid4 and raid5, no parity blocks will be written, though any data written afterwards will cause parity blocks to be stored. This is useful for skipping a potentially long and resource
intensive initial sync of an empty mirror/raid1/raid4/raid5 and raid10 LV. This option is not valid for raid6, because raid6 relies on proper parity (P and Q Syndromes) being created during initial synchronization
in order to reconstruct proper user date in case of device failures. raid0 and raid0_meta do not provide any data copies or parity support and thus do not support initial synchronization.

--noudevsync
Disables udev synchronisation. The process will not wait for notification from udev. It will continue irrespective of any possible udev processing in the background. Only use this if udev is not running or has
rules that ignore the devices LVM creates.

-p|--permission rw|r
Set access permission to read only r or read and write rw.

-M|--persistent y|n
When yes, makes the specified minor number persistent.

--poolmetadatasize Size[m|UNIT]
Specifies the size of the new pool metadata LV.

--poolmetadataspare y|n
Enable or disable the automatic creation and management of a spare pool metadata LV in the VG. A spare metadata LV is reserved space that can be used when repairing a pool.

--profile String
An alias for --commandprofile or --metadataprofile, depending on the command.

-q|--quiet ...
Suppress output and log messages. Overrides --debug and --verbose. Repeat once to also suppress any prompts with answer 'no'.

-r|--readahead auto|none|Number
Sets read ahead sector count of an LV. auto is the default which allows the kernel to choose a suitable value automatically. none is equivalent to zero.

-R|--regionsize Size[m|UNIT]
Size of each raid or mirror synchronization region. lvm.conf activation/raid_region_size can be used to configure a default.

--reportformat basic|json
Overrides current output format for reports which is defined globally by the report/output_format setting in lvm.conf. basic is the original format with columns and rows. If there is more than one report per com‐
mand, each report is prefixed with the report name for identification. json produces report output in JSON format. See lvmreport(7) for more information.

-k|--setactivationskip y|n
Persistently sets (yes) or clears (no) the "activation skip" flag on an LV. An LV with this flag set is not activated unless the --ignoreactivationskip option is used by the activation command. This flag is set
by default on new thin snapshot LVs. The flag is not applied to deactivation. The current value of the flag is indicated in the lvs lv_attr bits.

-L|--size Size[m|UNIT]
Specifies the size of the new LV. The --size and --extents options are alternate methods of specifying size. The total number of physical extents used will be greater when redundant data is needed for RAID lev‐
els.

-s|--snapshot
Create a snapshot. Snapshots provide a "frozen image" of an origin LV. The snapshot LV can be used, e.g. for backups, while the origin LV continues to be used. This option can create a COW (copy on write) snap‐
shot, or a thin snapshot (in a thin pool.) Thin snapshots are created when the origin is a thin LV and the size option is NOT specified. Thin snapshots share the same blocks in the thin pool, and do not allocate
new space from the VG. Thin snapshots are created with the "activation skip" flag, see --setactivationskip. A thin snapshot of a non-thin "external origin" LV is created when a thin pool is specified. Unprovi‐
sioned blocks in the thin snapshot LV are read from the external origin LV. The external origin LV must be read-only. See lvmthin(7) for more information about LVM thin provisioning. COW snapshots are created
when a size is specified. The size is allocated from space in the VG, and is the amount of space that can be used for saving COW blocks as writes occur to the origin or snapshot. The size chosen should depend upon
the amount of writes that are expected; often 20% of the origin LV is enough. If COW space runs low, it can be extended with lvextend (shrinking is also allowed with lvreduce.) A small amount of the COW snapshot
LV size is used to track COW block locations, so the full size is not available for COW data blocks. Use lvs to check how much space is used, and see --monitor to to automatically extend the size to avoid running
out of space.

-i|--stripes Number
Specifies the number of stripes in a striped LV. This is the number of PVs (devices) that a striped LV is spread across. Data that appears sequential in the LV is spread across multiple devices in units of the
stripe size (see --stripesize). This does not change existing allocated space, but only applies to space being allocated by the command. When creating a RAID 4/5/6 LV, this number does not include the extra
devices that are required for parity. The largest number depends on the RAID type (raid0: 64, raid10: 32, raid4/5: 63, raid6: 62), and when unspecified, the default depends on the RAID type (raid0: 2, raid10: 2,
raid4/5: 3, raid6: 5.) To stripe a new raid LV across all PVs by default, see lvm.conf allocation/raid_stripe_all_devices.

-I|--stripesize Size[k|UNIT]
The amount of data that is written to one device before moving to the next in a striped LV.

-t|--test
Run in test mode. Commands will not update metadata. This is implemented by disabling all metadata writing but nevertheless returning success to the calling function. This may lead to unusual error messages in
multi-stage operations if a tool relies on reading back metadata it believes has changed but hasn't.

-T|--thin
Specifies the command is handling a thin LV or thin pool. See --type thin, --type thin-pool, and --virtualsize. See lvmthin(7) for more information about LVM thin provisioning.

--thinpool LV
The name of a thin pool LV.

--type linear|striped|snapshot|mirror|raid|thin|cache|thin-pool|cache-pool
The LV type, also known as "segment type" or "segtype". See usage descriptions for the specific ways to use these types. For more information about redundancy and performance (raid<N>, mirror, striped, linear)
see lvmraid(7). For thin provisioning (thin, thin-pool) see lvmthin(7). For performance caching (cache, cache-pool) see lvmcache(7). For copy-on-write snapshots (snapshot) see usage definitions. Several com‐
mands omit an explicit type option because the type is inferred from other options or shortcuts (e.g. --stripes, --mirrors, --snapshot, --virtualsize, --thin, --cache). Use inferred types with care because it can
lead to unexpected results.

-v|--verbose ...
Set verbose level. Repeat from 1 to 4 times to increase the detail of messages sent to stdout and stderr.

--version
Display version information.

-V|--virtualsize Size[m|UNIT]
The virtual size of a new thin LV. See lvmthin(7) for more information about LVM thin provisioning. Using virtual size (-V) and actual size (-L) together creates a sparse LV. lvm.conf global/sparse_seg‐
type_default determines the default segment type used to create a sparse LV. Anything written to a sparse LV will be returned when reading from it. Reading from other areas of the LV will return blocks of zeros.
When using a snapshot to create a sparse LV, a hidden virtual device is created using the zero target, and the LV has the suffix _vorigin. Snapshots are less efficient than thin provisioning when creating large
sparse LVs (GiB).

-W|--wipesignatures y|n
Controls detection and subsequent wiping of signatures on new LVs. There is a prompt for each signature detected to confirm its wiping (unless --yes is used to override confirmations.) When not specified, signa‐
tures are wiped whenever zeroing is done (see --zero). This behaviour can be configured with lvm.conf allocation/wipe_signatures_when_zeroing_new_lvs. If blkid wiping is used (lvm.conf allocation/use_blkid_wiping)
and LVM is compiled with blkid wiping support, then the blkid(8) library is used to detect the signatures (use blkid -k to list the signatures that are recognized). Otherwise, native LVM code is used to detect
signatures (only MD RAID, swap and LUKS signatures are detected in this case.) The LV is not wiped if the read only flag is set.

-y|--yes
Do not prompt for confirmation interactively but always assume the answer yes. Use with extreme caution. (For automatic no, see -qq.)

-Z|--zero y|n
Controls zeroing of the first 4KiB of data in the new LV. Default is y. Snapshot COW volumes are always zeroed. LV is not zeroed if the read only flag is set. Warning: trying to mount an unzeroed LV can cause
the system to hang.

VARIABLES
VG
Volume Group name. See lvm(8) for valid names. For lvcreate, the required VG positional arg may be omitted when the VG name is included in another option, e.g. --name VG/LV.

LV
Logical Volume name. See lvm(8) for valid names. An LV positional arg generally includes the VG name and LV name, e.g. VG/LV. LV followed by _<type> indicates that an LV of the given type is required. (raid rep‐
resents raid<N> type)

PV
Physical Volume name, a device path under /dev. For commands managing physical extents, a PV positional arg generally accepts a suffix indicating a range (or multiple ranges) of physical extents (PEs). When the
first PE is omitted, it defaults to the start of the device, and when the last PE is omitted it defaults to end. Start and end range (inclusive): PV[:PE-PE]... Start and length range (counting from 0):
PV[:PE+PE]...

String
See the option description for information about the string content.

Size[UNIT]
Size is an input number that accepts an optional unit. Input units are always treated as base two values, regardless of capitalization, e.g. 'k' and 'K' both refer to 1024. The default input unit is specified by
letter, followed by |UNIT. UNIT represents other possible input units: bBsSkKmMgGtTpPeE. b|B is bytes, s|S is sectors of 512 bytes, k|K is kilobytes, m|M is megabytes, g|G is gigabytes, t|T is terabytes, p|P is
petabytes, e|E is exabytes. (This should not be confused with the output control --units, where capital letters mean multiple of 1000.)

ENVIRONMENT VARIABLES
See lvm(8) for information about environment variables used by lvm. For example, LVM_VG_NAME can generally be substituted for a required VG parameter.

ADVANCED USAGE
Alternate command forms, advanced command usage, and listing of all valid syntax for completeness.

Create an LV that returns errors when used.

lvcreate --type error -L|--size Size[m|UNIT] VG
[ -l|--extents Number[PERCENT] ]
[ COMMON_OPTIONS ]
-

Create an LV that returns zeros when read.

lvcreate --type zero -L|--size Size[m|UNIT] VG
[ -l|--extents Number[PERCENT] ]
[ COMMON_OPTIONS ]
-

Create a linear LV.

lvcreate --type linear -L|--size Size[m|UNIT] VG
[ -l|--extents Number[PERCENT] ]
[ COMMON_OPTIONS ]
[ PV ... ]
-

Create a striped LV (also see lvcreate --stripes).

lvcreate --type striped -L|--size Size[m|UNIT] VG
[ -l|--extents Number[PERCENT] ]
[ -i|--stripes Number ]
[ -I|--stripesize Size[k|UNIT] ]
[ COMMON_OPTIONS ]
[ PV ... ]
-

Create a mirror LV (also see --type raid1).

lvcreate --type mirror -L|--size Size[m|UNIT] VG
[ -l|--extents Number[PERCENT] ]
[ -m|--mirrors Number ]
[ -R|--regionsize Size[m|UNIT] ]
[ -i|--stripes Number ]
[ -I|--stripesize Size[k|UNIT] ]
[ --mirrorlog core|disk ]
[ COMMON_OPTIONS ]
[ PV ... ]
-

Create a COW snapshot LV of an origin LV
(also see --snapshot).

lvcreate --type snapshot -L|--size Size[m|UNIT] LV
[ -l|--extents Number[PERCENT] ]
[ -s|--snapshot ]
[ -i|--stripes Number ]
[ -I|--stripesize Size[k|UNIT] ]
[ -c|--chunksize Size[k|UNIT] ]
[ COMMON_OPTIONS ]
[ PV ... ]
-

Create a sparse COW snapshot LV of a virtual origin LV
(also see --snapshot).

lvcreate --type snapshot -L|--size Size[m|UNIT]
-V|--virtualsize Size[m|UNIT] VG
[ -l|--extents Number[PERCENT] ]
[ -s|--snapshot ]
[ -c|--chunksize Size[k|UNIT] ]
[ COMMON_OPTIONS ]
[ PV ... ]
-

Create a sparse COW snapshot LV of a virtual origin LV.

lvcreate -s|--snapshot -L|--size Size[m|UNIT]
-V|--virtualsize Size[m|UNIT] VG
[ -l|--extents Number[PERCENT] ]
[ -c|--chunksize Size[k|UNIT] ]
[ --type snapshot ]
[ COMMON_OPTIONS ]
[ PV ... ]
-

Create a thin pool (infers --type thin-pool).

lvcreate -T|--thin -L|--size Size[m|UNIT] VG
[ -l|--extents Number[PERCENT] ]
[ -c|--chunksize Size[k|UNIT] ]
[ -i|--stripes Number ]
[ -I|--stripesize Size[k|UNIT] ]
[ --type thin-pool ]
[ --poolmetadatasize Size[m|UNIT] ]
[ --poolmetadataspare y|n ]
[ --discards passdown|nopassdown|ignore ]
[ --errorwhenfull y|n ]
[ COMMON_OPTIONS ]
[ PV ... ]
-

Create a thin pool named by the --thinpool arg
(infers --type thin-pool).

lvcreate -L|--size Size[m|UNIT] --thinpool LV_new VG
[ -l|--extents Number[PERCENT] ]
[ -T|--thin ]
[ -c|--chunksize Size[k|UNIT] ]
[ -i|--stripes Number ]
[ -I|--stripesize Size[k|UNIT] ]
[ --type thin-pool ]
[ --poolmetadatasize Size[m|UNIT] ]
[ --poolmetadataspare y|n ]
[ --discards passdown|nopassdown|ignore ]
[ --errorwhenfull y|n ]
[ COMMON_OPTIONS ]
[ PV ... ]
-

Create a cache pool named by the --cachepool arg
(variant, uses --cachepool in place of --name).

lvcreate --type cache-pool -L|--size Size[m|UNIT]
--cachepool LV_new VG
[ -l|--extents Number[PERCENT] ]
[ -H|--cache ]
[ -c|--chunksize Size[k|UNIT] ]
[ --poolmetadatasize Size[m|UNIT] ]
[ --poolmetadataspare y|n ]
[ --cachemode writethrough|writeback|passthrough ]
[ --cachepolicy String ]
[ --cachesettings String ]
[ --cachemetadataformat auto|1|2 ]
[ COMMON_OPTIONS ]
[ PV ... ]
-

Create a thin LV in a thin pool.

lvcreate --type thin -V|--virtualsize Size[m|UNIT]
--thinpool LV_thinpool VG
[ -T|--thin ]
[ -c|--chunksize Size[k|UNIT] ]
[ --poolmetadatasize Size[m|UNIT] ]
[ --poolmetadataspare y|n ]
[ --discards passdown|nopassdown|ignore ]
[ --errorwhenfull y|n ]
[ COMMON_OPTIONS ]
-

Create a thin LV in a thin pool named in the first arg
(variant, also see --thinpool for naming pool).

lvcreate --type thin -V|--virtualsize Size[m|UNIT] LV_thinpool
[ -T|--thin ]
[ --discards passdown|nopassdown|ignore ]
[ --errorwhenfull y|n ]
[ COMMON_OPTIONS ]
-

Create a thin LV in the thin pool named in the first arg
(variant, infers --type thin, also see --thinpool for
naming pool.)

lvcreate -V|--virtualsize Size[m|UNIT] LV_thinpool
[ -T|--thin ]
[ --type thin ]
[ --discards passdown|nopassdown|ignore ]
[ --errorwhenfull y|n ]
[ COMMON_OPTIONS ]
-

Create a thin LV that is a snapshot of an existing thin LV.

lvcreate --type thin LV_thin
[ -T|--thin ]
[ --discards passdown|nopassdown|ignore ]
[ --errorwhenfull y|n ]
[ COMMON_OPTIONS ]
-

Create a thin LV that is a snapshot of an existing thin LV
(infers --type thin).

lvcreate -T|--thin LV_thin
[ --type thin ]
[ --discards passdown|nopassdown|ignore ]
[ --errorwhenfull y|n ]
[ COMMON_OPTIONS ]
-

Create a thin LV that is a snapshot of an external origin LV
(infers --type thin).

lvcreate -s|--snapshot --thinpool LV_thinpool LV
[ --type thin ]
[ --discards passdown|nopassdown|ignore ]
[ --errorwhenfull y|n ]
[ COMMON_OPTIONS ]
-

Create a thin LV, first creating a thin pool for it,
where the new thin pool is named by the --thinpool arg
(variant, infers --type thin).

lvcreate -V|--virtualsize Size[m|UNIT] -L|--size Size[m|UNIT]
--thinpool LV_new
[ -l|--extents Number[PERCENT] ]
[ -T|--thin ]
[ -c|--chunksize Size[k|UNIT] ]
[ -i|--stripes Number ]
[ -I|--stripesize Size[k|UNIT] ]
[ --poolmetadatasize Size[m|UNIT] ]
[ --poolmetadataspare y|n ]
[ --discards passdown|nopassdown|ignore ]
[ --errorwhenfull y|n ]
[ COMMON_OPTIONS ]
[ PV ... ]
-

Create a thin LV, first creating a thin pool for it,
where the new thin pool is named by the --thinpool arg
(variant, infers --type thin).

lvcreate -V|--virtualsize Size[m|UNIT] -L|--size Size[m|UNIT]
--thinpool LV_new VG
[ -l|--extents Number[PERCENT] ]
[ -T|--thin ]
[ -c|--chunksize Size[k|UNIT] ]
[ -i|--stripes Number ]
[ -I|--stripesize Size[k|UNIT] ]
[ --poolmetadatasize Size[m|UNIT] ]
[ --poolmetadataspare y|n ]
[ --discards passdown|nopassdown|ignore ]
[ --errorwhenfull y|n ]
[ COMMON_OPTIONS ]
[ PV ... ]
-

Create a thin LV, first creating a thin pool for it,
where the new thin pool is named in the first arg,
or the new thin pool name is generated when the first
arg is a VG name.

lvcreate --type thin -V|--virtualsize Size[m|UNIT]
-L|--size Size[m|UNIT] VG|LV_new
[ -l|--extents Number[PERCENT] ]
[ -T|--thin ]
[ -c|--chunksize Size[k|UNIT] ]
[ -i|--stripes Number ]
[ -I|--stripesize Size[k|UNIT] ]
[ --poolmetadatasize Size[m|UNIT] ]
[ --poolmetadataspare y|n ]
[ --discards passdown|nopassdown|ignore ]
[ --errorwhenfull y|n ]
[ COMMON_OPTIONS ]
[ PV ... ]
-

Create a thin LV, first creating a thin pool for it,
where the new thin pool is named in the first arg,
or the new thin pool name is generated when the first
arg is a VG name (variant, infers --type thin).

lvcreate -T|--thin -V|--virtualsize Size[m|UNIT]
-L|--size Size[m|UNIT] VG|LV_new
[ -l|--extents Number[PERCENT] ]
[ -c|--chunksize Size[k|UNIT] ]
[ -i|--stripes Number ]
[ -I|--stripesize Size[k|UNIT] ]
[ --poolmetadatasize Size[m|UNIT] ]
[ --poolmetadataspare y|n ]
[ --discards passdown|nopassdown|ignore ]
[ --errorwhenfull y|n ]
[ COMMON_OPTIONS ]
[ PV ... ]
-

Create a thin LV, first creating a thin pool for it
(infers --type thin).
Create a sparse snapshot of a virtual origin LV
(infers --type snapshot).
Chooses --type thin or --type snapshot according to
config setting sparse_segtype_default.

lvcreate -L|--size Size[m|UNIT] -V|--virtualsize Size[m|UNIT] VG
[ -l|--extents Number[PERCENT] ]
[ -s|--snapshot ]
[ -c|--chunksize Size[k|UNIT] ]
[ -i|--stripes Number ]
[ -I|--stripesize Size[k|UNIT] ]
[ --type snapshot ]
[ --poolmetadatasize Size[m|UNIT] ]
[ --poolmetadataspare y|n ]
[ --discards passdown|nopassdown|ignore ]
[ --errorwhenfull y|n ]
[ COMMON_OPTIONS ]
[ PV ... ]
-

Create a cache LV, first creating a new origin LV,
then combining it with the existing cache pool named
by the --cachepool arg (variant, infers --type cache).

lvcreate -L|--size Size[m|UNIT] --cachepool LV_cachepool VG
[ -l|--extents Number[PERCENT] ]
[ -H|--cache ]
[ -c|--chunksize Size[k|UNIT] ]
[ -i|--stripes Number ]
[ -I|--stripesize Size[k|UNIT] ]
[ --type cache ]
[ --cachemode writethrough|writeback|passthrough ]
[ --cachepolicy String ]
[ --cachesettings String ]
[ --cachemetadataformat auto|1|2 ]
[ COMMON_OPTIONS ]
[ PV ... ]
-

Create a cache LV, first creating a new origin LV,
then combining it with the existing cache pool named
in the first arg (variant, also use --cachepool).

lvcreate --type cache -L|--size Size[m|UNIT] LV_cachepool
[ -l|--extents Number[PERCENT] ]
[ -H|--cache ]
[ -c|--chunksize Size[k|UNIT] ]
[ -i|--stripes Number ]
[ -I|--stripesize Size[k|UNIT] ]
[ --poolmetadatasize Size[m|UNIT] ]
[ --poolmetadataspare y|n ]
[ --cachemode writethrough|writeback|passthrough ]
[ --cachepolicy String ]
[ --cachesettings String ]
[ --cachemetadataformat auto|1|2 ]
[ COMMON_OPTIONS ]
[ PV ... ]
-

When LV is a cache pool, create a cache LV,
first creating a new origin LV, then combining it with
the existing cache pool named in the first arg
(variant, infers --type cache, also use --cachepool).
When LV is not a cache pool, convert the specified LV
to type cache after creating a new cache pool LV to use
(use lvconvert).

lvcreate -H|--cache -L|--size Size[m|UNIT] LV
[ -l|--extents Number[PERCENT] ]
[ -c|--chunksize Size[k|UNIT] ]
[ -i|--stripes Number ]
[ -I|--stripesize Size[k|UNIT] ]
[ --cachemode writethrough|writeback|passthrough ]
[ --cachepolicy String ]
[ --cachesettings String ]
[ --cachemetadataformat auto|1|2 ]
[ --poolmetadatasize Size[m|UNIT] ]
[ --poolmetadataspare y|n ]
[ COMMON_OPTIONS ]
[ PV ... ]
-

EXAMPLES
Create a striped LV with 3 stripes, a stripe size of 8KiB and a size of 100MiB. The LV name is chosen by lvcreate.
lvcreate -i 3 -I 8 -L 100m vg00

Create a raid1 LV with two images, and a useable size of 500 MiB. This operation requires two devices, one for each mirror image. RAID metadata (superblock and bitmap) is also included on the two devices.
lvcreate --type raid1 -m1 -L 500m -n mylv vg00

Create a mirror LV with two images, and a useable size of 500 MiB. This operation requires three devices: two for mirror images and one for a disk log.
lvcreate --type mirror -m1 -L 500m -n mylv vg00

Create a mirror LV with 2 images, and a useable size of 500 MiB. This operation requires 2 devices because the log is in memory.
lvcreate --type mirror -m1 --mirrorlog core -L 500m -n mylv vg00

Create a copy-on-write snapshot of an LV:
lvcreate --snapshot --size 100m --name mysnap vg00/mylv

Create a copy-on-write snapshot with a size sufficient for overwriting 20% of the size of the original LV.
lvcreate -s -l 20%ORIGIN -n mysnap vg00/mylv

Create a sparse LV with 1TiB of virtual space, and actual space just under 100MiB.
lvcreate --snapshot --virtualsize 1t --size 100m --name mylv vg00

Create a linear LV with a usable size of 64MiB on specific physical extents.
lvcreate -L 64m -n mylv vg00 /dev/sda:0-7 /dev/sdb:0-7

Create a RAID5 LV with a usable size of 5GiB, 3 stripes, a stripe size of 64KiB, using a total of 4 devices (including one for parity).
lvcreate --type raid5 -L 5G -i 3 -I 64 -n mylv vg00

Create a RAID5 LV using all of the free space in the VG and spanning all the PVs in the VG (note that the command will fail if there are more than 8 PVs in the VG, in which case -i 7 must be used to get to the current
maximum of 8 devices including parity for RaidLVs).
lvcreate --config allocation/raid_stripe_all_devices=1
--type raid5 -l 100%FREE -n mylv vg00

Create RAID10 LV with a usable size of 5GiB, using 2 stripes, each on a two-image mirror. (Note that the -i and -m arguments behave differently: -i specifies the total number of stripes, but -m specifies the number of
images in addition to the first image).
lvcreate --type raid10 -L 5G -i 2 -m 1 -n mylv vg00

Create a 1TiB thin LV, first creating a new thin pool for it, where the thin pool has 100MiB of space, uses 2 stripes, has a 64KiB stripe size, and 256KiB chunk size.
lvcreate --type thin --name mylv --thinpool mypool
-V 1t -L 100m -i 2 -I 64 -c 256 vg00

Create a thin snapshot of a thin LV (the size option must not be used, otherwise a copy-on-write snapshot would be created).
lvcreate --snapshot --name mysnap vg00/thinvol

Create a thin snapshot of the read-only inactive LV named "origin" which becomes an external origin for the thin snapshot LV.
lvcreate --snapshot --name mysnap --thinpool mypool vg00/origin

Create a cache pool from a fast physical device. The cache pool can then be used to cache an LV.
lvcreate --type cache-pool -L 1G -n my_cpool vg00 /dev/fast1

Create a cache LV, first creating a new origin LV on a slow physical device, then combining the new origin LV with an existing cache pool.
lvcreate --type cache --cachepool my_cpool
-L 100G -n mylv vg00 /dev/slow1

SEE ALSO
lvm(8) lvm.conf(5) lvmconfig(8)

pvchange(8) pvck(8) pvcreate(8) pvdisplay(8) pvmove(8) pvremove(8) pvresize(8) pvs(8) pvscan(8)

vgcfgbackup(8) vgcfgrestore(8) vgchange(8) vgck(8) vgcreate(8) vgconvert(8) vgdisplay(8) vgexport(8) vgextend(8) vgimport(8) vgimportclone(8) vgmerge(8) vgmknodes(8) vgreduce(8) vgremove(8) vgrename(8) vgs(8) vgscan(8)
vgsplit(8)

lvcreate(8) lvchange(8) lvconvert(8) lvdisplay(8) lvextend(8) lvreduce(8) lvremove(8) lvrename(8) lvresize(8) lvs(8) lvscan(8)

lvm-fullreport(8) lvm-lvpoll(8) lvm2-activation-generator(8) blkdeactivate(8) lvmdump(8)

dmeventd(8) lvmetad(8) lvmpolld(8) lvmlockd(8) lvmlockctl(8) clvmd(8) cmirrord(8) lvmdbusd(8)

lvmsystemid(7) lvmreport(7) lvmraid(7) lvmthin(7) lvmcache(7)

Red Hat, Inc. LVM TOOLS 2.02.176(2) (2017-11-03) LVCREATE(8)

lvdisplay

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
LVDISPLAY(8)                                                                                           System Manager's Manual                                                                                          LVDISPLAY(8)

NAME
lvdisplay - Display information about a logical volume

SYNOPSIS
lvdisplay
[ option_args ]
[ position_args ]

DESCRIPTION
lvdisplay shows the attributes of LVs, like size, read/write status, snapshot information, etc.

lvs(8) is a preferred alternative that shows the same information and more, using a more compact and configurable output format.

USAGE
lvdisplay
[ -a|--all ]
[ -c|--colon ]
[ -C|--columns ]
[ -H|--history ]
[ -m|--maps ]
[ -o|--options String ]
[ -O|--sort String ]
[ -S|--select String ]
[ --aligned ]
[ --binary ]
[ --configreport log|vg|lv|pv|pvseg|seg ]
[ --foreign ]
[ --ignorelockingfailure ]
[ --ignoreskippedcluster ]
[ --logonly ]
[ --noheadings ]
[ --nosuffix ]
[ --readonly ]
[ --reportformat basic|json ]
[ --segments ]
[ --separator String ]
[ --shared ]
[ --unbuffered ]
[ --units r|R|h|H|b|B|s|S|k|K|m|M|g|G|t|T|p|P|e|E ]
[ COMMON_OPTIONS ]
[ VG|LV|Tag ... ]

Common options for lvm:
[ -d|--debug ]
[ -h|--help ]
[ -q|--quiet ]
[ -t|--test ]
[ -v|--verbose ]
[ -y|--yes ]
[ --commandprofile String ]
[ --config String ]
[ --driverloaded y|n ]
[ --longhelp ]
[ --profile String ]
[ --version ]

OPTIONS
--aligned
Use with --separator to align the output columns

-a|--all
Show information about internal LVs. These are components of normal LVs, such as mirrors, which are not independently accessible, e.g. not mountable.

--binary
Use binary values "0" or "1" instead of descriptive literal values for columns that have exactly two valid values to report (not counting the "unknown" value which denotes that the value could not be determined).

-c|--colon
Generate colon separated output for easier parsing in scripts or programs. Also see vgs(8) which provides considerably more control over the output.

-C|--columns
Display output in columns, the equivalent of vgs(8). Options listed are the same as options given in vgs(8).

--commandprofile String
The command profile to use for command configuration. See lvm.conf(5) for more information about profiles.

--config String
Config settings for the command. These override lvm.conf settings. The String arg uses the same format as lvm.conf, or may use section/field syntax. See lvm.conf(5) for more information about config.

--configreport log|vg|lv|pv|pvseg|seg
See lvmreport(7).

-d|--debug ...
Set debug level. Repeat from 1 to 6 times to increase the detail of messages sent to the log file and/or syslog (if configured).

--driverloaded y|n
If set to no, the command will not attempt to use device-mapper. For testing and debugging.

--foreign
Report/display foreign VGs that would otherwise be skipped. See lvmsystemid(7) for more information about foreign VGs.

-h|--help
Display help text.

-H|--history
Include historical LVs in the output. (This has no effect unless LVs were removed while lvm.conf metadata/record_lvs_history was enabled.

--ignorelockingfailure
Allows a command to continue with read-only metadata operations after locking failures.

--ignoreskippedcluster
Use to avoid exiting with an non-zero status code if the command is run without clustered locking and clustered VGs are skipped.

--logonly
Suppress command report and display only log report.

--longhelp
Display long help text.

-m|--maps
Display the mapping of logical extents to PVs and physical extents. To map physical extents to logical extents use: pvs --segments -o+lv_name,seg_start_pe,segtype

--noheadings
Suppress the headings line that is normally the first line of output. Useful if grepping the output.

--nosuffix
Suppress the suffix on output sizes. Use with --units (except h and H) if processing the output.

-o|--options String
Comma-separated, ordered list of fields to display in columns. String arg syntax is: [+|-|#]Field1[,Field2 ...] The prefix + will append the specified fields to the default fields, - will remove the specified
fields from the default fields, and # will compact specified fields (removing them when empty for all rows.) Use -o help to view the list of all available fields. Use separate lists of fields to add, remove or
compact by repeating the -o option: -o+field1,field2 -o-field3,field4 -o#field5. These lists are evaluated from left to right. Use field name lv_all to view all LV fields, vg_all all VG fields, pv_all all PV
fields, pvseg_all all PV segment fields, seg_all all LV segment fields, and pvseg_all all PV segment columns. See the lvm.conf report section for more config options. See lvmreport(7) for more information about
reporting.

--profile String
An alias for --commandprofile or --metadataprofile, depending on the command.

-q|--quiet ...
Suppress output and log messages. Overrides --debug and --verbose. Repeat once to also suppress any prompts with answer 'no'.

--readonly
Run the command in a special read-only mode which will read on-disk metadata without needing to take any locks. This can be used to peek inside metadata used by a virtual machine image while the virtual machine is
running. It can also be used to peek inside the metadata of clustered VGs when clustered locking is not configured or running. No attempt will be made to communicate with the device-mapper kernel driver, so this
option is unable to report whether or not LVs are actually in use.

--reportformat basic|json
Overrides current output format for reports which is defined globally by the report/output_format setting in lvm.conf. basic is the original format with columns and rows. If there is more than one report per com‐
mand, each report is prefixed with the report name for identification. json produces report output in JSON format. See lvmreport(7) for more information.

--segments

-S|--select String
Select objects for processing and reporting based on specified criteria. The criteria syntax is described by --select help and lvmreport(7). For reporting commands, one row is displayed for each object matching
the criteria. See --options help for selectable object fields. Rows can be displayed with an additional "selected" field (-o selected) showing 1 if the row matches the selection and 0 otherwise. For non-report‐
ing commands which process LVM entities, the selection is used to choose items to process.

--separator String
String to use to separate each column. Useful if grepping the output.

--shared
Report/display shared VGs that would otherwise be skipped when lvmlockd is not being used on the host. See lvmlockd(8) for more information about shared VGs.

-O|--sort String
Comma-separated ordered list of columns to sort by. Replaces the default selection. Precede any column with - for a reverse sort on that column.

-t|--test
Run in test mode. Commands will not update metadata. This is implemented by disabling all metadata writing but nevertheless returning success to the calling function. This may lead to unusual error messages in
multi-stage operations if a tool relies on reading back metadata it believes has changed but hasn't.

--unbuffered
Produce output immediately without sorting or aligning the columns properly.

--units r|R|h|H|b|B|s|S|k|K|m|M|g|G|t|T|p|P|e|E
All sizes are output in these units: human-(r)eadable with '<' rounding indicator, (h)uman-readable, (b)ytes, (s)ectors, (k)ilobytes, (m)egabytes, (g)igabytes, (t)erabytes, (p)etabytes, (e)xabytes. Capitalise to
use multiples of 1000 (S.I.) instead of 1024. Custom units can be specified, e.g. --units 3M.

-v|--verbose ...
Set verbose level. Repeat from 1 to 4 times to increase the detail of messages sent to stdout and stderr.

--version
Display version information.

-y|--yes
Do not prompt for confirmation interactively but always assume the answer yes. Use with extreme caution. (For automatic no, see -qq.)

VARIABLES
VG
Volume Group name. See lvm(8) for valid names.

LV
Logical Volume name. See lvm(8) for valid names. An LV positional arg generally includes the VG name and LV name, e.g. VG/LV.

Tag
Tag name. See lvm(8) for information about tag names and using tags in place of a VG, LV or PV.

String
See the option description for information about the string content.

Size[UNIT]
Size is an input number that accepts an optional unit. Input units are always treated as base two values, regardless of capitalization, e.g. 'k' and 'K' both refer to 1024. The default input unit is specified by
letter, followed by |UNIT. UNIT represents other possible input units: bBsSkKmMgGtTpPeE. b|B is bytes, s|S is sectors of 512 bytes, k|K is kilobytes, m|M is megabytes, g|G is gigabytes, t|T is terabytes, p|P is
petabytes, e|E is exabytes. (This should not be confused with the output control --units, where capital letters mean multiple of 1000.)

ENVIRONMENT VARIABLES
See lvm(8) for information about environment variables used by lvm. For example, LVM_VG_NAME can generally be substituted for a required VG parameter.

SEE ALSO
lvm(8) lvm.conf(5) lvmconfig(8)

pvchange(8) pvck(8) pvcreate(8) pvdisplay(8) pvmove(8) pvremove(8) pvresize(8) pvs(8) pvscan(8)

vgcfgbackup(8) vgcfgrestore(8) vgchange(8) vgck(8) vgcreate(8) vgconvert(8) vgdisplay(8) vgexport(8) vgextend(8) vgimport(8) vgimportclone(8) vgmerge(8) vgmknodes(8) vgreduce(8) vgremove(8) vgrename(8) vgs(8) vgscan(8)
vgsplit(8)

lvcreate(8) lvchange(8) lvconvert(8) lvdisplay(8) lvextend(8) lvreduce(8) lvremove(8) lvrename(8) lvresize(8) lvs(8) lvscan(8)

lvm-fullreport(8) lvm-lvpoll(8) lvm2-activation-generator(8) blkdeactivate(8) lvmdump(8)

dmeventd(8) lvmetad(8) lvmpolld(8) lvmlockd(8) lvmlockctl(8) clvmd(8) cmirrord(8) lvmdbusd(8)

lvmsystemid(7) lvmreport(7) lvmraid(7) lvmthin(7) lvmcache(7)

Red Hat, Inc. LVM TOOLS 2.02.176(2) (2017-11-03) LVDISPLAY(8)

lvextend

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
LVEXTEND(8)                                                                                            System Manager's Manual                                                                                           LVEXTEND(8)

NAME
lvextend - Add space to a logical volume

SYNOPSIS
lvextend option_args position_args
[ option_args ]
[ position_args ]

--alloc contiguous|cling|cling_by_tags|normal|anywhere|inherit
-A|--autobackup y|n
--commandprofile String
--config String
-d|--debug
--driverloaded y|n
-l|--extents [+]Number[PERCENT]
-f|--force
-h|--help
--longhelp
-m|--mirrors Number
-n|--nofsck
--nosync
--noudevsync
--poolmetadatasize [+]Size[m|UNIT]
--profile String
-q|--quiet
--reportformat basic|json
-r|--resizefs
-L|--size [+]Size[m|UNIT]
-i|--stripes Number
-I|--stripesize Size[k|UNIT]
-t|--test
--type linear|striped|snapshot|mirror|raid|thin|cache|thin-pool|cache-pool
--usepolicies
-v|--verbose
--version
-y|--yes

DESCRIPTION
lvextend extends the size of an LV. This requires allocating logical extents from the VG's free physical extents. If the extension adds a new LV segment, the new segment will use the existing segment type of the LV.

Extending a copy-on-write snapshot LV adds space for COW blocks.

Use lvconvert(8) to change the number of data images in a RAID or mirrored LV.

In the usage section below, --size Size can be replaced with --extents Number. See both descriptions the options section.

USAGE
Extend an LV by a specified size.

lvextend -L|--size [+]Size[m|UNIT] LV
[ -l|--extents [+]Number[PERCENT] ]
[ -r|--resizefs ]
[ -i|--stripes Number ]
[ -I|--stripesize Size[k|UNIT] ]
[ --poolmetadatasize [+]Size[m|UNIT] ]
[ COMMON_OPTIONS ]
[ PV ... ]
-

Extend an LV by specified PV extents.

lvextend LV PV ...
[ -r|--resizefs ]
[ -i|--stripes Number ]
[ -I|--stripesize Size[k|UNIT] ]
[ COMMON_OPTIONS ]
-

Extend a pool metadata SubLV by a specified size.

lvextend --poolmetadatasize [+]Size[m|UNIT] LV_thinpool
[ -i|--stripes Number ]
[ -I|--stripesize Size[k|UNIT] ]
[ COMMON_OPTIONS ]
[ PV ... ]
-

Extend an LV according to a predefined policy.

lvextend --usepolicies LV_snapshot_thinpool
[ -r|--resizefs ]
[ COMMON_OPTIONS ]
[ PV ... ]
-

Common options for command:
[ -A|--autobackup y|n ]
[ -f|--force ]
[ -m|--mirrors Number ]
[ -n|--nofsck ]
[ --alloc contiguous|cling|cling_by_tags|normal|anywhere|inherit ]
[ --nosync ]
[ --noudevsync ]
[ --reportformat basic|json ]
[ --type linear|striped|snapshot|mirror|raid|thin|cache|thin-pool|cache-pool ]

Common options for lvm:
[ -d|--debug ]
[ -h|--help ]
[ -q|--quiet ]
[ -t|--test ]
[ -v|--verbose ]
[ -y|--yes ]
[ --commandprofile String ]
[ --config String ]
[ --driverloaded y|n ]
[ --longhelp ]
[ --profile String ]
[ --version ]

OPTIONS
--alloc contiguous|cling|cling_by_tags|normal|anywhere|inherit
Determines the allocation policy when a command needs to allocate Physical Extents (PEs) from the VG. Each VG and LV has an allocation policy which can be changed with vgchange/lvchange, or overriden on the command
line. normal applies common sense rules such as not placing parallel stripes on the same PV. inherit applies the VG policy to an LV. contiguous requires new PEs be placed adjacent to existing PEs. cling places
new PEs on the same PV as existing PEs in the same stripe of the LV. If there are sufficient PEs for an allocation, but normal does not use them, anywhere will use them even if it reduces performance, e.g. by
placing two stripes on the same PV. Optional positional PV args on the command line can also be used to limit which PVs the command will use for allocation. See lvm(8) for more information about allocation.

-A|--autobackup y|n
Specifies if metadata should be backed up automatically after a change. Enabling this is strongly advised! See vgcfgbackup(8) for more information.

--commandprofile String
The command profile to use for command configuration. See lvm.conf(5) for more information about profiles.

--config String
Config settings for the command. These override lvm.conf settings. The String arg uses the same format as lvm.conf, or may use section/field syntax. See lvm.conf(5) for more information about config.

-d|--debug ...
Set debug level. Repeat from 1 to 6 times to increase the detail of messages sent to the log file and/or syslog (if configured).

--driverloaded y|n
If set to no, the command will not attempt to use device-mapper. For testing and debugging.

-l|--extents [+]Number[PERCENT]
Specifies the new size of the LV in logical extents. The --size and --extents options are alternate methods of specifying size. The total number of physical extents used will be greater when redundant data is
needed for RAID levels. An alternate syntax allows the size to be determined indirectly as a percentage of the size of a related VG, LV, or set of PVs. The suffix %VG denotes the total size of the VG, the suffix
%FREE the remaining free space in the VG, and the suffix %PVS the free space in the specified PVs. For a snapshot, the size can be expressed as a percentage of the total size of the origin LV with the suffix %ORI‐
GIN (100%ORIGIN provides space for the whole origin). When expressed as a percentage, the size defines an upper limit for the number of logical extents in the new LV. The precise number of logical extents in the
new LV is not determined until the command has completed. When the plus + or minus - prefix is used, the value is not an absolute size, but is relative and added or subtracted from the current size.

-f|--force ...
Override various checks, confirmations and protections. Use with extreme caution.

-h|--help
Display help text.

--longhelp
Display long help text.

-m|--mirrors Number
Not used.

-n|--nofsck
Do not perform fsck before resizing filesystem when filesystem requires it. You may need to use --force to proceed with this option.

--nosync
Causes the creation of mirror, raid1, raid4, raid5 and raid10 to skip the initial synchronization. In case of mirror, raid1 and raid10, any data written afterwards will be mirrored, but the original contents will
not be copied. In case of raid4 and raid5, no parity blocks will be written, though any data written afterwards will cause parity blocks to be stored. This is useful for skipping a potentially long and resource
intensive initial sync of an empty mirror/raid1/raid4/raid5 and raid10 LV. This option is not valid for raid6, because raid6 relies on proper parity (P and Q Syndromes) being created during initial synchronization
in order to reconstruct proper user date in case of device failures. raid0 and raid0_meta do not provide any data copies or parity support and thus do not support initial synchronization.

--noudevsync
Disables udev synchronisation. The process will not wait for notification from udev. It will continue irrespective of any possible udev processing in the background. Only use this if udev is not running or has
rules that ignore the devices LVM creates.

--poolmetadatasize [+]Size[m|UNIT]
Specifies the new size of the pool metadata LV. The plus prefix + can be used, in which case the value is added to the current size.

--profile String
An alias for --commandprofile or --metadataprofile, depending on the command.

-q|--quiet ...
Suppress output and log messages. Overrides --debug and --verbose. Repeat once to also suppress any prompts with answer 'no'.

--reportformat basic|json
Overrides current output format for reports which is defined globally by the report/output_format setting in lvm.conf. basic is the original format with columns and rows. If there is more than one report per com‐
mand, each report is prefixed with the report name for identification. json produces report output in JSON format. See lvmreport(7) for more information.

-r|--resizefs
Resize underlying filesystem together with the LV using fsadm(8).

-L|--size [+]Size[m|UNIT]
Specifies the new size of the LV. The --size and --extents options are alternate methods of specifying size. The total number of physical extents used will be greater when redundant data is needed for RAID lev‐
els. When the plus + or minus - prefix is used, the value is not an absolute size, but is relative and added or subtracted from the current size.

-i|--stripes Number
Specifies the number of stripes in a striped LV. This is the number of PVs (devices) that a striped LV is spread across. Data that appears sequential in the LV is spread across multiple devices in units of the
stripe size (see --stripesize). This does not change existing allocated space, but only applies to space being allocated by the command. When creating a RAID 4/5/6 LV, this number does not include the extra
devices that are required for parity. The largest number depends on the RAID type (raid0: 64, raid10: 32, raid4/5: 63, raid6: 62), and when unspecified, the default depends on the RAID type (raid0: 2, raid10: 2,
raid4/5: 3, raid6: 5.) To stripe a new raid LV across all PVs by default, see lvm.conf allocation/raid_stripe_all_devices.

-I|--stripesize Size[k|UNIT]
The amount of data that is written to one device before moving to the next in a striped LV.

-t|--test
Run in test mode. Commands will not update metadata. This is implemented by disabling all metadata writing but nevertheless returning success to the calling function. This may lead to unusual error messages in
multi-stage operations if a tool relies on reading back metadata it believes has changed but hasn't.

--type linear|striped|snapshot|mirror|raid|thin|cache|thin-pool|cache-pool
The LV type, also known as "segment type" or "segtype". See usage descriptions for the specific ways to use these types. For more information about redundancy and performance (raid<N>, mirror, striped, linear)
see lvmraid(7). For thin provisioning (thin, thin-pool) see lvmthin(7). For performance caching (cache, cache-pool) see lvmcache(7). For copy-on-write snapshots (snapshot) see usage definitions. Several com‐
mands omit an explicit type option because the type is inferred from other options or shortcuts (e.g. --stripes, --mirrors, --snapshot, --virtualsize, --thin, --cache). Use inferred types with care because it can
lead to unexpected results.

--usepolicies
Perform an operation according to the policy configured in lvm.conf or a profile.

-v|--verbose ...
Set verbose level. Repeat from 1 to 4 times to increase the detail of messages sent to stdout and stderr.

--version
Display version information.

-y|--yes
Do not prompt for confirmation interactively but always assume the answer yes. Use with extreme caution. (For automatic no, see -qq.)

VARIABLES
LV
Logical Volume name. See lvm(8) for valid names. An LV positional arg generally includes the VG name and LV name, e.g. VG/LV. LV followed by _<type> indicates that an LV of the given type is required. (raid rep‐
resents raid<N> type)

PV
Physical Volume name, a device path under /dev. For commands managing physical extents, a PV positional arg generally accepts a suffix indicating a range (or multiple ranges) of physical extents (PEs). When the
first PE is omitted, it defaults to the start of the device, and when the last PE is omitted it defaults to end. Start and end range (inclusive): PV[:PE-PE]... Start and length range (counting from 0):
PV[:PE+PE]...

String
See the option description for information about the string content.

Size[UNIT]
Size is an input number that accepts an optional unit. Input units are always treated as base two values, regardless of capitalization, e.g. 'k' and 'K' both refer to 1024. The default input unit is specified by
letter, followed by |UNIT. UNIT represents other possible input units: bBsSkKmMgGtTpPeE. b|B is bytes, s|S is sectors of 512 bytes, k|K is kilobytes, m|M is megabytes, g|G is gigabytes, t|T is terabytes, p|P is
petabytes, e|E is exabytes. (This should not be confused with the output control --units, where capital letters mean multiple of 1000.)

ENVIRONMENT VARIABLES
See lvm(8) for information about environment variables used by lvm. For example, LVM_VG_NAME can generally be substituted for a required VG parameter.

EXAMPLES
Extend the size of an LV by 54MiB, using a specific PV.
lvextend -L +54 vg01/lvol10 /dev/sdk3

Extend the size of an LV by the amount of free space on PV /dev/sdk3. This is equivalent to specifying "-l +100%PVS" on the command line.
lvextend vg01/lvol01 /dev/sdk3

Extend an LV by 16MiB using specific physical extents.
lvextend -L+16m vg01/lvol01 /dev/sda:8-9 /dev/sdb:8-9

SEE ALSO
lvm(8) lvm.conf(5) lvmconfig(8)

pvchange(8) pvck(8) pvcreate(8) pvdisplay(8) pvmove(8) pvremove(8) pvresize(8) pvs(8) pvscan(8)

vgcfgbackup(8) vgcfgrestore(8) vgchange(8) vgck(8) vgcreate(8) vgconvert(8) vgdisplay(8) vgexport(8) vgextend(8) vgimport(8) vgimportclone(8) vgmerge(8) vgmknodes(8) vgreduce(8) vgremove(8) vgrename(8) vgs(8) vgscan(8)
vgsplit(8)

lvcreate(8) lvchange(8) lvconvert(8) lvdisplay(8) lvextend(8) lvreduce(8) lvremove(8) lvrename(8) lvresize(8) lvs(8) lvscan(8)

lvm-fullreport(8) lvm-lvpoll(8) lvm2-activation-generator(8) blkdeactivate(8) lvmdump(8)

dmeventd(8) lvmetad(8) lvmpolld(8) lvmlockd(8) lvmlockctl(8) clvmd(8) cmirrord(8) lvmdbusd(8)

lvmsystemid(7) lvmreport(7) lvmraid(7) lvmthin(7) lvmcache(7)

Red Hat, Inc. LVM TOOLS 2.02.176(2) (2017-11-03) LVEXTEND(8)

lvmconfig

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
LVMCONFIG(8)                                                                                           System Manager's Manual                                                                                          LVMCONFIG(8)

NAME
lvmconfig - Display and manipulate configuration information

SYNOPSIS
lvmconfig
[ option_args ]
[ position_args ]

DESCRIPTION
lvmconfig, lvm config, lvm dumpconfig (for compatibility reasons, to be phased out) produce formatted output from the LVM configuration tree. The sources of the configuration data include lvm.conf(5) and command line set‐
tings from --config.

USAGE
lvmconfig
[ -f|--file String ]
[ -l|--list ]
[ --atversion String ]
[ --typeconfig current|default|diff|full|list|missing|new|profilable|profilable-command|profilable-metadata ]
[ --ignoreadvanced ]
[ --ignoreunsupported ]
[ --ignorelocal ]
[ --mergedconfig ]
[ --metadataprofile String ]
[ --sinceversion String ]
[ --showdeprecated ]
[ --showunsupported ]
[ --validate ]
[ --withsummary ]
[ --withcomments ]
[ --withgeneralpreamble ]
[ --withlocalpreamble ]
[ --withspaces ]
[ --unconfigured ]
[ --withversions ]
[ COMMON_OPTIONS ]
[ String ... ]

Common options for lvm:
[ -d|--debug ]
[ -h|--help ]
[ -q|--quiet ]
[ -t|--test ]
[ -v|--verbose ]
[ -y|--yes ]
[ --commandprofile String ]
[ --config String ]
[ --driverloaded y|n ]
[ --longhelp ]
[ --profile String ]
[ --version ]

OPTIONS
--atversion String
Specify an LVM version in x.y.z format where x is the major version, the y is the minor version and z is the patchlevel (e.g. 2.2.106). When configuration is displayed, the configuration settings recognized at
this LVM version will be considered only. This can be used to display a configuration that a certain LVM version understands and which does not contain any newer settings for which LVM would issue a warning message
when checking the configuration.

--commandprofile String
The command profile to use for command configuration. See lvm.conf(5) for more information about profiles.

--config String
Config settings for the command. These override lvm.conf settings. The String arg uses the same format as lvm.conf, or may use section/field syntax. See lvm.conf(5) for more information about config.

-d|--debug ...
Set debug level. Repeat from 1 to 6 times to increase the detail of messages sent to the log file and/or syslog (if configured).

--driverloaded y|n
If set to no, the command will not attempt to use device-mapper. For testing and debugging.

-f|--file String
Write output to the named file.

-h|--help
Display help text.

--ignoreadvanced
Exclude advanced configuration settings from the output.

--ignorelocal
Ignore the local section. The local section should be defined in the lvmlocal.conf file, and should contain config settings specific to the local host which should not be copied to other hosts.

--ignoreunsupported
Exclude unsupported configuration settings from the output. These settings are either used for debugging and development purposes only or their support is not yet complete and they are not meant to be used in pro‐
duction. The current and diff types include unsupported settings in their output by default, all the other types ignore unsupported settings.

-l|--list
List config settings with summarizing comment. This is the same as using options --typeconfig list --withsummary.

--longhelp
Display long help text.

--mergedconfig
When the command is run with --config and/or --commandprofile (or using LVM_COMMAND_PROFILE environment variable), --profile, or --metadataprofile, merge all the contents of the "config cascade" before displaying
it. Without merging, only the configuration at the front of the cascade is displayed. See lvm.conf(5) for more information about config.

--metadataprofile String
The metadata profile to use for command configuration. See lvm.conf(5) for more information about profiles.

--profile String
An alias for --commandprofile or --metadataprofile, depending on the command.

-q|--quiet ...
Suppress output and log messages. Overrides --debug and --verbose. Repeat once to also suppress any prompts with answer 'no'.

--showdeprecated
Include deprecated configuration settings in the output. These settings are deprecated after a certain version. If a concrete version is specified with --atversion, deprecated settings are automatically included if
the specified version is lower than the version in which the settings were deprecated. The current and diff types include deprecated settings in their output by default, all the other types ignore deprecated set‐
tings.

--showunsupported
Include unsupported configuration settings in the output. These settings are either used for debugging or development purposes only, or their support is not yet complete and they are not meant to be used in produc‐
tion. The current and diff types include unsupported settings in their output by default, all the other types ignore unsupported settings.

--sinceversion String
Specify an LVM version in x.y.z format where x is the major version, the y is the minor version and z is the patchlevel (e.g. 2.2.106). This option is currently applicable only with --typeconfig new to display all
configuration settings introduced since given version.

-t|--test
Run in test mode. Commands will not update metadata. This is implemented by disabling all metadata writing but nevertheless returning success to the calling function. This may lead to unusual error messages in
multi-stage operations if a tool relies on reading back metadata it believes has changed but hasn't.

--typeconfig current|default|diff|full|list|missing|new|profilable|profilable-command|profilable-metadata
current prints the config settings that would be applied to an lvm command (assuming the command does not override them on the command line.) This includes: settings that have been modified in lvm config files,
settings that get their default values from config files, and default settings that have been uncommented in config files. default prints all settings with their default values. Changes made in lvm config files
are not reflected in the output. Some settings get their default values internally, and these settings are printed as comments. Other settings get their default values from config files, and these settings are
not printed as comments. diff prints only config settings that have been modified from their default values in config files (the difference between current and default.) full prints every setting uncommented and
set to the current value, i.e. how it would be used by an lvm command. This includes settings modified in config files, settings that usually get defaults internally, and settings that get defaults from config
files. list prints all config names without values. missing prints settings that are missing from the lvm config files. A missing setting that usually gets its default from config files is printed uncommented and
set to the internal default. Settings that get their default internally and are not set in config files are printed commented with the internal default. new prints config settings that have been added since the
lvm version specified by --sinceversion. They are printed with their default values. profilable prints settings with their default values that can be set from a profile. profilable-command prints settings with
their default values that can be set from a command profile. profilable-metadata prints settings with their default values that can be set from a metadata profile. Also see lvm.conf(5).

--unconfigured
Internal option used for generating config file during build.

--validate
Validate current configuration used and exit with appropriate return code. The validation is done only for the configuration at the front of the "config cascade". To validate the whole merged configuration tree,
also use --mergedconfig. The validation is done even if lvm.conf config/checks is disabled.

-v|--verbose ...
Set verbose level. Repeat from 1 to 4 times to increase the detail of messages sent to stdout and stderr.

--version
Display version information.

--withcomments
Display a full comment for each configuration node. For deprecated settings, also display comments about deprecation.

--withgeneralpreamble
Include general config file preamble.

--withlocalpreamble
Include local config file preamble.

--withspaces
Where appropriate, add more spaces in output for better readability.

--withsummary
Display a one line comment for each configuration node.

--withversions
Also display a comment containing the version of introduction for each configuration node. If the setting is deprecated, also display the version since which it is deprecated.

-y|--yes
Do not prompt for confirmation interactively but always assume the answer yes. Use with extreme caution. (For automatic no, see -qq.)

VARIABLES
String
See the option description for information about the string content.

Size[UNIT]
Size is an input number that accepts an optional unit. Input units are always treated as base two values, regardless of capitalization, e.g. 'k' and 'K' both refer to 1024. The default input unit is specified by
letter, followed by |UNIT. UNIT represents other possible input units: bBsSkKmMgGtTpPeE. b|B is bytes, s|S is sectors of 512 bytes, k|K is kilobytes, m|M is megabytes, g|G is gigabytes, t|T is terabytes, p|P is
petabytes, e|E is exabytes. (This should not be confused with the output control --units, where capital letters mean multiple of 1000.)

ENVIRONMENT VARIABLES
See lvm(8) for information about environment variables used by lvm. For example, LVM_VG_NAME can generally be substituted for a required VG parameter.

SEE ALSO
lvm(8) lvm.conf(5) lvmconfig(8)

pvchange(8) pvck(8) pvcreate(8) pvdisplay(8) pvmove(8) pvremove(8) pvresize(8) pvs(8) pvscan(8)

vgcfgbackup(8) vgcfgrestore(8) vgchange(8) vgck(8) vgcreate(8) vgconvert(8) vgdisplay(8) vgexport(8) vgextend(8) vgimport(8) vgimportclone(8) vgmerge(8) vgmknodes(8) vgreduce(8) vgremove(8) vgrename(8) vgs(8) vgscan(8)
vgsplit(8)

lvcreate(8) lvchange(8) lvconvert(8) lvdisplay(8) lvextend(8) lvreduce(8) lvremove(8) lvrename(8) lvresize(8) lvs(8) lvscan(8)

lvm-fullreport(8) lvm-lvpoll(8) lvm2-activation-generator(8) blkdeactivate(8) lvmdump(8)

dmeventd(8) lvmetad(8) lvmpolld(8) lvmlockd(8) lvmlockctl(8) clvmd(8) cmirrord(8) lvmdbusd(8)

lvmsystemid(7) lvmreport(7) lvmraid(7) lvmthin(7) lvmcache(7)

Red Hat, Inc. LVM TOOLS 2.02.176(2) (2017-11-03) LVMCONFIG(8)

lvmdiskscan

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
LVMDISKSCAN(8)                                                                                         System Manager's Manual                                                                                        LVMDISKSCAN(8)

NAME
lvmdiskscan - List devices that may be used as physical volumes

SYNOPSIS
lvmdiskscan
[ option_args ]

DESCRIPTION
lvmdiskscan scans all SCSI, (E)IDE disks, multiple devices and a bunch of other block devices in the system looking for LVM PVs. The size reported is the real device size. Define a filter in lvm.conf(5) to restrict the
scan to avoid a CD ROM, for example.

This command is deprecated, use pvs instead.

USAGE
lvmdiskscan
[ -l|--lvmpartition ]
[ --readonly ]
[ COMMON_OPTIONS ]

Common options for lvm:
[ -d|--debug ]
[ -h|--help ]
[ -q|--quiet ]
[ -t|--test ]
[ -v|--verbose ]
[ -y|--yes ]
[ --commandprofile String ]
[ --config String ]
[ --driverloaded y|n ]
[ --longhelp ]
[ --profile String ]
[ --version ]

OPTIONS
--commandprofile String
The command profile to use for command configuration. See lvm.conf(5) for more information about profiles.

--config String
Config settings for the command. These override lvm.conf settings. The String arg uses the same format as lvm.conf, or may use section/field syntax. See lvm.conf(5) for more information about config.

-d|--debug ...
Set debug level. Repeat from 1 to 6 times to increase the detail of messages sent to the log file and/or syslog (if configured).

--driverloaded y|n
If set to no, the command will not attempt to use device-mapper. For testing and debugging.

-h|--help
Display help text.

--longhelp
Display long help text.

-l|--lvmpartition
Only report PVs.

--profile String
An alias for --commandprofile or --metadataprofile, depending on the command.

-q|--quiet ...
Suppress output and log messages. Overrides --debug and --verbose. Repeat once to also suppress any prompts with answer 'no'.

--readonly
Run the command in a special read-only mode which will read on-disk metadata without needing to take any locks. This can be used to peek inside metadata used by a virtual machine image while the virtual machine is
running. It can also be used to peek inside the metadata of clustered VGs when clustered locking is not configured or running. No attempt will be made to communicate with the device-mapper kernel driver, so this
option is unable to report whether or not LVs are actually in use.

-t|--test
Run in test mode. Commands will not update metadata. This is implemented by disabling all metadata writing but nevertheless returning success to the calling function. This may lead to unusual error messages in
multi-stage operations if a tool relies on reading back metadata it believes has changed but hasn't.

-v|--verbose ...
Set verbose level. Repeat from 1 to 4 times to increase the detail of messages sent to stdout and stderr.

--version
Display version information.

-y|--yes
Do not prompt for confirmation interactively but always assume the answer yes. Use with extreme caution. (For automatic no, see -qq.)

VARIABLES
String
See the option description for information about the string content.

Size[UNIT]
Size is an input number that accepts an optional unit. Input units are always treated as base two values, regardless of capitalization, e.g. 'k' and 'K' both refer to 1024. The default input unit is specified by
letter, followed by |UNIT. UNIT represents other possible input units: bBsSkKmMgGtTpPeE. b|B is bytes, s|S is sectors of 512 bytes, k|K is kilobytes, m|M is megabytes, g|G is gigabytes, t|T is terabytes, p|P is
petabytes, e|E is exabytes. (This should not be confused with the output control --units, where capital letters mean multiple of 1000.)

ENVIRONMENT VARIABLES
See lvm(8) for information about environment variables used by lvm. For example, LVM_VG_NAME can generally be substituted for a required VG parameter.

SEE ALSO
lvm(8) lvm.conf(5) lvmconfig(8)

pvchange(8) pvck(8) pvcreate(8) pvdisplay(8) pvmove(8) pvremove(8) pvresize(8) pvs(8) pvscan(8)

vgcfgbackup(8) vgcfgrestore(8) vgchange(8) vgck(8) vgcreate(8) vgconvert(8) vgdisplay(8) vgexport(8) vgextend(8) vgimport(8) vgimportclone(8) vgmerge(8) vgmknodes(8) vgreduce(8) vgremove(8) vgrename(8) vgs(8) vgscan(8)
vgsplit(8)

lvcreate(8) lvchange(8) lvconvert(8) lvdisplay(8) lvextend(8) lvreduce(8) lvremove(8) lvrename(8) lvresize(8) lvs(8) lvscan(8)

lvm-fullreport(8) lvm-lvpoll(8) lvm2-activation-generator(8) blkdeactivate(8) lvmdump(8)

dmeventd(8) lvmetad(8) lvmpolld(8) lvmlockd(8) lvmlockctl(8) clvmd(8) cmirrord(8) lvmdbusd(8)

lvmsystemid(7) lvmreport(7) lvmraid(7) lvmthin(7) lvmcache(7)

Red Hat, Inc. LVM TOOLS 2.02.176(2) (2017-11-03) LVMDISKSCAN(8)

lvmdump

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
LVMDUMP(8)                                                                                             System Manager's Manual                                                                                            LVMDUMP(8)

NAME
lvmdump — create lvm2 information dumps for diagnostic purposes

SYNOPSIS
lvmdump [-a] [-c] [-d directory] [-h] [-l] [-m] [-p] [-s] [-u]

DESCRIPTION
lvmdump is a tool to dump various information concerning LVM2. By default, it creates a tarball suitable for submission along with a problem report.

The content of the tarball is as follows:
- dmsetup info
- table of currently running processes
- recent entries from /var/log/messages (containing system messages)
- complete lvm configuration and cache (content of /etc/lvm)
- list of device nodes present under /dev
- list of files present /sys/block
- list of files present /sys/devices/virtual/block
- if enabled with -m, metadata dump will be also included
- if enabled with -a, debug output of vgscan, pvscan and list of all available volume groups, physical volumes and logical volumes will be included
- if enabled with -c, cluster status info
- if enabled with -l, lvmetad state if running
- if enabled with -p, lvmpolld state if running
- if enabled with -s, system info and context
- if enabled with -u, udev info and context

OPTIONS
-a Advanced collection. WARNING: if lvm is already hung, then this script may hang as well if -a is used.

-c If clvmd is running, gather cluster data as well.

-d directory
Dump into a directory instead of tarball By default, lvmdump will produce a single compressed tarball containing all the information. Using this option, it can be instructed to only produce the raw dump tree,
rooted in directory.

-h Print help message

-l Include lvmetad(8) daemon dump if it is running. The dump contains cached information that is currently stored in lvmetad: VG metadata, PV metadata and various mappings in between these metadata for quick access.

-m Gather LVM metadata from the PVs This option generates a 1:1 dump of the metadata area from all PVs visible to the system, which can cause the dump to increase in size considerably. However, the metadata dump may
represent a valuable diagnostic resource.

-p Include lvmpolld(8) daemon dump if it is running. The dump contains all in-progress operation currently monitored by the daemon and partial history for all yet uncollected results of polling operations already fin‐
ished including reason.

-s Gather system info and context. Currently, this encompasses info gathered by calling lsblk command and various systemd info and context: overall state of systemd units present in the system, more detailed status of
units controlling LVM functionality and the content of systemd journal for current boot.

-u Gather udev info and context: /etc/udev/udev.conf file, udev daemon version (output of 'udevadm info --version' command), udev rules currently used in the system (content of /lib/udev/rules.d and /etc/udev/rules.d
directory), list of files in /lib/udev directory and dump of current udev database content (the output of 'udevadm info --export-db' command).

ENVIRONMENT VARIABLES
LVM_BINARY
The LVM2 binary to use. Defaults to "lvm". Sometimes you might need to set this to "/sbin/lvm.static", for example.

DMSETUP_BINARY
The dmsetup binary to use. Defaults to "dmsetup".

SEE ALSO
lvm(8)

Red Hat, Inc. LVM TOOLS 2.02.176(2) (2017-11-03) LVMDUMP(8)

lvreduce

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
LVREDUCE(8)                                                                                            System Manager's Manual                                                                                           LVREDUCE(8)

NAME
lvreduce - Reduce the size of a logical volume

SYNOPSIS
lvreduce option_args position_args
[ option_args ]

DESCRIPTION
lvreduce reduces the size of an LV. The freed logical extents are returned to the VG to be used by other LVs. A copy-on-write snapshot LV can also be reduced if less space is needed to hold COW blocks. Use lvconvert(8) to
change the number of data images in a RAID or mirrored LV.

Be careful when reducing an LV's size, because data in the reduced area is lost. Ensure that any file system on the LV is resized before running lvreduce so that the removed extents are not in use by the file system.

Sizes will be rounded if necessary. For example, the LV size must be an exact number of extents, and the size of a striped segment must be a multiple of the number of stripes.

In the usage section below, --size Size can be replaced with --extents Number. See both descriptions the options section.

USAGE
lvreduce -L|--size [-]Size[m|UNIT] LV
[ -l|--extents [-]Number[PERCENT] ]
[ -A|--autobackup y|n ]
[ -f|--force ]
[ -n|--nofsck ]
[ -r|--resizefs ]
[ --noudevsync ]
[ --reportformat basic|json ]
[ COMMON_OPTIONS ]

Common options for lvm:
[ -d|--debug ]
[ -h|--help ]
[ -q|--quiet ]
[ -t|--test ]
[ -v|--verbose ]
[ -y|--yes ]
[ --commandprofile String ]
[ --config String ]
[ --driverloaded y|n ]
[ --longhelp ]
[ --profile String ]
[ --version ]

OPTIONS
-A|--autobackup y|n
Specifies if metadata should be backed up automatically after a change. Enabling this is strongly advised! See vgcfgbackup(8) for more information.

--commandprofile String
The command profile to use for command configuration. See lvm.conf(5) for more information about profiles.

--config String
Config settings for the command. These override lvm.conf settings. The String arg uses the same format as lvm.conf, or may use section/field syntax. See lvm.conf(5) for more information about config.

-d|--debug ...
Set debug level. Repeat from 1 to 6 times to increase the detail of messages sent to the log file and/or syslog (if configured).

--driverloaded y|n
If set to no, the command will not attempt to use device-mapper. For testing and debugging.

-l|--extents [-]Number[PERCENT]
Specifies the new size of the LV in logical extents. The --size and --extents options are alternate methods of specifying size. The total number of physical extents used will be greater when redundant data is
needed for RAID levels. An alternate syntax allows the size to be determined indirectly as a percentage of the size of a related VG, LV, or set of PVs. The suffix %VG denotes the total size of the VG, the suffix
%FREE the remaining free space in the VG, and the suffix %PVS the free space in the specified PVs. For a snapshot, the size can be expressed as a percentage of the total size of the origin LV with the suffix %ORI‐
GIN (100%ORIGIN provides space for the whole origin). When expressed as a percentage, the size defines an upper limit for the number of logical extents in the new LV. The precise number of logical extents in the
new LV is not determined until the command has completed. When the plus + or minus - prefix is used, the value is not an absolute size, but is relative and added or subtracted from the current size.

-f|--force ...
Override various checks, confirmations and protections. Use with extreme caution.

-h|--help
Display help text.

--longhelp
Display long help text.

-n|--nofsck
Do not perform fsck before resizing filesystem when filesystem requires it. You may need to use --force to proceed with this option.

--noudevsync
Disables udev synchronisation. The process will not wait for notification from udev. It will continue irrespective of any possible udev processing in the background. Only use this if udev is not running or has
rules that ignore the devices LVM creates.

--profile String
An alias for --commandprofile or --metadataprofile, depending on the command.

-q|--quiet ...
Suppress output and log messages. Overrides --debug and --verbose. Repeat once to also suppress any prompts with answer 'no'.

--reportformat basic|json
Overrides current output format for reports which is defined globally by the report/output_format setting in lvm.conf. basic is the original format with columns and rows. If there is more than one report per com‐
mand, each report is prefixed with the report name for identification. json produces report output in JSON format. See lvmreport(7) for more information.

-r|--resizefs
Resize underlying filesystem together with the LV using fsadm(8).

-L|--size [-]Size[m|UNIT]
Specifies the new size of the LV. The --size and --extents options are alternate methods of specifying size. The total number of physical extents used will be greater when redundant data is needed for RAID lev‐
els. When the plus + or minus - prefix is used, the value is not an absolute size, but is relative and added or subtracted from the current size.

-t|--test
Run in test mode. Commands will not update metadata. This is implemented by disabling all metadata writing but nevertheless returning success to the calling function. This may lead to unusual error messages in
multi-stage operations if a tool relies on reading back metadata it believes has changed but hasn't.

-v|--verbose ...
Set verbose level. Repeat from 1 to 4 times to increase the detail of messages sent to stdout and stderr.

--version
Display version information.

-y|--yes
Do not prompt for confirmation interactively but always assume the answer yes. Use with extreme caution. (For automatic no, see -qq.)

VARIABLES
LV
Logical Volume name. See lvm(8) for valid names. An LV positional arg generally includes the VG name and LV name, e.g. VG/LV.

String
See the option description for information about the string content.

Size[UNIT]
Size is an input number that accepts an optional unit. Input units are always treated as base two values, regardless of capitalization, e.g. 'k' and 'K' both refer to 1024. The default input unit is specified by
letter, followed by |UNIT. UNIT represents other possible input units: bBsSkKmMgGtTpPeE. b|B is bytes, s|S is sectors of 512 bytes, k|K is kilobytes, m|M is megabytes, g|G is gigabytes, t|T is terabytes, p|P is
petabytes, e|E is exabytes. (This should not be confused with the output control --units, where capital letters mean multiple of 1000.)

ENVIRONMENT VARIABLES
See lvm(8) for information about environment variables used by lvm. For example, LVM_VG_NAME can generally be substituted for a required VG parameter.

EXAMPLES
Reduce the size of an LV by 3 logical extents:
lvreduce -l -3 vg00/lvol1

SEE ALSO
lvm(8) lvm.conf(5) lvmconfig(8)

pvchange(8) pvck(8) pvcreate(8) pvdisplay(8) pvmove(8) pvremove(8) pvresize(8) pvs(8) pvscan(8)

vgcfgbackup(8) vgcfgrestore(8) vgchange(8) vgck(8) vgcreate(8) vgconvert(8) vgdisplay(8) vgexport(8) vgextend(8) vgimport(8) vgimportclone(8) vgmerge(8) vgmknodes(8) vgreduce(8) vgremove(8) vgrename(8) vgs(8) vgscan(8)
vgsplit(8)

lvcreate(8) lvchange(8) lvconvert(8) lvdisplay(8) lvextend(8) lvreduce(8) lvremove(8) lvrename(8) lvresize(8) lvs(8) lvscan(8)

lvm-fullreport(8) lvm-lvpoll(8) lvm2-activation-generator(8) blkdeactivate(8) lvmdump(8)

dmeventd(8) lvmetad(8) lvmpolld(8) lvmlockd(8) lvmlockctl(8) clvmd(8) cmirrord(8) lvmdbusd(8)

lvmsystemid(7) lvmreport(7) lvmraid(7) lvmthin(7) lvmcache(7)

Red Hat, Inc. LVM TOOLS 2.02.176(2) (2017-11-03) LVREDUCE(8)

lvremove

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
LVREMOVE(8)                                                                                            System Manager's Manual                                                                                           LVREMOVE(8)

NAME
lvremove - Remove logical volume(s) from the system

SYNOPSIS
lvremove position_args
[ option_args ]

DESCRIPTION
lvremove removes one or more LVs. For standard LVs, this returns the logical extents that were used by the LV to the VG for use by other LVs.

Confirmation will be requested before deactivating any active LV prior to removal. LVs cannot be deactivated or removed while they are open (e.g. if they contain a mounted filesystem). Removing an origin LV will also
remove all dependent snapshots.

When a single force option is used, LVs are removed without confirmation, and the command will try to deactivate unused LVs.

To remove damaged LVs, two force options may be required (-ff).

Historical LVs

If the configuration setting metadata/record_lvs_history is enabled and the LV being removed forms part of the history of at least one LV that is still present, then a simplified representation of the LV will be retained.
This includes the time of removal (lv_time_removed reporting field), creation time (lv_time), name (lv_name), LV uuid (lv_uuid) and VG name (vg_name). This allows later reporting to see the ancestry chain of thin snapshot
volumes, even after some intermediate LVs have been removed. The names of such historical LVs acquire a hyphen as a prefix (e.g. '-lvol1') and cannot be reactivated. Use lvremove a second time, with the hyphen, to remove
the record of the former LV completely.

USAGE
lvremove VG|LV|Tag|Select ...
[ -A|--autobackup y|n ]
[ -f|--force ]
[ -S|--select String ]
[ --nohistory ]
[ --noudevsync ]
[ --reportformat basic|json ]
[ COMMON_OPTIONS ]

Common options for lvm:
[ -d|--debug ]
[ -h|--help ]
[ -q|--quiet ]
[ -t|--test ]
[ -v|--verbose ]
[ -y|--yes ]
[ --commandprofile String ]
[ --config String ]
[ --driverloaded y|n ]
[ --longhelp ]
[ --profile String ]
[ --version ]

OPTIONS
-A|--autobackup y|n
Specifies if metadata should be backed up automatically after a change. Enabling this is strongly advised! See vgcfgbackup(8) for more information.

--commandprofile String
The command profile to use for command configuration. See lvm.conf(5) for more information about profiles.

--config String
Config settings for the command. These override lvm.conf settings. The String arg uses the same format as lvm.conf, or may use section/field syntax. See lvm.conf(5) for more information about config.

-d|--debug ...
Set debug level. Repeat from 1 to 6 times to increase the detail of messages sent to the log file and/or syslog (if configured).

--driverloaded y|n
If set to no, the command will not attempt to use device-mapper. For testing and debugging.

-f|--force ...
Override various checks, confirmations and protections. Use with extreme caution.

-h|--help
Display help text.

--longhelp
Display long help text.

--nohistory
Do not record history of LVs being removed. This has no effect unless the configuration setting metadata/record_lvs_history is enabled.

--noudevsync
Disables udev synchronisation. The process will not wait for notification from udev. It will continue irrespective of any possible udev processing in the background. Only use this if udev is not running or has
rules that ignore the devices LVM creates.

--profile String
An alias for --commandprofile or --metadataprofile, depending on the command.

-q|--quiet ...
Suppress output and log messages. Overrides --debug and --verbose. Repeat once to also suppress any prompts with answer 'no'.

--reportformat basic|json
Overrides current output format for reports which is defined globally by the report/output_format setting in lvm.conf. basic is the original format with columns and rows. If there is more than one report per com‐
mand, each report is prefixed with the report name for identification. json produces report output in JSON format. See lvmreport(7) for more information.

-S|--select String
Select objects for processing and reporting based on specified criteria. The criteria syntax is described by --select help and lvmreport(7). For reporting commands, one row is displayed for each object matching
the criteria. See --options help for selectable object fields. Rows can be displayed with an additional "selected" field (-o selected) showing 1 if the row matches the selection and 0 otherwise. For non-report‐
ing commands which process LVM entities, the selection is used to choose items to process.

-t|--test
Run in test mode. Commands will not update metadata. This is implemented by disabling all metadata writing but nevertheless returning success to the calling function. This may lead to unusual error messages in
multi-stage operations if a tool relies on reading back metadata it believes has changed but hasn't.

-v|--verbose ...
Set verbose level. Repeat from 1 to 4 times to increase the detail of messages sent to stdout and stderr.

--version
Display version information.

-y|--yes
Do not prompt for confirmation interactively but always assume the answer yes. Use with extreme caution. (For automatic no, see -qq.)

VARIABLES
VG
Volume Group name. See lvm(8) for valid names.

LV
Logical Volume name. See lvm(8) for valid names. An LV positional arg generally includes the VG name and LV name, e.g. VG/LV.

Tag
Tag name. See lvm(8) for information about tag names and using tags in place of a VG, LV or PV.

Select
Select indicates that a required positional parameter can be omitted if the --select option is used. No arg appears in this position.

String
See the option description for information about the string content.

Size[UNIT]
Size is an input number that accepts an optional unit. Input units are always treated as base two values, regardless of capitalization, e.g. 'k' and 'K' both refer to 1024. The default input unit is specified by
letter, followed by |UNIT. UNIT represents other possible input units: bBsSkKmMgGtTpPeE. b|B is bytes, s|S is sectors of 512 bytes, k|K is kilobytes, m|M is megabytes, g|G is gigabytes, t|T is terabytes, p|P is
petabytes, e|E is exabytes. (This should not be confused with the output control --units, where capital letters mean multiple of 1000.)

ENVIRONMENT VARIABLES
See lvm(8) for information about environment variables used by lvm. For example, LVM_VG_NAME can generally be substituted for a required VG parameter.

EXAMPLES
Remove an active LV without asking for confirmation.
lvremove -f vg00/lvol1

Remove all LVs the specified VG.
lvremove vg00

SEE ALSO
lvm(8) lvm.conf(5) lvmconfig(8)

pvchange(8) pvck(8) pvcreate(8) pvdisplay(8) pvmove(8) pvremove(8) pvresize(8) pvs(8) pvscan(8)

vgcfgbackup(8) vgcfgrestore(8) vgchange(8) vgck(8) vgcreate(8) vgconvert(8) vgdisplay(8) vgexport(8) vgextend(8) vgimport(8) vgimportclone(8) vgmerge(8) vgmknodes(8) vgreduce(8) vgremove(8) vgrename(8) vgs(8) vgscan(8)
vgsplit(8)

lvcreate(8) lvchange(8) lvconvert(8) lvdisplay(8) lvextend(8) lvreduce(8) lvremove(8) lvrename(8) lvresize(8) lvs(8) lvscan(8)

lvm-fullreport(8) lvm-lvpoll(8) lvm2-activation-generator(8) blkdeactivate(8) lvmdump(8)

dmeventd(8) lvmetad(8) lvmpolld(8) lvmlockd(8) lvmlockctl(8) clvmd(8) cmirrord(8) lvmdbusd(8)

lvmsystemid(7) lvmreport(7) lvmraid(7) lvmthin(7) lvmcache(7)

Red Hat, Inc. LVM TOOLS 2.02.176(2) (2017-11-03) LVREMOVE(8)

lvrename

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
LVRENAME(8)                                                                                            System Manager's Manual                                                                                           LVRENAME(8)

NAME
lvrename - Rename a logical volume

SYNOPSIS
lvrename position_args
[ option_args ]

DESCRIPTION
lvrename renames an existing LV or a historical LV (see lvremove for historical LV information.)

USAGE
lvrename VG LV LV_new
[ COMMON_OPTIONS ]

lvrename LV LV_new
[ COMMON_OPTIONS ]

Common options for command:
[ -A|--autobackup y|n ]
[ --noudevsync ]
[ --reportformat basic|json ]

Common options for lvm:
[ -d|--debug ]
[ -h|--help ]
[ -q|--quiet ]
[ -t|--test ]
[ -v|--verbose ]
[ -y|--yes ]
[ --commandprofile String ]
[ --config String ]
[ --driverloaded y|n ]
[ --longhelp ]
[ --profile String ]
[ --version ]

OPTIONS
-A|--autobackup y|n
Specifies if metadata should be backed up automatically after a change. Enabling this is strongly advised! See vgcfgbackup(8) for more information.

--commandprofile String
The command profile to use for command configuration. See lvm.conf(5) for more information about profiles.

--config String
Config settings for the command. These override lvm.conf settings. The String arg uses the same format as lvm.conf, or may use section/field syntax. See lvm.conf(5) for more information about config.

-d|--debug ...
Set debug level. Repeat from 1 to 6 times to increase the detail of messages sent to the log file and/or syslog (if configured).

--driverloaded y|n
If set to no, the command will not attempt to use device-mapper. For testing and debugging.

-h|--help
Display help text.

--longhelp
Display long help text.

--noudevsync
Disables udev synchronisation. The process will not wait for notification from udev. It will continue irrespective of any possible udev processing in the background. Only use this if udev is not running or has
rules that ignore the devices LVM creates.

--profile String
An alias for --commandprofile or --metadataprofile, depending on the command.

-q|--quiet ...
Suppress output and log messages. Overrides --debug and --verbose. Repeat once to also suppress any prompts with answer 'no'.

--reportformat basic|json
Overrides current output format for reports which is defined globally by the report/output_format setting in lvm.conf. basic is the original format with columns and rows. If there is more than one report per com‐
mand, each report is prefixed with the report name for identification. json produces report output in JSON format. See lvmreport(7) for more information.

-t|--test
Run in test mode. Commands will not update metadata. This is implemented by disabling all metadata writing but nevertheless returning success to the calling function. This may lead to unusual error messages in
multi-stage operations if a tool relies on reading back metadata it believes has changed but hasn't.

-v|--verbose ...
Set verbose level. Repeat from 1 to 4 times to increase the detail of messages sent to stdout and stderr.

--version
Display version information.

-y|--yes
Do not prompt for confirmation interactively but always assume the answer yes. Use with extreme caution. (For automatic no, see -qq.)

VARIABLES
VG
Volume Group name. See lvm(8) for valid names.

LV
Logical Volume name. See lvm(8) for valid names. An LV positional arg generally includes the VG name and LV name, e.g. VG/LV.

String
See the option description for information about the string content.

Size[UNIT]
Size is an input number that accepts an optional unit. Input units are always treated as base two values, regardless of capitalization, e.g. 'k' and 'K' both refer to 1024. The default input unit is specified by
letter, followed by |UNIT. UNIT represents other possible input units: bBsSkKmMgGtTpPeE. b|B is bytes, s|S is sectors of 512 bytes, k|K is kilobytes, m|M is megabytes, g|G is gigabytes, t|T is terabytes, p|P is
petabytes, e|E is exabytes. (This should not be confused with the output control --units, where capital letters mean multiple of 1000.)

ENVIRONMENT VARIABLES
See lvm(8) for information about environment variables used by lvm. For example, LVM_VG_NAME can generally be substituted for a required VG parameter.

EXAMPLES
Rename "lvold" to "lvnew":
lvrename /dev/vg02/lvold vg02/lvnew

An alternate syntax to rename "lvold" to "lvnew":
lvrename vg02 lvold lvnew

SEE ALSO
lvm(8) lvm.conf(5) lvmconfig(8)

pvchange(8) pvck(8) pvcreate(8) pvdisplay(8) pvmove(8) pvremove(8) pvresize(8) pvs(8) pvscan(8)

vgcfgbackup(8) vgcfgrestore(8) vgchange(8) vgck(8) vgcreate(8) vgconvert(8) vgdisplay(8) vgexport(8) vgextend(8) vgimport(8) vgimportclone(8) vgmerge(8) vgmknodes(8) vgreduce(8) vgremove(8) vgrename(8) vgs(8) vgscan(8)
vgsplit(8)

lvcreate(8) lvchange(8) lvconvert(8) lvdisplay(8) lvextend(8) lvreduce(8) lvremove(8) lvrename(8) lvresize(8) lvs(8) lvscan(8)

lvm-fullreport(8) lvm-lvpoll(8) lvm2-activation-generator(8) blkdeactivate(8) lvmdump(8)

dmeventd(8) lvmetad(8) lvmpolld(8) lvmlockd(8) lvmlockctl(8) clvmd(8) cmirrord(8) lvmdbusd(8)

lvmsystemid(7) lvmreport(7) lvmraid(7) lvmthin(7) lvmcache(7)

Red Hat, Inc. LVM TOOLS 2.02.176(2) (2017-11-03) LVRENAME(8)

lvresize

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
LVRESIZE(8)                                                                                            System Manager's Manual                                                                                           LVRESIZE(8)

NAME
lvresize - Resize a logical volume

SYNOPSIS
lvresize option_args position_args
[ option_args ]
[ position_args ]

--alloc contiguous|cling|cling_by_tags|normal|anywhere|inherit
-A|--autobackup y|n
--commandprofile String
--config String
-d|--debug
--driverloaded y|n
-l|--extents [+|-]Number[PERCENT]
-f|--force
-h|--help
--longhelp
-n|--nofsck
--nosync
--noudevsync
--poolmetadatasize [+]Size[m|UNIT]
--profile String
-q|--quiet
--reportformat basic|json
-r|--resizefs
-L|--size [+|-]Size[m|UNIT]
-i|--stripes Number
-I|--stripesize Size[k|UNIT]
-t|--test
--type linear|striped|snapshot|mirror|raid|thin|cache|thin-pool|cache-pool
-v|--verbose
--version
-y|--yes

DESCRIPTION
lvresize resizes an LV in the same way as lvextend and lvreduce. See lvextend(8) and lvreduce(8) for more information.

In the usage section below, --size Size can be replaced with --extents Number. See both descriptions the options section.

USAGE
Resize an LV by a specified size.

lvresize -L|--size [+|-]Size[m|UNIT] LV
[ -l|--extents [+|-]Number[PERCENT] ]
[ -r|--resizefs ]
[ --poolmetadatasize [+]Size[m|UNIT] ]
[ COMMON_OPTIONS ]
[ PV ... ]
-

Resize an LV by specified PV extents.

lvresize LV PV ...
[ -r|--resizefs ]
[ COMMON_OPTIONS ]
-

Resize a pool metadata SubLV by a specified size.

lvresize --poolmetadatasize [+]Size[m|UNIT] LV_thinpool
[ COMMON_OPTIONS ]
[ PV ... ]
-

Common options for command:
[ -A|--autobackup y|n ]
[ -f|--force ]
[ -n|--nofsck ]
[ -i|--stripes Number ]
[ -I|--stripesize Size[k|UNIT] ]
[ --alloc contiguous|cling|cling_by_tags|normal|anywhere|inherit ]
[ --nosync ]
[ --noudevsync ]
[ --reportformat basic|json ]
[ --type linear|striped|snapshot|mirror|raid|thin|cache|thin-pool|cache-pool ]

Common options for lvm:
[ -d|--debug ]
[ -h|--help ]
[ -q|--quiet ]
[ -t|--test ]
[ -v|--verbose ]
[ -y|--yes ]
[ --commandprofile String ]
[ --config String ]
[ --driverloaded y|n ]
[ --longhelp ]
[ --profile String ]
[ --version ]

OPTIONS
--alloc contiguous|cling|cling_by_tags|normal|anywhere|inherit
Determines the allocation policy when a command needs to allocate Physical Extents (PEs) from the VG. Each VG and LV has an allocation policy which can be changed with vgchange/lvchange, or overriden on the command
line. normal applies common sense rules such as not placing parallel stripes on the same PV. inherit applies the VG policy to an LV. contiguous requires new PEs be placed adjacent to existing PEs. cling places
new PEs on the same PV as existing PEs in the same stripe of the LV. If there are sufficient PEs for an allocation, but normal does not use them, anywhere will use them even if it reduces performance, e.g. by
placing two stripes on the same PV. Optional positional PV args on the command line can also be used to limit which PVs the command will use for allocation. See lvm(8) for more information about allocation.

-A|--autobackup y|n
Specifies if metadata should be backed up automatically after a change. Enabling this is strongly advised! See vgcfgbackup(8) for more information.

--commandprofile String
The command profile to use for command configuration. See lvm.conf(5) for more information about profiles.

--config String
Config settings for the command. These override lvm.conf settings. The String arg uses the same format as lvm.conf, or may use section/field syntax. See lvm.conf(5) for more information about config.

-d|--debug ...
Set debug level. Repeat from 1 to 6 times to increase the detail of messages sent to the log file and/or syslog (if configured).

--driverloaded y|n
If set to no, the command will not attempt to use device-mapper. For testing and debugging.

-l|--extents [+|-]Number[PERCENT]
Specifies the new size of the LV in logical extents. The --size and --extents options are alternate methods of specifying size. The total number of physical extents used will be greater when redundant data is
needed for RAID levels. An alternate syntax allows the size to be determined indirectly as a percentage of the size of a related VG, LV, or set of PVs. The suffix %VG denotes the total size of the VG, the suffix
%FREE the remaining free space in the VG, and the suffix %PVS the free space in the specified PVs. For a snapshot, the size can be expressed as a percentage of the total size of the origin LV with the suffix %ORI‐
GIN (100%ORIGIN provides space for the whole origin). When expressed as a percentage, the size defines an upper limit for the number of logical extents in the new LV. The precise number of logical extents in the
new LV is not determined until the command has completed. When the plus + or minus - prefix is used, the value is not an absolute size, but is relative and added or subtracted from the current size.

-f|--force ...
Override various checks, confirmations and protections. Use with extreme caution.

-h|--help
Display help text.

--longhelp
Display long help text.

-n|--nofsck
Do not perform fsck before resizing filesystem when filesystem requires it. You may need to use --force to proceed with this option.

--nosync
Causes the creation of mirror, raid1, raid4, raid5 and raid10 to skip the initial synchronization. In case of mirror, raid1 and raid10, any data written afterwards will be mirrored, but the original contents will
not be copied. In case of raid4 and raid5, no parity blocks will be written, though any data written afterwards will cause parity blocks to be stored. This is useful for skipping a potentially long and resource
intensive initial sync of an empty mirror/raid1/raid4/raid5 and raid10 LV. This option is not valid for raid6, because raid6 relies on proper parity (P and Q Syndromes) being created during initial synchronization
in order to reconstruct proper user date in case of device failures. raid0 and raid0_meta do not provide any data copies or parity support and thus do not support initial synchronization.

--noudevsync
Disables udev synchronisation. The process will not wait for notification from udev. It will continue irrespective of any possible udev processing in the background. Only use this if udev is not running or has
rules that ignore the devices LVM creates.

--poolmetadatasize [+]Size[m|UNIT]
Specifies the new size of the pool metadata LV. The plus prefix + can be used, in which case the value is added to the current size.

--profile String
An alias for --commandprofile or --metadataprofile, depending on the command.

-q|--quiet ...
Suppress output and log messages. Overrides --debug and --verbose. Repeat once to also suppress any prompts with answer 'no'.

--reportformat basic|json
Overrides current output format for reports which is defined globally by the report/output_format setting in lvm.conf. basic is the original format with columns and rows. If there is more than one report per com‐
mand, each report is prefixed with the report name for identification. json produces report output in JSON format. See lvmreport(7) for more information.

-r|--resizefs
Resize underlying filesystem together with the LV using fsadm(8).

-L|--size [+|-]Size[m|UNIT]
Specifies the new size of the LV. The --size and --extents options are alternate methods of specifying size. The total number of physical extents used will be greater when redundant data is needed for RAID lev‐
els. When the plus + or minus - prefix is used, the value is not an absolute size, but is relative and added or subtracted from the current size.

-i|--stripes Number
Specifies the number of stripes in a striped LV. This is the number of PVs (devices) that a striped LV is spread across. Data that appears sequential in the LV is spread across multiple devices in units of the
stripe size (see --stripesize). This does not change existing allocated space, but only applies to space being allocated by the command. When creating a RAID 4/5/6 LV, this number does not include the extra
devices that are required for parity. The largest number depends on the RAID type (raid0: 64, raid10: 32, raid4/5: 63, raid6: 62), and when unspecified, the default depends on the RAID type (raid0: 2, raid10: 2,
raid4/5: 3, raid6: 5.) To stripe a new raid LV across all PVs by default, see lvm.conf allocation/raid_stripe_all_devices.

-I|--stripesize Size[k|UNIT]
The amount of data that is written to one device before moving to the next in a striped LV.

-t|--test
Run in test mode. Commands will not update metadata. This is implemented by disabling all metadata writing but nevertheless returning success to the calling function. This may lead to unusual error messages in
multi-stage operations if a tool relies on reading back metadata it believes has changed but hasn't.

--type linear|striped|snapshot|mirror|raid|thin|cache|thin-pool|cache-pool
The LV type, also known as "segment type" or "segtype". See usage descriptions for the specific ways to use these types. For more information about redundancy and performance (raid<N>, mirror, striped, linear)
see lvmraid(7). For thin provisioning (thin, thin-pool) see lvmthin(7). For performance caching (cache, cache-pool) see lvmcache(7). For copy-on-write snapshots (snapshot) see usage definitions. Several com‐
mands omit an explicit type option because the type is inferred from other options or shortcuts (e.g. --stripes, --mirrors, --snapshot, --virtualsize, --thin, --cache). Use inferred types with care because it can
lead to unexpected results.

-v|--verbose ...
Set verbose level. Repeat from 1 to 4 times to increase the detail of messages sent to stdout and stderr.

--version
Display version information.

-y|--yes
Do not prompt for confirmation interactively but always assume the answer yes. Use with extreme caution. (For automatic no, see -qq.)

VARIABLES
LV
Logical Volume name. See lvm(8) for valid names. An LV positional arg generally includes the VG name and LV name, e.g. VG/LV. LV followed by _<type> indicates that an LV of the given type is required. (raid rep‐
resents raid<N> type)

PV
Physical Volume name, a device path under /dev. For commands managing physical extents, a PV positional arg generally accepts a suffix indicating a range (or multiple ranges) of physical extents (PEs). When the
first PE is omitted, it defaults to the start of the device, and when the last PE is omitted it defaults to end. Start and end range (inclusive): PV[:PE-PE]... Start and length range (counting from 0):
PV[:PE+PE]...

String
See the option description for information about the string content.

Size[UNIT]
Size is an input number that accepts an optional unit. Input units are always treated as base two values, regardless of capitalization, e.g. 'k' and 'K' both refer to 1024. The default input unit is specified by
letter, followed by |UNIT. UNIT represents other possible input units: bBsSkKmMgGtTpPeE. b|B is bytes, s|S is sectors of 512 bytes, k|K is kilobytes, m|M is megabytes, g|G is gigabytes, t|T is terabytes, p|P is
petabytes, e|E is exabytes. (This should not be confused with the output control --units, where capital letters mean multiple of 1000.)

ENVIRONMENT VARIABLES
See lvm(8) for information about environment variables used by lvm. For example, LVM_VG_NAME can generally be substituted for a required VG parameter.

EXAMPLES
Extend an LV by 16MB using specific physical extents:
lvresize -L+16M vg1/lv1 /dev/sda:0-1 /dev/sdb:0-1

SEE ALSO
lvm(8) lvm.conf(5) lvmconfig(8)

pvchange(8) pvck(8) pvcreate(8) pvdisplay(8) pvmove(8) pvremove(8) pvresize(8) pvs(8) pvscan(8)

vgcfgbackup(8) vgcfgrestore(8) vgchange(8) vgck(8) vgcreate(8) vgconvert(8) vgdisplay(8) vgexport(8) vgextend(8) vgimport(8) vgimportclone(8) vgmerge(8) vgmknodes(8) vgreduce(8) vgremove(8) vgrename(8) vgs(8) vgscan(8)
vgsplit(8)

lvcreate(8) lvchange(8) lvconvert(8) lvdisplay(8) lvextend(8) lvreduce(8) lvremove(8) lvrename(8) lvresize(8) lvs(8) lvscan(8)

lvm-fullreport(8) lvm-lvpoll(8) lvm2-activation-generator(8) blkdeactivate(8) lvmdump(8)

dmeventd(8) lvmetad(8) lvmpolld(8) lvmlockd(8) lvmlockctl(8) clvmd(8) cmirrord(8) lvmdbusd(8)

lvmsystemid(7) lvmreport(7) lvmraid(7) lvmthin(7) lvmcache(7)

Red Hat, Inc. LVM TOOLS 2.02.176(2) (2017-11-03) LVRESIZE(8)

lvs

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
LVS(8)                                                                                                 System Manager's Manual                                                                                                LVS(8)

NAME
lvs - Display information about logical volumes

SYNOPSIS
lvs
[ option_args ]
[ position_args ]

DESCRIPTION
lvs produces formatted output about LVs.

USAGE
lvs
[ -H|--history ]
[ -a|--all ]
[ -o|--options String ]
[ -S|--select String ]
[ -O|--sort String ]
[ --segments ]
[ --aligned ]
[ --binary ]
[ --configreport log|vg|lv|pv|pvseg|seg ]
[ --foreign ]
[ --ignorelockingfailure ]
[ --ignoreskippedcluster ]
[ --logonly ]
[ --nameprefixes ]
[ --noheadings ]
[ --nolocking ]
[ --nosuffix ]
[ --readonly ]
[ --reportformat basic|json ]
[ --rows ]
[ --separator String ]
[ --shared ]
[ --trustcache ]
[ --unbuffered ]
[ --units r|R|h|H|b|B|s|S|k|K|m|M|g|G|t|T|p|P|e|E ]
[ --unquoted ]
[ COMMON_OPTIONS ]
[ VG|LV|Tag ... ]

Common options for lvm:
[ -d|--debug ]
[ -h|--help ]
[ -q|--quiet ]
[ -t|--test ]
[ -v|--verbose ]
[ -y|--yes ]
[ --commandprofile String ]
[ --config String ]
[ --driverloaded y|n ]
[ --longhelp ]
[ --profile String ]
[ --version ]

OPTIONS
--aligned
Use with --separator to align the output columns

-a|--all
Show information about internal LVs. These are components of normal LVs, such as mirrors, which are not independently accessible, e.g. not mountable.

--binary
Use binary values "0" or "1" instead of descriptive literal values for columns that have exactly two valid values to report (not counting the "unknown" value which denotes that the value could not be determined).

--commandprofile String
The command profile to use for command configuration. See lvm.conf(5) for more information about profiles.

--config String
Config settings for the command. These override lvm.conf settings. The String arg uses the same format as lvm.conf, or may use section/field syntax. See lvm.conf(5) for more information about config.

--configreport log|vg|lv|pv|pvseg|seg
See lvmreport(7).

-d|--debug ...
Set debug level. Repeat from 1 to 6 times to increase the detail of messages sent to the log file and/or syslog (if configured).

--driverloaded y|n
If set to no, the command will not attempt to use device-mapper. For testing and debugging.

--foreign
Report/display foreign VGs that would otherwise be skipped. See lvmsystemid(7) for more information about foreign VGs.

-h|--help
Display help text.

-H|--history
Include historical LVs in the output. (This has no effect unless LVs were removed while lvm.conf metadata/record_lvs_history was enabled.

--ignorelockingfailure
Allows a command to continue with read-only metadata operations after locking failures.

--ignoreskippedcluster
Use to avoid exiting with an non-zero status code if the command is run without clustered locking and clustered VGs are skipped.

--logonly
Suppress command report and display only log report.

--longhelp
Display long help text.

--nameprefixes
Add an "LVM2_" prefix plus the field name to the output. Useful with --noheadings to produce a list of field=value pairs that can be used to set environment variables (for example, in udev rules).

--noheadings
Suppress the headings line that is normally the first line of output. Useful if grepping the output.

--nolocking
Disable locking.

--nosuffix
Suppress the suffix on output sizes. Use with --units (except h and H) if processing the output.

-o|--options String
Comma-separated, ordered list of fields to display in columns. String arg syntax is: [+|-|#]Field1[,Field2 ...] The prefix + will append the specified fields to the default fields, - will remove the specified
fields from the default fields, and # will compact specified fields (removing them when empty for all rows.) Use -o help to view the list of all available fields. Use separate lists of fields to add, remove or
compact by repeating the -o option: -o+field1,field2 -o-field3,field4 -o#field5. These lists are evaluated from left to right. Use field name lv_all to view all LV fields, vg_all all VG fields, pv_all all PV
fields, pvseg_all all PV segment fields, seg_all all LV segment fields, and pvseg_all all PV segment columns. See the lvm.conf report section for more config options. See lvmreport(7) for more information about
reporting.

--profile String
An alias for --commandprofile or --metadataprofile, depending on the command.

-q|--quiet ...
Suppress output and log messages. Overrides --debug and --verbose. Repeat once to also suppress any prompts with answer 'no'.

--readonly
Run the command in a special read-only mode which will read on-disk metadata without needing to take any locks. This can be used to peek inside metadata used by a virtual machine image while the virtual machine is
running. It can also be used to peek inside the metadata of clustered VGs when clustered locking is not configured or running. No attempt will be made to communicate with the device-mapper kernel driver, so this
option is unable to report whether or not LVs are actually in use.

--reportformat basic|json
Overrides current output format for reports which is defined globally by the report/output_format setting in lvm.conf. basic is the original format with columns and rows. If there is more than one report per com‐
mand, each report is prefixed with the report name for identification. json produces report output in JSON format. See lvmreport(7) for more information.

--rows
Output columns as rows.

--segments
Use default columns that emphasize segment information.

-S|--select String
Select objects for processing and reporting based on specified criteria. The criteria syntax is described by --select help and lvmreport(7). For reporting commands, one row is displayed for each object matching
the criteria. See --options help for selectable object fields. Rows can be displayed with an additional "selected" field (-o selected) showing 1 if the row matches the selection and 0 otherwise. For non-report‐
ing commands which process LVM entities, the selection is used to choose items to process.

--separator String
String to use to separate each column. Useful if grepping the output.

--shared
Report/display shared VGs that would otherwise be skipped when lvmlockd is not being used on the host. See lvmlockd(8) for more information about shared VGs.

-O|--sort String
Comma-separated ordered list of columns to sort by. Replaces the default selection. Precede any column with - for a reverse sort on that column.

-t|--test
Run in test mode. Commands will not update metadata. This is implemented by disabling all metadata writing but nevertheless returning success to the calling function. This may lead to unusual error messages in
multi-stage operations if a tool relies on reading back metadata it believes has changed but hasn't.

--trustcache
Avoids certain device scanning during command processing. Do not use.

--unbuffered
Produce output immediately without sorting or aligning the columns properly.

--units r|R|h|H|b|B|s|S|k|K|m|M|g|G|t|T|p|P|e|E
All sizes are output in these units: human-(r)eadable with '<' rounding indicator, (h)uman-readable, (b)ytes, (s)ectors, (k)ilobytes, (m)egabytes, (g)igabytes, (t)erabytes, (p)etabytes, (e)xabytes. Capitalise to
use multiples of 1000 (S.I.) instead of 1024. Custom units can be specified, e.g. --units 3M.

--unquoted
When used with --nameprefixes, output values in the field=value pairs are not quoted.

-v|--verbose ...
Set verbose level. Repeat from 1 to 4 times to increase the detail of messages sent to stdout and stderr.

--version
Display version information.

-y|--yes
Do not prompt for confirmation interactively but always assume the answer yes. Use with extreme caution. (For automatic no, see -qq.)

VARIABLES
VG
Volume Group name. See lvm(8) for valid names.

LV
Logical Volume name. See lvm(8) for valid names. An LV positional arg generally includes the VG name and LV name, e.g. VG/LV.

Tag
Tag name. See lvm(8) for information about tag names and using tags in place of a VG, LV or PV.

String
See the option description for information about the string content.

Size[UNIT]
Size is an input number that accepts an optional unit. Input units are always treated as base two values, regardless of capitalization, e.g. 'k' and 'K' both refer to 1024. The default input unit is specified by
letter, followed by |UNIT. UNIT represents other possible input units: bBsSkKmMgGtTpPeE. b|B is bytes, s|S is sectors of 512 bytes, k|K is kilobytes, m|M is megabytes, g|G is gigabytes, t|T is terabytes, p|P is
petabytes, e|E is exabytes. (This should not be confused with the output control --units, where capital letters mean multiple of 1000.)

ENVIRONMENT VARIABLES
See lvm(8) for information about environment variables used by lvm. For example, LVM_VG_NAME can generally be substituted for a required VG parameter.

NOTES
The lv_attr bits are:

1 Volume type: (C)ache, (m)irrored, (M)irrored without initial sync, (o)rigin, (O)rigin with merging snapshot, (r)aid, (R)aid without initial sync, (s)napshot, merging (S)napshot, (p)vmove, (v)irtual, mirror or raid
(i)mage, mirror or raid (I)mage out-of-sync, mirror (l)og device, under (c)onversion, thin (V)olume, (t)hin pool, (T)hin pool data, raid or pool m(e)tadata or pool metadata spare.

2 Permissions: (w)riteable, (r)ead-only, (R)ead-only activation of non-read-only volume

3 Allocation policy: (a)nywhere, (c)ontiguous, (i)nherited, c(l)ing, (n)ormal This is capitalised if the volume is currently locked against allocation changes, for example during pvmove(8).

4 fixed (m)inor

5 State: (a)ctive, (h)istorical, (s)uspended, (I)nvalid snapshot, invalid (S)uspended snapshot, snapshot (m)erge failed, suspended snapshot (M)erge failed, mapped (d)evice present without tables, mapped device present
with (i)nactive table, thin-pool (c)heck needed, suspended thin-pool (C)heck needed, (X) unknown

6 device (o)pen, (X) unknown

7 Target type: (C)ache, (m)irror, (r)aid, (s)napshot, (t)hin, (u)nknown, (v)irtual. This groups logical volumes related to the same kernel target together. So, for example, mirror images, mirror logs as well as mirrors
themselves appear as (m) if they use the original device-mapper mirror kernel driver; whereas the raid equivalents using the md raid kernel driver all appear as (r). Snapshots using the original device-mapper driver
appear as (s); whereas snapshots of thin volumes using the new thin provisioning driver appear as (t).

8 Newly-allocated data blocks are overwritten with blocks of (z)eroes before use.

9 Volume Health, where there are currently three groups of attributes identified:

Common ones for all Logical Volumes: (p)artial, (X) unknown.
(p)artial signifies that one or more of the Physical Volumes this Logical Volume uses is missing from the system. (X) unknown signifies the status is unknown.

Related to RAID Logical Volumes: (r)efresh needed, (m)ismatches exist, (w)ritemostly.
(r)efresh signifies that one or more of the Physical Volumes this RAID Logical Volume uses had suffered a write error. The write error could be due to a temporary failure of that Physical Volume or an indication that
it is failing. The device should be refreshed or replaced. (m)ismatches signifies that the RAID logical volume has portions of the array that are not coherent. Inconsistencies are detected by initiating a "check" on
a RAID logical volume. (The scrubbing operations, "check" and "repair", can be performed on a RAID logical volume via the 'lvchange' command.) (w)ritemostly signifies the devices in a RAID 1 logical volume that have
been marked write-mostly. (R)emove after reshape signifies freed striped raid images to be removed.

Related to Thin pool Logical Volumes: (F)ailed, out of (D)ata space, (M)etadata read only.
(F)ailed is set if thin pool encounters serious failures and hence no further I/O is permitted at all. The out of (D)ata space is set if thin pool has run out of data space. (M)etadata read only signifies that thin
pool encounters certain types of failures but it's still possible to do reads at least, but no metadata changes are allowed.

Related to Thin Logical Volumes: (F)ailed.
(F)ailed is set when related thin pool enters Failed state and no further I/O is permitted at all.

10 s(k)ip activation: this volume is flagged to be skipped during activation.

SEE ALSO
lvm(8) lvm.conf(5) lvmconfig(8)

pvchange(8) pvck(8) pvcreate(8) pvdisplay(8) pvmove(8) pvremove(8) pvresize(8) pvs(8) pvscan(8)

vgcfgbackup(8) vgcfgrestore(8) vgchange(8) vgck(8) vgcreate(8) vgconvert(8) vgdisplay(8) vgexport(8) vgextend(8) vgimport(8) vgimportclone(8) vgmerge(8) vgmknodes(8) vgreduce(8) vgremove(8) vgrename(8) vgs(8) vgscan(8)
vgsplit(8)

lvcreate(8) lvchange(8) lvconvert(8) lvdisplay(8) lvextend(8) lvreduce(8) lvremove(8) lvrename(8) lvresize(8) lvs(8) lvscan(8)

lvm-fullreport(8) lvm-lvpoll(8) lvm2-activation-generator(8) blkdeactivate(8) lvmdump(8)

dmeventd(8) lvmetad(8) lvmpolld(8) lvmlockd(8) lvmlockctl(8) clvmd(8) cmirrord(8) lvmdbusd(8)

lvmsystemid(7) lvmreport(7) lvmraid(7) lvmthin(7) lvmcache(7)

Red Hat, Inc. LVM TOOLS 2.02.176(2) (2017-11-03) LVS(8)

实际例子

example:

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
# 创建pv,物理卷
buildfarm@xref:~$ sudo pvcreate /dev/sdb1 /dev/sdc1 /dev/sdd1 /dev/sde1
Physical volume "/dev/sdb1" successfully created.
Physical volume "/dev/sdc1" successfully created.
Physical volume "/dev/sdd1" successfully created.
Physical volume "/dev/sde1" successfully created.

# 查看创建好的pv信息
buildfarm@xref:~$ sudo pvdisplay
"/dev/sde1" is a new physical volume of "<1.82 TiB"
--- NEW Physical volume ---
PV Name /dev/sde1
VG Name
PV Size <1.82 TiB
Allocatable NO
PE Size 0
Total PE 0
Free PE 0
Allocated PE 0
PV UUID jh84yW-FpHj-DCgs-SGm3-sEEx-VFVB-yC1wAf

"/dev/sdc1" is a new physical volume of "<1.82 TiB"
--- NEW Physical volume ---
PV Name /dev/sdc1
VG Name
PV Size <1.82 TiB
Allocatable NO
PE Size 0
Total PE 0
Free PE 0
Allocated PE 0
PV UUID 7NihvT-zfzw-LP1W-4r5H-SzPz-ZtF6-isXqgr

"/dev/sdb1" is a new physical volume of "<1.82 TiB"
--- NEW Physical volume ---
PV Name /dev/sdb1
VG Name
PV Size <1.82 TiB
Allocatable NO
PE Size 0
Total PE 0
Free PE 0
Allocated PE 0
PV UUID sQbTiz-6tvF-gcYc-ZShP-lNmp-vDNY-KEBgDO

"/dev/sdd1" is a new physical volume of "<1.82 TiB"
--- NEW Physical volume ---
PV Name /dev/sdd1
VG Name
PV Size <1.82 TiB
Allocatable NO
PE Size 0
Total PE 0
Free PE 0
Allocated PE 0
PV UUID hMEd1I-DHeb-2R6q-IkfL-qqrL-facV-7a4loS
# 查看创建好的pv信息
buildfarm@xref:~$ sudo pvs
PV VG Fmt Attr PSize PFree
/dev/sdb1 lvm2 --- <1.82t <1.82t
/dev/sdc1 lvm2 --- <1.82t <1.82t
/dev/sdd1 lvm2 --- <1.82t <1.82t
/dev/sde1 lvm2 --- <1.82t <1.82t

# 创建vg卷组,名字是xrefvg
buildfarm@xref:~$ sudo vgcreate xrefvg /dev/sd{b,c,d,e}1
Volume group "xrefvg" successfully created
# 看创建好的vg信息
buildfarm@xref:~$ sudo vgs
VG #PV #LV #SN Attr VSize VFree
xrefvg 4 0 0 wz--n- <7.28t <7.28t
buildfarm@xref:~$ sudo vgdisplay
--- Volume group ---
VG Name xrefvg
System ID
Format lvm2
Metadata Areas 4
Metadata Sequence No 1
VG Access read/write
VG Status resizable
MAX LV 0
Cur LV 0
Open LV 0
Max PV 0
Cur PV 4
Act PV 4
VG Size <7.28 TiB
PE Size 4.00 MiB
Total PE 1907724
Alloc PE / Size 0 / 0
Free PE / Size 1907724 / <7.28 TiB
VG UUID IT1NP2-yscw-tst7-k6oY-SNdM-cev1-4QZCFJ

# vg创建号之后相应的pv就会显示属于哪个vg了。
buildfarm@xref:~$ sudo pvs
PV VG Fmt Attr PSize PFree
/dev/sdb1 xrefvg lvm2 a-- <1.82t <1.82t
/dev/sdc1 xrefvg lvm2 a-- <1.82t <1.82t
/dev/sdd1 xrefvg lvm2 a-- <1.82t <1.82t
/dev/sde1 xrefvg lvm2 a-- <1.82t <1.82t
buildfarm@xref:~$ sudo pvdisplay
--- Physical volume ---
PV Name /dev/sdb1
VG Name xrefvg # vg创建号之后相应的pv就会显示属于哪个vg了。
PV Size <1.82 TiB / not usable 4.00 MiB
Allocatable yes
PE Size 4.00 MiB
Total PE 476931
Free PE 476931
Allocated PE 0
PV UUID sQbTiz-6tvF-gcYc-ZShP-lNmp-vDNY-KEBgDO

--- Physical volume ---
PV Name /dev/sdc1
VG Name xrefvg # vg创建号之后相应的pv就会显示属于哪个vg了。
PV Size <1.82 TiB / not usable 4.00 MiB
Allocatable yes
PE Size 4.00 MiB
Total PE 476931
Free PE 476931
Allocated PE 0
PV UUID 7NihvT-zfzw-LP1W-4r5H-SzPz-ZtF6-isXqgr

--- Physical volume ---
PV Name /dev/sdd1
VG Name xrefvg # vg创建号之后相应的pv就会显示属于哪个vg了。
PV Size <1.82 TiB / not usable 4.00 MiB
Allocatable yes
PE Size 4.00 MiB
Total PE 476931
Free PE 476931
Allocated PE 0
PV UUID hMEd1I-DHeb-2R6q-IkfL-qqrL-facV-7a4loS

--- Physical volume ---
PV Name /dev/sde1
VG Name xrefvg # vg创建号之后相应的pv就会显示属于哪个vg了。
PV Size <1.82 TiB / not usable 4.00 MiB
Allocatable yes
PE Size 4.00 MiB
Total PE 476931
Free PE 476931
Allocated PE 0
PV UUID jh84yW-FpHj-DCgs-SGm3-sEEx-VFVB-yC1wAf


# 创建 lv,采用strip的模式,分四个,因为我们有4个硬盘,起名称 xrefvg
buildfarm@xref:~$ sudo lvcreate --extents 100%FREE --stripes 4 --stripesize 256 --name data xrefvg
Logical volume "data" created.
# 查看创建好的lv逻辑卷
buildfarm@xref:~$ sudo lvs
LV VG Attr LSize Pool Origin Data% Meta% Move Log Cpy%Sync Convert
data xrefvg -wi-a----- <7.28t
# 查看创建好的lv逻辑卷
buildfarm@xref:~$ sudo lvdisplay
--- Logical volume ---
LV Path /dev/xrefvg/data
LV Name data
VG Name xrefvg
LV UUID RcAlRl-PBkQ-KqF6-yVng-uBE0-TBxw-LEVY7l
LV Write Access read/write
LV Creation host, time xref, 2019-06-21 15:55:57 +0800
LV Status available
# open 0
LV Size <7.28 TiB
Current LE 1907724
Segments 1
Allocation inherit
Read ahead sectors auto
- currently set to 4096
Block device 253:0



buildfarm@xref:~$ sudo lvs
LV VG Attr LSize Pool Origin Data% Meta% Move Log Cpy%Sync Convert
data xrefvg -wi-a----- <7.28t

buildfarm@xref:~$ sudo lvs --segments
LV VG Attr #Str Type SSize
data xrefvg -wi-a----- 4 striped <7.28t


buildfarm@xref:~$ sudo lvdisplay -vm
--- Logical volume ---
LV Path /dev/xrefvg/data
LV Name data
VG Name xrefvg
LV UUID RcAlRl-PBkQ-KqF6-yVng-uBE0-TBxw-LEVY7l
LV Write Access read/write
LV Creation host, time xref, 2019-06-21 15:55:57 +0800
LV Status available
# open 0
LV Size <7.28 TiB
Current LE 1907724
Segments 1
Allocation inherit
Read ahead sectors auto
- currently set to 4096
Block device 253:0

--- Segments ---
Logical extents 0 to 1907723:
Type striped
Stripes 4
Stripe size 256.00 KiB
Stripe 0:
Physical volume /dev/sdb1
Physical extents 0 to 476930
Stripe 1:
Physical volume /dev/sdc1
Physical extents 0 to 476930
Stripe 2:
Physical volume /dev/sdd1
Physical extents 0 to 476930
Stripe 3:
Physical volume /dev/sde1
Physical extents 0 to 476930


buildfarm@xref:~$