LVM删除

一 删除LVM步骤

  • 卸载挂载点
  • 移除LV
  • 移除VG
  • 移除PV
  • 删除配置文件

二 卸载挂载点

[root@master ~]# umount /dev/vgtest/vgtest_LV01 /data

三 移除LV

[root@master ~]# lvremove /dev/vgtest/vgtest_LV01 
Do you really want to remove active logical volume vgtest/vgtest_LV01? [y/n]: y
  Logical volume "vgtest_LV01" successfully removed
[root@master ~]# 

四 移除VG

[root@master ~]# vgremove vgtest
  Volume group "vgtest" successfully removed

五 移除PV

[root@master ~]# pvremove /dev/sdb1 /dev/sdc1
  Labels on physical volume "/dev/sdb1" successfully wiped.
  Labels on physical volume "/dev/sdc1" successfully wiped.

六 验证查看

[root@master ~]# pvscan
  PV /dev/sda2   VG centos          lvm2 [19.80 GiB / 0    free]
  Total: 1 [19.80 GiB] / in use: 1 [19.80 GiB] / in no VG: 0 [0   ]
[root@master ~]# vgscan
  Reading volume groups from cache.
  Found volume group "centos" using metadata type lvm2
[root@master ~]# lvscan
  ACTIVE            '/dev/centos/swap' [1000.00 MiB] inherit
  ACTIVE            '/dev/centos/root' [18.82 GiB] inherit
[root@master ~]# 

已经没有了。

原文地址:https://www.cnblogs.com/liujunjun/p/14130211.html