Bug 1099329

Summary: lvm setup on softraid fails to boot without lvmetad in initrd
Product: [openSUSE] openSUSE Tumbleweed Reporter: Thomas Blume <thomas.blume>
Component: BasesystemAssignee: heming zhao <heming.zhao>
Status: RESOLVED FIXED QA Contact: E-mail List <qa-bugs>
Severity: Major    
Priority: P5 - None CC: heming.zhao, reset11, tabt
Version: Current   
Target Milestone: ---   
Hardware: Other   
OS: Other   
Whiteboard:
Found By: --- Services Priority:
Business Priority: Blocker: ---
Marketing QA Status: --- IT Deployment: ---

Description Thomas Blume 2018-06-27 14:42:12 UTC
On a current tumbleweed, /usr/lib/dracut/modules.d/90lvm/module-setup.sh explicitly excludes lvmetad from the initrd.
Still, pvscan fails with duplicate volume errors, if lvmetad isn't running.
Working case with lvmetad enabled:

-->
d87:~ # systemctl is-active lvm2-lvmetad
active
d87:~ # pvscan
  PV /dev/md1    VG mortlach        lvm2 [40,00 GiB / 0    free]
  PV /dev/sdc1   VG iscsibackend    lvm2 [800,00 GiB / 730,00 GiB free]
  Total: 2 [840,00 GiB] / in use: 2 [840,00 GiB] / in no VG: 0 [0   ]
-->

Failing case with lvmetad disabled:

-->
d87:~ # systemctl stop lvm2-lvmetad
Warning: Stopping lvm2-lvmetad.service, but it can still be activated by:
  lvm2-lvmetad.socket
d87:~ # systemctl stop lvm2-lvmetad.socket
d87:~ # 
d87:~ # pvscan
  WARNING: Failed to connect to lvmetad. Falling back to device scanning.
  /dev/cdrom: open failed: Kein Medium gefunden
  WARNING: PV Zy5FoS-mlw8-pfzo-2APv-GEDg-rWOA-1wyqbv on /dev/md1 was already found on /dev/sda1.
  WARNING: PV Zy5FoS-mlw8-pfzo-2APv-GEDg-rWOA-1wyqbv on /dev/sdb1 was already found on /dev/sda1.
  WARNING: PV Zy5FoS-mlw8-pfzo-2APv-GEDg-rWOA-1wyqbv prefers device /dev/md1 because device is used by LV.
  WARNING: PV Zy5FoS-mlw8-pfzo-2APv-GEDg-rWOA-1wyqbv prefers device /dev/md1 because device is used by LV.
  PV /dev/md1    VG mortlach        lvm2 [40,00 GiB / 0    free]
  PV /dev/sdc1   VG iscsibackend    lvm2 [800,00 GiB / 730,00 GiB free]
  Total: 2 [840,00 GiB] / in use: 2 [840,00 GiB] / in no VG: 0 [0   ]
--<

Due to the duplicate pv error, the volumes cannot be enabled.
That means the boot fails if system root is on softraid backed lvm.
I've tried several filter and global_filter setting in lvm.conf, but they don't seem to have any effect without lvmetad.
Comment 1 Michael Hanscho 2018-06-27 20:19:00 UTC
*** Bug 1099391 has been marked as a duplicate of this bug. ***
Comment 2 heming zhao 2019-10-14 06:48:52 UTC
*** Bug 1136641 has been marked as a duplicate of this bug. ***
Comment 3 heming zhao 2019-10-14 06:49:32 UTC
1099391, 1099329 & 1136641 are same bug.
need below patch (under lvm2 stable-2.02 branch):
these patch had been merged in tumbleweed (lvm2-2.03.05)

patch:
```
commit a188b1e513ed5ca0f5f3702c823490f5610d4495
Author: David Teigland <teigland@redhat.com>
Date:   Fri Nov 30 16:32:32 2018 -0600

    pvscan lvmetad: use udev info to improve md component detection


commit a01e1fec0fe7c2fa61577c0e636e907cde7279ea
Author: David Teigland <teigland@redhat.com>
Date:   Thu Nov 29 14:06:20 2018 -0600

    pvscan lvmetad: use full md filter when md 1.0 devices are present


commit 0e42ebd6d4012d210084a9ccf8d76f853726de3c
Author: Peter Rajnoha <prajnoha@redhat.com>
Date:   Thu Nov 29 11:51:05 2018 -0600

    scan: md metadata version 0.90 is at the end of disk


commit e7bb50880901a4462e350ce0d272a63aa8440781
Author: David Teigland <teigland@redhat.com>
Date:   Thu Oct 18 11:32:32 2018 -0500

    scan: enable full md filter when md 1.0 devices are present


commit de2863739f2ea17d89d0e442379109f967b5919d
Author: David Teigland <teigland@redhat.com>
Date:   Fri Jun 15 11:42:10 2018 -0500

    scan: use full md filter when md 1.0 devices are present


commit c527a0cbfc391645d30407d2dc4a30275c6472f1
Author: David Teigland <teigland@redhat.com>
Date:   Mon Aug 27 11:15:35 2018 -0500

    lvmetad: improve scan for pvscan all
```
Comment 4 heming zhao 2019-10-14 06:56:56 UTC
this bug same as bug 1145231.

*** This bug has been marked as a duplicate of bug 1145231 ***
Comment 5 heming zhao 2019-10-14 07:36:12 UTC
sorry, my mistake.
Duping old reports to newer reports is rude
Comment 6 heming zhao 2019-10-18 09:44:57 UTC
This bug target is for tumbleweed. 
I had pushed lvm2 latest codes (lvm2-2.03.05+) to tumbleweed. The 2.03.05 contains these patch which mention in comment #3.

So I closed this bug.