Lesson 4.3: Assign physical volumes to volume groups
Case I: Create VG with the default PE
# Create a Volume Group
[root@server dev]# vgcreate loanvg /dev/nvme0n3
Volume group "loanvg" successfully created
# Viewing the Volume Group Information
[root@server dev]# vgdisplay loanvg
--- Volume group ---
VG Name loanvg
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 <6.00 GiB
PE Size 4.00 MiB
Total PE 1535
Alloc PE / Size 0 / 0
Free PE / Size 1535 / <6.00 GiB
VG UUID TdeDuw-dDFu-iI4w-rFNs-QQse-Aye9-pu3gnr
Default PE SIZE is 4.00 MiB
Total PE = (Size of Physical volume) / Pe
Case II: Create VG with the specified PE Size
# Create VG with 16M PE Size
[root@server dev]# vgcreate -s 16M loanvg /dev/nvme0n3
Volume group "loanvg" successfully created
# View VG
[root@server dev]# vgdisplay loanvg
--- Volume group ---
VG Name loanvg
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 5.98 GiB
PE Size 16.00 MiB
Total PE 383
Alloc PE / Size 0 / 0
Free PE / Size 383 / 5.98 GiB
VG UUID JB30qz-RgVz-cSlB-aegh-rj6d-oqXW-EaIgzs