Partition type: p primary (2 primary, 0 extended, 2 free) e extended Select (default p): # 分区类型,直接默认主分区 Using default response p Partition number (3,4, default 3): # 分区序号,直接默认 First sector (104857600-125829119, default 104857600): # 新分区的起始磁柱编号,默认 Using default value 104857600 Last sector, +sectors or +size{K,M,G} (104857600-125829119, default 125829119): # 新分区的起始磁柱编号,默认 Using default value 125829119 Partition 3 of type Linux and of size 10 GiB is set
[root@dream ~]# pvdisplay # 查看物理卷 --- Physical volume --- PV Name /dev/sda2 VG Name centos PV Size <49.00 GiB / not usable 3.00 MiB Allocatable yes PE Size 4.00 MiB Total PE 12543 Free PE 1 Allocated PE 12542 PV UUID YlSuif-tyMd-mohJ-gKQv-YRgc-OyKi-TtsI74
[root@dream ~]# pvcreate /dev/sda3 # 创建物理卷 Physical volume "/dev/sda3" successfully created. [root@dream ~]# pvdisplay #再次查看 --- Physical volume --- PV Name /dev/sda2 VG Name centos PV Size <49.00 GiB / not usable 3.00 MiB Allocatable yes PE Size 4.00 MiB Total PE 12543 Free PE 1 Allocated PE 12542 PV UUID YlSuif-tyMd-mohJ-gKQv-YRgc-OyKi-TtsI74
"/dev/sda3" is a new physical volume of "10.00 GiB" --- NEW Physical volume --- PV Name /dev/sda3 VG Name PV Size 10.00 GiB Allocatable NO PE Size 0 Total PE 0 Free PE 0 Allocated PE 0 PV UUID fHqGUt-lPu6-s6Oo-BUjK-s6NH-T2T0-goRcd0 # 可以看到新的物理卷,大小为我扩容的 10G
[root@dream ~]# vgdisplay # 查看卷组,可用 PE 为1,也就是 4M --- Volume group --- VG Name centos System ID Format lvm2 Metadata Areas 1 Metadata Sequence No 3 VG Access read/write VG Status resizable MAX LV 0 Cur LV 2 Open LV 2 Max PV 0 Cur PV 1 Act PV 1 VG Size <49.00 GiB PE Size 4.00 MiB Total PE 12543 Alloc PE / Size 12542 / 48.99 GiB Free PE / Size 1 / 4.00 MiB VG UUID acX3P4-ayHo-cppq-lD59-eCK4-ecWW-7VA4wp
[root@dream ~]# vgextend centos /dev/sda3 # 将新分区加入 centos 卷组 Volume group "centos" successfully extended [root@dream ~]# vgdisplay # 再次查看卷组 可用 PE 为2560,也就是 10GiB --- Volume group --- VG Name centos System ID Format lvm2 Metadata Areas 2 Metadata Sequence No 4 VG Access read/write VG Status resizable MAX LV 0 Cur LV 2 Open LV 2 Max PV 0 Cur PV 2 Act PV 2 VG Size 58.99 GiB PE Size 4.00 MiB Total PE 15102 Alloc PE / Size 12542 / 48.99 GiB Free PE / Size 2560 / 10.00 GiB VG UUID acX3P4-ayHo-cppq-lD59-eCK4-ecWW-7VA4wp
--- Logical volume --- LV Path /dev/centos/root LV Name root VG Name centos LV UUID grbt1v-ugSB-fYmd-kwbT-G3kT-LE78-qhcQyC LV Write Access read/write LV Creation host, time localhost, 2021-08-01 11:19:18 +0800 LV Status available # open 1 LV Size 46.99 GiB Current LE 12030 Segments 1 Allocation inherit Read ahead sectors auto - currently set to 8192 Block device 253:0