【原创】Ceph rbd 添加到 lvm 的 pv 中报错:Device /dev/rbd0 excluded by a filter

1. 出现问题

将 ceph 的块存储 rbd 添加为 pv 时报错:

[root@ceph01 ~]# ceph rbd create -p rbd --inamage rbdtestg --size 10G
[root@ceph01 ~]# rbd map rbd/rbdtest
[root@ceph01 ~]# pvs create /dev/rbd0
  Device /dev/rbd0 excluded by a filter.

2. 问题原因

在 /etc/lvm/lvm.conf 中没有 rbd 这种块设备类型,需要手动添加。
在 lvm.conf 中手动添加 types = [ "rbd", 1024 ] 如下所示:

 ......
 171     # Configuration option devices/types.
 172     # List of additional acceptable block device types.
 173     # These are of device type names from /proc/devices, followed by the
 174     # maximum number of partitions.
 175     #
 176     # Example
 177     # types = [ "fd", 16 ]
 178     types = [ "rbd", 1024 ]
......

3. 其他可能原因

经验证,lvm.conf 中如下选项的调整不起作用:

preferred_names = [ "^/dev/mpath/", "^/dev/mapper/mpath", "^/dev/[hs]d" ]
filter = [ "a|.*/|" ]
global_filter = [ "a|.*/|" ]

你可能感兴趣的:(ceph,linux,RHEL7)