查看系统默认的卷组:
[root@ser1 ~]# vgdisplay
--- Volume group ---
VG Name centos
System ID
Format lvm2
Metadata Areas 1
Metadata Sequence No 5
VG Access read/write
VG Status resizable
MAX LV 0
Cur LV 4
Open LV 4
Max PV 0
Cur PV 1
Act PV 1
VG Size 59.80 GiB
PE Size 4.00 MiB
Total PE 15309
Alloc PE / Size 15308 / <59.80 GiB
Free PE / Size 1 / 4.00 MiB
VG UUID D1f1Nn-Y4qc-ZPqS-QpSk-mbHb-SQmZ-Gd1R72
查看系统所有的逻辑卷:
[root@ser1 ~]# lvdisplay
--- Logical volume ---
LV Path /dev/centos/swap
LV Name swap
VG Name centos
LV UUID dqH4dF-Yfc1-OYDo-Mcku-jKc0-S367-F5Xoh5
LV Write Access read/write
LV Creation host, time ser1.q7.com, 2020-08-11 01:38:35 +0800
LV Status available
# open 2
LV Size 8.00 GiB
Current LE 2048
Segments 1
Allocation inherit
Read ahead sectors auto
- currently set to 8192
Block device 253:1
--- Logical volume ---
LV Path /dev/centos/var
LV Name var
VG Name centos
LV UUID qHu29I-pckv-X6eo-0PgS-ni1P-iNdG-O3rp3O
LV Write Access read/write
LV Creation host, time ser1.q7.com, 2020-08-11 01:38:35 +0800
LV Status available
# open 1
LV Size 10.00 GiB
Current LE 2560
Segments 1
Allocation inherit
Read ahead sectors auto
- currently set to 8192
Block device 253:2
--- Logical volume ---
LV Path /dev/centos/home
LV Name home
VG Name centos
LV UUID o7ZXdE-8XmF-Wrmc-rvo9-YutT-a5e5-I8ZfIH
LV Write Access read/write
LV Creation host, time ser1.q7.com, 2020-08-11 01:38:36 +0800
LV Status available
# open 1
LV Size 18.00 GiB
Current LE 4608
Segments 1
Allocation inherit
Read ahead sectors auto
- currently set to 8192
Block device 253:3
--- Logical volume ---
LV Path /dev/centos/root
LV Name root
VG Name centos
LV UUID fA593N-3bE5-8dgo-Yabg-bcuM-mMQL-7Rm4Lu
LV Write Access read/write
LV Creation host, time ser1.q7.com, 2020-08-11 01:38:36 +0800
LV Status available
# open 1
LV Size <23.80 GiB
Current LE 6092
Segments 1
Allocation inherit
Read ahead sectors auto
- currently set to 8192
Block device 253:0
查看某个的逻辑卷:
[root@ser1 ~]# lvdisplay /dev/centos/var
--- Logical volume ---
LV Path /dev/centos/var
LV Name var
VG Name centos
LV UUID qHu29I-pckv-X6eo-0PgS-ni1P-iNdG-O3rp3O
LV Write Access read/write
LV Creation host, time ser1.q7.com, 2020-08-11 01:38:35 +0800
LV Status available
# open 1
LV Size 10.00 GiB
Current LE 2560
Segments 1
Allocation inherit
Read ahead sectors auto
- currently set to 8192
Block device 253:2
创建物理卷:
[root@ser1 ~]# pvcreate /dev/sdb
Physical volume "/dev/sdb" successfully created.
扩大卷组:
[root@ser1 ~]# vgextend centos /dev/sdb
Volume group "centos" successfully extended
扩展逻辑卷(不能把空间全部分完,要留0.1G!)
[root@ser1 ~]# lvextend -L +29.9G /dev/centos/var
Rounding size to boundary between physical extents: 29.90 GiB.
Size of logical volume centos/var changed from 10.00 GiB (2560 extents) to 39.90 GiB (10215 extents).
Logical volume centos/var successfully resized.
刷新xfs文件系统:
xfs_growfs /var