逻辑卷的删除
当生产环境中想要重新部署或者不需要再继续使用LVM逻辑卷管理器了,除了提前备份好重要数据信息,还必须依次删除LV逻辑卷、VG卷组后再移除PV物理卷设备,这样的顺序不可颠倒。详情请关注《linux就该这么学》。
操作方法
- 01
取消逻辑卷与目录的挂载关联,删除配置文件中永久生效的设备参数。 [root@linuxprobe ~]# umount /linuxprobe [root@linuxprobe ~]# vim /etc/fstab # # /etc/fstab # Created by anaconda on Fri Feb 19 22:08:59 2017 # # Accessible filesystems, by reference, are maintained under '/dev/disk' # See man pages fstab(5), findfs(8), mount(8) and/or blkid(8) for more info # /dev/mapper/rhel-root / xfs defaults 1 1 UUID=50591e35-d47a-4aeb-a0ca-1b4e8336d9b1 /boot xfs defaults 1 2 /dev/mapper/rhel-swap swap swap defaults 0 0 /dev/cdrom /media/cdrom iso9660 defaults 0 0
- 02
把LV逻辑卷设备删除,需要手工输入y来确认操作: [root@linuxprobe ~]# lvremove /dev/storage/vo Do you really want to remove active logical volume vo? [y/n]: y Logical volume "vo" successfully removed
- 03
把VG卷组删除,此处只需写卷组名称即可,而无需设备完整绝对路径: [root@linuxprobe ~]# vgremove storage Volume group "storage" successfully removed
- 04
把PV物理卷设备移除: [root@linuxprobe ~]# pvremove /dev/sdb /dev/sdc Labels on physical volume "/dev/sdb" successfully wiped Labels on physical volume "/dev/sdc" successfully wiped