[root@serverc ~]# lvremove /dev/vg0/lv0 Do you really want to remove active logical volume vg0/lv0? [y/n]: y
Logical volume "lv0" successfully removed.
3.2 移除 vg
使用 vgremove 工具移除 vg
1
2
[root@serverc ~]# vgremove vg0 Volume group "vg0" successfully removed
3.3 移除 pv
使用 pvremove 工具移除 pv
1
2
3
[root@serverc ~]# pvremove /dev/vdb1 /dev/vdc1 Labels on physical volume "/dev/vdb1" successfully wiped.
Labels on physical volume "/dev/vdc1" successfully wiped.
4. 查看已經創建的 LVM
4.1 查看 PV 詳細資訊
使用 pvdisplay 工具可以查看創建的 pv 詳細資訊
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
[root@serverc ~]# pvcreate /dev/vdb1 Physical volume "/dev/vdb1" successfully created.
[root@serverc ~]# pvdisplay /dev/vdb1 "/dev/vdb1" is a new physical volume of "199.00 MiB" --- NEW Physical volume ---
PV Name /dev/vdb1
VG Name
PV Size 199.00 MiB
Allocatable NO
PE Size 0 Total PE 0 Free PE 0 Allocated PE 0 PV UUID Yp887I-KTUb-HBs4-TXmU-2xZZ-t1TW-ziqE3V
[root@serverc ~]# vgcreate vg0 /dev/vdb1 Volume group "vg0" successfully created
[root@serverc ~]# vgdisplay vg0 --- Volume group ---
VG Name vg0
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 196.00 MiB
PE Size 4.00 MiB
Total PE 49 Alloc PE / Size 0 / 0 Free PE / Size 49 / 196.00 MiB
VG UUID UT3zNx-B2MV-JMgu-REpC-3IA6-ApjM-6S1Ayg
[root@serverc ~]# vgdisplay vg0 --- Volume group ---
VG Name vg0
System ID
Format lvm2
Metadata Areas 1 Metadata Sequence No 2 VG Access read/write
VG Status resizable
MAX LV 0 Cur LV 1 Open LV 1 Max PV 0 Cur PV 1 Act PV 1 VG Size 196.00 MiB
PE Size 4.00 MiB
Total PE 49 Alloc PE / Size 38 / 152.00 MiB
Free PE / Size 11 / 44.00 MiB
VG UUID UT3zNx-B2MV-JMgu-REpC-3IA6-ApjM-6S1Ayg
[root@serverc ~]# pvcreate /dev/vdc1
Physical volume "/dev/vdc1" successfully created.
[root@serverc ~]# vgextend vg0 /dev/vdc1
Volume group "vg0" successfully extended
[root@serverc ~]# vgdisplay vg0
--- Volume group ---
VG Name vg0
System ID
Format lvm2
Metadata Areas 2
Metadata Sequence No 3
VG Access read/write
VG Status resizable
MAX LV 0
Cur LV 1
Open LV 1
Max PV 0
Cur PV 2
Act PV 2
VG Size 492.00 MiB
PE Size 4.00 MiB
Total PE 123
Alloc PE / Size 38 / 152.00 MiB
Free PE / Size 85 / 340.00 MiB
VG UUID UT3zNx-B2MV-JMgu-REpC-3IA6-ApjM-6S1Ayg
[root@serverc ~]# vgcreate -s 8MiB qagroup /dev/vdd1 Volume group "qagroup" successfully created
[root@serverc ~]# vgdisplay qagroup --- Volume group ---
VG Name qagroup
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 248.00 MiB
PE Size 8.00 MiB
Total PE 31 Alloc PE / Size 0 / 0 Free PE / Size 31 / 248.00 MiB
VG UUID rLY7hW-LnNR-RIUx-dEZP-HzRW-SeSD-PfSbmg