LVM管理体系(四)删除逻辑卷(操作步骤)

一、离线逻辑卷

[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]# 
  • 1
    点赞
  • 2
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值