OpenStack 删除 Cinder 僵尸卷的方法#
lvremove /dev/cinder-volumes/volume-<卷id>
如果提示报错:#
device-mapper: remove ioctl on failed: Deviceor resource busy. 设备繁忙
卷文件系统被占用
检查是否被打开#
dmsetupinfo -c /dev/cinder-volumes/volume-<卷id>
查看被谁打开#
fuser -m /dev/cinder-volumes/volume-<卷id>
将进程杀掉#
kill -9 28964 28968 28970 29906
如果提示报错:#
Logical volume cinder-volumes/volume-<卷 id> is used by another device.
卷可能被其他设备占用
首先查找到卷的映射#
dmsetup info -c
查找映射设备#
ls -la /sys/dev/block/253\:6/holders
删除 md 设备#
mdadm -S /dev/md125
删除删除对应 dm 设备#
dmsetup remove /dev/dm-6
再次检查是否被打开#
dmsetupinfo -c /dev/cinder-volumes/volume-<卷id>
没有被打开后再执行删除#
lvremove /dev/cinder-volumes/volume-<卷id>
提示以下内容后就成功删除啦#
Logical volume "/dev/cinder-volumes/volume-<卷 id>" successfully. 已删除