LVMの削除

一度作成したLVを完全に削除する方法を示す。

確認環境

  • RHEL5.4 on VMware Server 2

  • ファイルシステムをアンマウントする
    • [root@localhost ~]# df
      Filesystem           1K-ブロック    使用   使用可 使用% マウント位置
      /dev/sda2             10154020   3557092   6072808  37% /
      /dev/sda1               256666     37292    206122  16% /boot
      tmpfs                    62192         0     62192   0% /dev/shm
      /dev/mapper/VG0001-LV0001
                               51559      4956     43941  11% /mnt
      [root@localhost ~]# umount /mnt
      [root@localhost ~]# 
  • LVを削除する
    • [root@localhost ~]# lvremove /dev/VG0001/LV0001
      Do you really want to remove active logical volume LV0001? [y/n]: y
        Logical volume "LV0001" successfully removed
      [root@localhost ~]#
  • VGを削除する
    • [root@localhost ~]# vgremove /dev/VG0001
        Volume group "VG0001" successfully removed
      [root@localhost ~]#
  • PVを削除する
特に手順はない。あえて書くなら、parted等でパーティションを消してしまうのが手順。

コメント