您现在的位置是:首页> 操作系统> Linux

LVM实战案例之LVM删除

  • 3160人已阅读
  • 时间:2018-10-20 16:43:24
  • 分类:Linux
  • 作者:祥哥

续上

四、删除LV,删除VG,删除PV

(1)查看vg信息,lv信息及磁盘信息

[root@db01 /]# vgdisplay -v
[root@db01 /]# lvdisplay -v
 
[root@db01 /]# df -h
Filesystem                     Size  Used Avail Use% Mounted on
/dev/sda3                       45G  4.4G   39G  11% /
tmpfs                         1004M     0 1004M   0% /dev/shm
/dev/sda1                      485M   39M  421M   9% /boot
/dev/sdb2                       79G  184M   75G   1% /oracle
/dev/sdb1                       20G  172M   19G   1% /soft
/dev/sdd1                     1007M   18M  939M   2% /alexpeng
/dev/mapper/oraclevg-lvoracle  2.0G   68M  1.9G   4% /ora01

(2)卸载分区

[root@db01 /]# umount /ora01

(3)从卷组oraclevg中删除逻辑卷lvoracle

[root@db01 /]# lvremove /dev/oraclevg/lvoracle
Do you really want to remove active logical volume lvoracle? [y/n]: y
  Logical volume "lvoracle" successfully removed

(4)删除卷组oraclevg

[root@db01 /]# vgremove oraclevg
  Volume group "oraclevg" successfully removed
[root@db01 /]#
[root@db01 /]#
[root@db01 /]#
[root@db01 /]# pvs
  PV         VG   Fmt  Attr PSize PFree
  /dev/sde        lvm2 a--  2.00g 2.00g
  /dev/sdf        lvm2 a--  2.00g 2.00g
  /dev/sdg        lvm2 a--  2.00g 2.00g

(5)删除物理卷

[root@db01 /]# pvremove /dev/sdg /dev/sdf /dev/sde
  Labels on physical volume "/dev/sdg" successfully wiped
  Labels on physical volume "/dev/sdf" successfully wiped
  Labels on physical volume "/dev/sde" successfully wiped
[root@db01 /]#
[root@db01 /]# pvs


Top