[root@localhost ~]# fdisk -l Disk /dev/sda: 128.8 GB, 128849018880 bytes 255 heads, 63 sectors/track, 15665 cylinders Units = cylinders of 16065 * 512 = 8225280 bytes Device BootStartEndBlocksId System /dev/sda1* 1 1310439183 Linux /dev/sda2 14 10443 837789758e Linux LVM /dev/sda3 10444 15665 4194571583 Linux [root@localhost ~]# vgscan Reading all physical volumes. This may take a while... Found volume group "VolGroup00" using metadata type lvm2 [root@localhost ~]# pvscan PV /dev/sda2VG VolGroup00lvm2 [79.88 GB / 0 free] PV /dev/sda3VG VolGroup00lvm2 [40.00 GB / 40.00 GB free] Total: 2 [119.88 GB] / in use: 2 [119.88 GB] / in no VG: 0 [0] [root@localhost ~]# pvdisplay --- Physical volume --- PV Name/dev/sda2 VG NameVolGroup00 PV Size79.90 GB / not usable 23.41 MB Allocatable yes (but full) PE Size (KByte) 32768 Total PE 2556 Free PE0 Allocated PE 2556 PV UUIDYGtB2J-ZKJr-mV62-NluQ-2DGy-vuUT-cCc1lo --- Physical volume --- PV Name/dev/sda3 VG NameVolGroup00 PV Size40.00 GB / not usable 2.61 MB Allocatable yes PE Size (KByte) 32768 Total PE 1280 Free PE1280 Allocated PE 0 PV UUIDwsnv13-7j1H-SH8q-hl6k-HpNc-x4WU-gM7LzW [root@localhost ~]# lvscan ACTIVE'/dev/VolGroup00/LogVol00' [77.91 GB] inherit ACTIVE'/dev/VolGroup00/LogVol01' [1.97 GB] inherit [root@localhost ~]# lvs LV VGAttrLSize Origin Snap% Move Log Copy% Convert LogVol00 VolGroup00 -wi-ao 77.91G LogVol01 VolGroup00 -wi-ao 1.97G
vgreduce參數: -a:如果命令行中沒有指定要刪除的物理卷,則刪除所有的空物理卷; --removemissing:刪除卷組中丟失的物理卷,使卷組恢復正常狀態。
[root@localhost ~]# vgreduce VolGroup00 /dev/sda3 Removed "/dev/sda3" from volume group "VolGroup00" [root@localhost ~]# clip_image001
[root@localhost ~]# pvscan PV /dev/sda2VG VolGroup00lvm2 [79.88 GB / 0 free] PV /dev/sda3 lvm2 [40.00 GB] Total: 2 [119.88 GB] / in use: 1 [79.88 GB] / in no VG: 1 [40.00 GB] [root@localhost ~]# pvs PVVGFmt Attr PSize PFree /dev/sda2 VolGroup00 lvm2 a-79.88G 0 /dev/sda3 lvm2 a-40.00G 40.00G [root@localhost ~]# pvremove /dev/sda3 Labels on physical volume "/dev/sda3" successfully wiped [root@localhost ~]# pvscan PV /dev/sda2VG VolGroup00lvm2 [79.88 GB / 0 free] Total: 1 [79.88 GB] / in use: 1 [79.88 GB] / in no VG: 0 [0]