- [root@slave1 ~]# vgdisplay #查看卷组名
- --- Volume group ---
- VG Name cl #记录下 cl
- 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 7.00 GiB
- PE Size 4.00 MiB
- Total PE 1791
- Alloc PE / Size 1791 / 7.00 GiB
- Free PE / Size 0 / 0
- VG UUID FCGIuD-oCl3-NOws-Gpot-eyHi-41zz-p4mxmG
- [root@slave1 ~]# pvcreate /dev/sda3 #创建新物理卷
- WARNING: ext4 signature detected on /dev/sda3 at offset 1080. Wipe it? [y/n]: y
Wiping ext4 signature on /dev/sda3.
- Physical volume "/dev/sda3" successfully created.
- [root@slave1 ~]# vgextend cl /dev/sda3# 扩展到卷组
- Volume group "cl" successfully extended
- [root@slave1 ~]# lvdisplay #查看根分区
- --- Logical volume ---
- LV Path /dev/cl/swap
- LV Name swap
- VG Name cl
- LV UUID 95DKbg-Uh4p-bc7P-e6ql-L4Zc-wLJV-McwpRQ
- LV Write Access read/write
- LV Creation host, time localhost.localdomain, 2019-02-18 16:05:35 +0800
- LV Status available
- # open 2
- LV Size 820.00 MiB
- Current LE 205
- Segments 1
- Allocation inherit
- Read ahead sectors auto
- - currently set to 8192
- Block device 253:1
- --- Logical volume ---
- LV Path /dev/cl/root #记录下
- LV Name root
- VG Name cl
- LV UUID p7T17B-ozhs-Cqez-dG1W-LrHk-X1SM-lJhzwf
- LV Write Access read/write
- LV Creation host, time localhost.localdomain, 2019-02-18 16:05:35 +0800
- LV Status available
- # open 1
- LV Size 6.20 GiB
- Current LE 1586
- Segments 1
- Allocation inherit
- Read ahead sectors auto
- - currently set to 8192
- Block device 253:0
- [root@slave1 ~]# lvextend /dev/cl/root /dev/sda3 #扩展到容量逻辑分区
- Size of logical volume cl/root changed from 6.20 GiB (1586 extents) to 15.96 GiB (4085 extents).
Logical volume cl/root successfully resized.
- [root@slave1 ~]# resize2fs /dev/cl/root # 刷新逻辑分区
- resize2fs 1.42.9 (28-Dec-2013)
resize2fs: Bad magic number in super-block 当尝试打开 /dev/cl/root 时
找不到有效的文件系统超级块.
[root@slave1 ~]# cat /etc/fstab #若报错, 查看文件系统是不是 xfs 的
来源: http://www.bubuko.com/infodetail-2962648.html