LVM2 : Failing to pvcreate a block device

蓝咒 提交于 2020-12-01 10:18:50

问题


I'm trying to make use of the LVM2 functionality in linux (Centos6.0). When trying to make the first step of defining a PV on a specific block device, I get the following error message:

[root@localhost /] pvcreate /dev/sdb

Can't open /dev/sdb exclusively. Mounted filesystem?

/dev/sdb is not mounted and its partition table was deleted. I should mention also that /dev/sdb used to represent a larger block device (about 4 times larger) and was reduced by configuration of hardware raid (I split the hd to 4 in the raid controller).

Has anyone ever encountered this error before and knows how to take it from here?


回答1:


Maybe device-mapper is 'stealing' this device. Try this:

[root@host ~]# dmsetup ls
sdb     (253, 2)
VolGroup00-LogVol01     (253, 1)
VolGroup00-LogVol00     (253, 0)

If you find sdb device listed as above example, remove it using dmsetup and create the physical volume:

[root@host ~]# dmsetup remove sdb

[root@host ~]# pvcreate /dev/sdb
Physical volume "/dev/sdb" successfully created



回答2:


[root@localhost /] pvcreate -vvvvv /dev/sdb

Could ouput more details. and you could use lsof -L to check if the block device is opened by other process.



来源:https://stackoverflow.com/questions/10889433/lvm2-failing-to-pvcreate-a-block-device

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!