一、离线逻辑卷
[root@instructor Desktop]# umount /dev/testvg/testlv
二、查看逻辑卷的状态并删除
[root@instructor Desktop]# lvdisplay /dev/testvg/testlv
--- Logical volume ---LV Path /dev/testvg/testlv
LV Name testlv
VG Name testvg
LV UUID YT3Ccy-eh5I-23fv-g1K6-YWXY-PJrs-rHcNXv
LV Write Access read/write
LV Creation host, time instructor.example.com, 2014-04-15 23:15:37 +0800
LV Status available
# open 0
LV Size 40.00 GiB
Current LE 5120
Segments 3
Allocation inherit
Read ahead sectors auto
- currently set to 256
Block device 253:2
[root@instructor Desktop]# lvremove /dev/testvg/testlv
Do you really want to remove active logical volume testlv? [y/n]: y
Logical volume "testlv" successfully removed
三、查看卷组的状态并删除
[root@instructor Desktop]# vgdisplay /dev/testvg--- Volume group ---
VG Name testvg
System ID
Format lvm2
Metadata Areas 3
Metadata Sequence No 18
VG Access read/write
VG Status resizable
MAX LV 0
Cur LV 0
Open LV 0
Max PV 0
Cur PV 3
Act PV 3
VG Size 59.98 GiB
PE Size 8.00 MiB
Total PE 7677
Alloc PE / Size 0 / 0
Free PE / Size 7677 / 59.98 GiB
VG UUID ARmaCh-vFbx-dqxr-asWG-p11h-1Tzc-dv1OEi
[root@instructor Desktop]# vgremove /dev/testvg
Volume group "testvg" successfully removed
四、查看物理卷的状态并一一删除
[root@instructor Desktop]# pvdisplay /dev/sdb1 /dev/sdc1 /dev/sdd1
"/dev/sdb1" is a new physical volume of "20.00 GiB"--- NEW Physical volume ---
PV Name /dev/sdb1
VG Name
PV Size 20.00 GiB
Allocatable NO
PE Size 0
Total PE 0
Free PE 0
Allocated PE 0
PV UUID OIO7pd-B6Ib-YGcr-w8sh-GYsA-zXZG-CsrD3O
"/dev/sdc1" is a new physical volume of "20.00 GiB"
--- NEW Physical volume ---
PV Name /dev/sdc1
VG Name
PV Size 20.00 GiB
Allocatable NO
PE Size 0
Total PE 0
Free PE 0
Allocated PE 0
PV UUID WXCfeV-8KYH-ammN-Gine-yjOQ-lbXK-ulEos1
"/dev/sdd1" is a new physical volume of "20.00 GiB"
--- NEW Physical volume ---
PV Name /dev/sdd1
VG Name
PV Size 20.00 GiB
Allocatable NO
PE Size 0
Total PE 0
Free PE 0
Allocated PE 0
PV UUID bdeEPp-L9Az-QVMg-f1O6-gaK0-vRcw-RvL1cF
[root@instructor Desktop]# pvremove /dev/sdb1 /dev/sdc1 /dev/sdd1
Labels on physical volume "/dev/sdb1" successfully wiped
Labels on physical volume "/dev/sdc1" successfully wiped
Labels on physical volume "/dev/sdd1" successfully wiped
[root@instructor Desktop]# pvdisplay
--- Physical volume ---
PV Name /dev/sda3
VG Name GLSguest
PV Size 19.53 GiB / not usable 32.00 MiB
Allocatable yes
PE Size 32.00 MiB
Total PE 624
Free PE 624
Allocated PE 0
PV UUID qK9igJ-bMKg-F2qg-qBsf-CJG9-gz9c-I8Rlcb
--- Physical volume ---
PV Name /dev/sda2
VG Name GLSvg
PV Size 31.25 GiB / not usable 32.00 MiB
Allocatable yes
PE Size 32.00 MiB
Total PE 999
Free PE 131
Allocated PE 868
PV UUID YOBheN-WgGO-wKHY-7Gdb-gdAz-aBui-R1IAHx
[root@instructor Desktop]#