1.查看
檢查系統中是否安裝了LVM管理工具 [root@test_vonedao_83 /]# rpm -qa|grep lvm lvm2-libs-2.02.185-2.el7.x86_64 lvm2-2.02.185-2.el7.x86_64
查看物理卷大小
[root@test_vonedao_83 /]# pvscan PV /dev/sda2 VG centos lvm2 [77.98 GiB / 172.00 MiB free] Total: 1 [77.98 GiB] / in use: 1 [77.98 GiB] / in no VG: 0 [0 ]
查看邏輯卷大小
[root@test_vonedao_83 /]# lvscan ACTIVE '/dev/centos/root' [50.00 GiB] inherit ACTIVE '/dev/centos/home' [20.00 GiB] inherit ACTIVE '/dev/centos/swap' [7.81 GiB] inherit
查看/dev/sda 磁盤大小
[root@test_vonedao_83 /]# fdisk -l /dev/sda 磁盤 /dev/sda:240.1 GB, 240057409536 字節,468862128 個扇區 Units = 扇區 of 1 * 512 = 512 bytes 扇區大小(邏輯/物理):512 字節 / 512 字節 I/O 大小(最小/最佳):512 字節 / 512 字節 磁盤標簽類型:dos 磁盤標識符:0x000b6965 設備 Boot Start End Blocks Id System /dev/sda1 * 2048 2099199 1048576 83 Linux /dev/sda2 2099200 165642239 81771520 8e Linux LVM
3.刪除多余的邏輯卷:lvremove
[root@test_vonedao_83 ~]# lvremove /dev/mapper/centos-opt
Do you really want to remove active logical volume centos/opt? [y/n]: y Logical volume "opt" successfully removed
[root@test_vonedao_83 ~]# lsblk
NAME MAJ:MIN RM SIZE RO TYPE MOUNTPOINT
sda 8:0 0 223.6G 0 disk
├─sda1 8:1 0 1G 0 part /boot
└─sda2 8:2 0 78G 0 part
├─centos-root 253:0 0 50G 0 lvm /
├─centos-swap 253:1 0 7.8G 0 lvm [SWAP]
└─centos-home 253:2 0 20G 0 lvm /home
sdb 8:16 0 931.5G 0 disk
└─sdb1 8:17 0 100G 0 part /opt
