[root@lightdb ~]# pvdisplay --- Physical volume --- PV Name /dev/sdb1 VG Name vg PV Size 931.51 GiB / not usable 4.00 MiB Allocatable yes PE Size 4.00 MiB Total PE 238466 Free PE 1 Allocated PE 238465 PV UUID 3MQezN-W53d-oj6q-I3GK-9GdP-j4Yj-hag2Dj
[root@lightdb ~]# vgdisplay --- Volume group --- VG Name vg System ID Format lvm2 Metadata Areas 1 Metadata Sequence No 4 VG Access read/write VG Status resizable MAX LV 0 Cur LV 3 Open LV 3 Max PV 0 Cur PV 1 Act PV 1 VG Size <931.51 GiB PE Size 4.00 MiB Total PE 238466 Alloc PE / Size 238465 / 931.50 GiB Free PE / Size 1 / 4.00 MiB VG UUID dzuyJa-LoIn-ZUAY-BvEN-X13J-EYkc-daFgy5
[root@lightdb ~]# lvdisplay --- Logical volume --- LV Path /dev/vg/swap LV Name swap VG Name vg LV UUID qNuaiE-j4mA-5dZJ-RsZZ-YqKX-4zSm-P2vWg8 LV Write Access read/write LV Creation host, time lightdb, 2018-05-12 15:20:38 -0400 LV Status available # open 2 LV Size <7.88 GiB Current LE 2016 Segments 1 Allocation inherit Read ahead sectors auto - currently set to 256 Block device 253:1 --- Logical volume --- LV Path /dev/vg/tmp LV Name tmp VG Name vg LV UUID oaS1B0-eSu3-s7B4-L2Dl-EUAs-wQxU-Ueohsl LV Write Access read/write LV Creation host, time lightdb, 2018-05-12 15:20:39 -0400 LV Status available # open 1 LV Size 1.00 GiB Current LE 256 Segments 1 Allocation inherit Read ahead sectors auto - currently set to 256 Block device 253:2 --- Logical volume --- LV Path /dev/vg/root LV Name root VG Name vg LV UUID wqdC7u-9sg4-ekEH-dwR5-kBpy-PdN0-TXVcN0 LV Write Access read/write LV Creation host, time lightdb, 2018-05-12 15:20:40 -0400 LV Status available # open 1 LV Size <922.63 GiB Current LE 236193 Segments 1 Allocation inherit Read ahead sectors auto - currently set to 256 Block device 253:0
[root@lightdb ~]# pvdisplay --- Physical volume --- PV Name /dev/sdb1 VG Name vg PV Size 931.51 GiB / not usable 4.00 MiB Allocatable yes PE Size 4.00 MiB Total PE 238466 Free PE 1 Allocated PE 238465 PV UUID 3MQezN-W53d-oj6q-I3GK-9GdP-j4Yj-hag2Dj "/dev/sda2" is a new physical volume of "<931.27 GiB" --- NEW Physical volume --- PV Name /dev/sda2 VG Name PV Size <931.27 GiB Allocatable NO PE Size 0 Total PE 0 Free PE 0 Allocated PE 0 PV UUID gGrU32-2AW0-10Sv-upON-cXEE-hqC9-fe3X76
[root@lightdb ~]# vgextend vg /dev/sda2 Volume group "vg" successfully extended
[root@lightdb ~]# vgdisplay --- Volume group --- VG Name vg System ID Format lvm2 Metadata Areas 2 Metadata Sequence No 6 VG Access read/write VG Status resizable MAX LV 0 Cur LV 3 Open LV 3 Max PV 0 Cur PV 2 Act PV 2 VG Size <1.82 TiB PE Size 4.00 MiB Total PE 476870 Alloc PE / Size 476870 / <1.82 TiB Free PE / Size 0 / 0 VG UUID dzuyJa-LoIn-ZUAY-BvEN-X13J-EYkc-daFgy5
给 /dev/mapper/vg-root 这个 LV 扩容
1 2 3 4
[root@lightdb ~]# lvextend -l +100%FREE /dev/vg/root Size of logical volume vg/root changed from <922.63 GiB (236193 extents) to 1.81 TiB (474598 extents). Logical volume vg/root successfully resized.
刷新文件系统
1 2 3 4 5
[root@lightdb ~]# resize2fs /dev/vg/root resize2fs 1.42.9 (28-Dec-2013) Filesystem at /dev/vg/root is mounted on /; on-line resizing required old_desc_blocks = 116, new_desc_blocks = 232 The filesystem on /dev/vg/root is now 485988352 blocks long.