Hide Forgot
RHEL6 version of lvm2 uses devices/obtain_device_list_from_udev=0 by default. As such, the persistent filter is used if it exists - this is the /etc/lvm/cache/.cache. This file contains list of devices which passed filtering before and the state is saved for next lvm commands to speedup filtering part. However, in case of pvcreate, we should wipe any existing persistent filter and reevaluate filters again. Otherwise there's a possibility that someone changed the device and it's partitioned now or it's used as part of other block subsystems (mpath or md). In this case, if the persistent filter is not updated, we could overwrite any existing signatures or use improper device for a PV - pvcreate should stop us from doing that. See also bug #1094162 comment #6. This should be patched now with: https://git.fedorahosted.org/cgit/lvm2.git/commit/?id=e80884cd080cad7e10be4588e3493b9000649426
There is one regression that the patch mentioned in comment #0 caused. There's a bug #1120564 to cover that (it's about wrong .cache file generated after vgcreate VG PV where the PV is created together with the VG and obtain_device_list_from_udev=0 and so the .cache is used).
To QA: A simple reproducer may be: - make sure you have obtain_device_list_from_udev=0 in lvm.conf # vgscan Reading all physical volumes. This may take a while... Found volume group "fedora" using metadata type lvm2 # grep sda /etc/lvm/cache/.cache "/dev/sda", # parted /dev/sda mklabel gpt Information: You may need to update /etc/fstab. Before the fix: (/dev/sda still in .cache as usable device!) # grep sda /etc/lvm/cache/.cache "/dev/sda", (pvcreate not noticing /dev/sda is parted!) # pvcreate /dev/sda Physical volume "/dev/sda" successfully created With the fix: (/dev/sda still in .cache as usable device - .cache is not update until lvm command is run!) # grep sda /etc/lvm/cache/.cache "/dev/sda", # pvcreate /dev/sda Device /dev/sda not found (or ignored by filtering). # pvcreate /dev/sda -vvvv 2>&1 | grep sda | grep signature #filters/filter-partitioned.c:45 /dev/sda: Skipping: Partition table signature found
Changed the partitioning on an already partitioned device, which caused the LVM to ignore the PV as expected (since 'obtain_device_list_from_udev' was off) [root@tardis-01 ~]# grep sd /etc/lvm/cache/.cache "/dev/sda1", "/dev/sdb1", "/dev/sdc1", "/dev/sdg1", "/dev/sdd1", "/dev/sde1", "/dev/sdf1", "/dev/sdh1", "/dev/sdi1", "/dev/sdj1", "/dev/sdk1", "/dev/sda2", [root@tardis-01 ~]# parted /dev/sdc mklabel gpt Warning: The existing disk label on /dev/sdc will be destroyed and all data on this disk will be lost. Do you want to continue? Yes/No? Yes Information: You may need to update /etc/fstab. [root@tardis-01 ~]# grep sd /etc/lvm/cache/.cache "/dev/sda1", "/dev/sdb1", "/dev/sdc1", "/dev/sdg1", "/dev/sdd1", "/dev/sde1", "/dev/sdf1", "/dev/sdh1", "/dev/sdi1", "/dev/sdj1", "/dev/sdk1", "/dev/sda2", [root@tardis-01 ~]# pvcreate /dev/sdc Physical volume /dev/sdc not found Device /dev/sdc not found (or ignored by filtering). marking VERIFIED with: lvm2-2.02.108-1.el6 BUILT: Thu Jul 24 17:29:50 CEST 2014 lvm2-libs-2.02.108-1.el6 BUILT: Thu Jul 24 17:29:50 CEST 2014 lvm2-cluster-2.02.108-1.el6 BUILT: Thu Jul 24 17:29:50 CEST 2014 udev-147-2.56.el6 BUILT: Fri Jul 11 16:53:07 CEST 2014 device-mapper-1.02.87-1.el6 BUILT: Thu Jul 24 17:29:50 CEST 2014 device-mapper-libs-1.02.87-1.el6 BUILT: Thu Jul 24 17:29:50 CEST 2014 device-mapper-event-1.02.87-1.el6 BUILT: Thu Jul 24 17:29:50 CEST 2014 device-mapper-event-libs-1.02.87-1.el6 BUILT: Thu Jul 24 17:29:50 CEST 2014 device-mapper-persistent-data-0.3.2-1.el6 BUILT: Fri Apr 4 15:43:06 CEST 2014 cmirror-2.02.108-1.el6 BUILT: Thu Jul 24 17:29:50 CEST 2014
Since the problem described in this bug report should be resolved in a recent advisory, it has been closed with a resolution of ERRATA. For information on the advisory, and where to find the updated files, follow the link below. If the solution does not work for you, open a new bug report. http://rhn.redhat.com/errata/RHBA-2014-1387.html