[plain] view plaincopyprint?
01.[root@CentOS-78 /]# lvreduce -L 282G /dev/mapper/vg_centos-lv_home
02. WARNING: Reducing active and open logical volume to 282.00 GiB
03. THIS MAY DESTROY YOUR DATA (filesystem etc.)
04.Do you really want to reduce lv_home? [y/n]: y
05. Reducing logical volume lv_home to 282.00 GiB
06. Logical volume lv_home successfully resized
07.[root@CentOS-78 /]#
我認為這個命令是將已經減少的100G空間拿到系統公用的地區,可以被其他分區載入和利用。
查詢卷組的資訊:
[plain] view plaincopyprint?
01.[root@CentOS-78 /]# vgdisplay
02. --- Volume group ---
03. VG Name vg_centos
04. System ID
05. Format lvm2
06. Metadata Areas 1
07. Metadata Sequence No 5
08. VG Access read/write
09. VG Status resizable
10. MAX LV 0
11. Cur LV 3
12. Open LV 3
13. Max PV 0
14. Cur PV 1
15. Act PV 1
16. VG Size 465.27 GiB
17. PE Size 4.00 MiB
18. Total PE 119109
19. Alloc PE / Size 86472 / 337.78 GiB
20. Free PE / Size 32637 / 127.49 GiB
21. VG UUID 1k4ooN-RFV9-uyf1-uMYf-aERG-YaGs-ZNoSD6
Free PE / Size指定的應該是現在可在分配的空間。
4、增加vg_centos-lv_root分區的大小
將可用的空間添加到vg_centos-lv_root分區上面:
[plain] view plaincopyprint?
01.[root@CentOS-78 /]# lvextend -L +127.40G /dev/mapper/vg_centos-lv_root
02. Rounding up size to full physical extent 127.40 GiB
03. Extending logical volume lv_root to 177.40 GiB
04. Logical volume lv_root successfully resized
05.[root@CentOS-78 /]#
從新設定該分區的大小:
[plain] view plaincopyprint?
01.[root@CentOS-78 /]# resize2fs -p /dev/mapper/vg_centos-lv_root
02.resize2fs 1.41.12 (17-May-2010)
03.Filesystem at /dev/mapper/vg_centos-lv_root is mounted on /; on-line resizing required
04.old desc_blocks = 4, new_desc_blocks = 12
05.Performing an on-line resize of /dev/mapper/vg_centos-lv_root to 46504960 (4k) blocks.