0

On CentOS 7 trying to create physical volume using mpath device. But it throwing this error message.

How to resolve this issues?

 pvcreate /dev/mapper/mpathb1
  Device /dev/mapper/mpathb1 excluded by a filter.

# grep 'filter =' /etc/lvm/lvm.conf |grep -v  "#"
        filter = [ "a|^/dev/sda[1-9]$|", "a|/dev/mapper/.*|" ]


 fdisk -l /dev/mapper/mpathb

Disk /dev/mapper/mpathb: 1099.5 GB, 1099511627776 bytes, 2147483648 sectors
Units = sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 8192 bytes / 33553920 bytes
Disk label type: dos
Disk identifier: 0x00086488

             Device Boot      Start         End      Blocks   Id  System
/dev/mapper/mpathb1           65535  2147483647  1073709056+   5  Extended
Partition 1 does not start on physical sector boundary.

Update 1:

I re-created the partition and update the lvm filter. still same error.

# sgdisk -p /dev/mapper/mpathb
Disk /dev/mapper/mpathb: 2147483648 sectors, 1024.0 GiB
Logical sector size: 512 bytes
Disk identifier (GUID): 4AEDF958-9100-48BF-817E-01200483FA3A
Partition table holds up to 128 entries
First usable sector is 34, last usable sector is 2147483614
Partitions will be aligned on 2048-sector boundaries
Total free space is 2014 sectors (1007.0 KiB)

Number  Start (sector)    End (sector)  Size       Code  Name
   1            2048      2147483614   1024.0 GiB  8E00  Linux LVM


# grep 'filter =' /etc/lvm/lvm.conf |grep -v  "#"
        filter = [ "a|^/dev/sda[1-9]$|","a|^/dev/sdd[1-9]$|","a|^/dev/dm*|", "a|^/dev/mapper/*|", "r|^/dev/*|" ]

disk locally attached

# lsscsi
[0:0:0:0]    disk    DGC      VRAID            4201  /dev/sda
[0:0:0:1]    disk    DGC      VRAID            4201  /dev/sdb
[0:0:1:0]    disk    DGC      VRAID            4201  /dev/sdc
[0:0:1:1]    disk    DGC      VRAID            4201  /dev/sdd


# multipath -l
mpathb (36006016072b0460093c3485ba71944fa) dm-4 DGC     ,VRAID
size=1.0T features='2 queue_if_no_path retain_attached_hw_handler' hwhandler='1 alua' wp=rw
|-+- policy='service-time 0' prio=0 status=active
| `- 0:0:0:1 sdb 8:16 active undef unknown
`-+- policy='service-time 0' prio=0 status=enabled
  `- 0:0:1:1 sdd 8:48 active undef unknown
mpatha (36006016072b046008c5c305bcc0c5bf1) dm-0 DGC     ,VRAID
size=100G features='2 queue_if_no_path retain_attached_hw_handler' hwhandler='1 alua' wp=rw
|-+- policy='service-time 0' prio=0 status=active
| `- 0:0:0:0 sda 8:0  active undef unknown
`-+- policy='service-time 0' prio=0 status=enabled
  `- 0:0:1:0 sdc 8:32 active undef unknown
1

This post gave me the information to resolve my issue.

https://serverfault.com/questions/87710/debian-lenny-san-lvm-fail

I have use the slice 1 to create the PV.

# pvcreate /dev/mapper/mpathb1
  Physical volume "/dev/mapper/mpathb1" successfully created.

FYI: used this script to create the disk partition

# cat a.sh
#!/bin/bash
sgdisk -og $1
partprobe $1
ENDSECTOR=`sgdisk -E $1`
sgdisk -n 1:2048:$ENDSECTOR -c 1:"Linux LVM" -t 1:8e00 $1
partprobe $1
sgdisk -p $1
0

Possible causes: Something wrong with the filter config. See [1]. cat /proc/partitions to verify if the partitiontable has been read by the kernel. In case not, use partprobe or kpartx.

[1] https://www.thegeekdiary.com/pvcreate-fails-with-error-device-dev-mapper-mpatha-not-found-or-ignored-by-filtering/

  • I tried from that link still getting the same error. Is there any other file giving this ` Device excluded by a filter` message – sfgroups Jul 13 '18 at 22:24
  • Can you try the pvcreate with --verbose? Eventually that contains an info what filter causes the message. – hargut Jul 13 '18 at 22:43
  • verbose didn't show much information. I should have used the slice of mpath device. not the device name itself. Thanks for your help. – sfgroups Jul 14 '18 at 15:04

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.