pvcreate disk filtered while filter is set and no mpath

Billy K asked:

I have been fighting with an issue on CentOS 7.6.1801 on a HP over HW RAID. I searched a lot and tried many options about I still can’t fix this. May be I overlook something. I hope someone can spot it.

# pvcreate /dev/sdb
Device /dev/sdb excluded by a filter.

# lsblk /dev/sdb
NAME MAJ:MIN RM SIZE RO TYPE MOUNTPOINT
sdb 8:16 0 6.6T 0 disk

/etc/lvm/lvm.conf :
filter = ["a|^/dev/sda2$|", "r|.*|"]
global_filter = ["a|/dev/sdb |"]

==========

(parted) print
Model: HPE LOGICAL VOLUME (scsi)
Disk /dev/sdb: 7201GB
Sector size (logical/physical): 512B/4096B
Partition Table: gpt
Disk Flags:

Number Start End Size File system Name Flags

(parted)

==============

`# pvcreate /dev/sdb -vv
(removed lines with sda)

  Setting devices/global_filter to global_filter = [ "a|/dev/sdb |" ]
  devices/cache not found in config: defaulting to /etc/lvm/cache/.cache
  metadata/record_lvs_history not found in config: defaulting to 0
  File-based locking selected.
  metadata/pvmetadataignore not found in config: defaulting to 0
  metadata/pvmetadatasize not found in config: defaulting to 255
  metadata/pvmetadatacopies not found in config: defaulting to 1
  report/output_format not found in config: defaulting to basic
  log/report_command_log not found in config: defaulting to 0
  Locking /run/lock/lvm/P_orphans WB
  devices/cache not found in config: defaulting to /etc/lvm/cache/.cache

Device /dev/sdb excluded by a filter.
Unlocking /run/lock/lvm/P_orphans`

My answer:


You overlooked some whitespace.

global_filter = ["a|/dev/sdb |"]

Did you miss the space after sdb? That should not be there. If you are trying to match /dev/sdb, then this will fail to match because of the space.


View the full question and any other answers on Server Fault.

Creative Commons License
This work is licensed under a Creative Commons Attribution-ShareAlike 3.0 Unported License.