Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 500732 - sys-fs/lvm2-2.02.105: lvmetad gets ordering wrong, ignores filter/preferred, shows unknown device/cannot find PV
Summary: sys-fs/lvm2-2.02.105: lvmetad gets ordering wrong, ignores filter/preferred, ...
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: [OLD] Core system (show other bugs)
Hardware: All Linux
: High critical with 1 vote (vote)
Assignee: Robin Johnson
URL:
Whiteboard:
Keywords:
: 510660 (view as bug list)
Depends on:
Blocks:
 
Reported: 2014-02-09 01:55 UTC by Robin Johnson
Modified: 2016-03-21 13:24 UTC (History)
11 users (show)

See Also:
Package list:
Runtime testing required: ---


Attachments
pvscan --cache -vvvv (pvscan.cache.vvvv,53.03 KB, text/plain)
2014-02-09 18:36 UTC, Robin Johnson
Details
pvscan -vvvv (without lvmetad running) (pvscan.vvvv-nolvmetad,54.84 KB, text/plain)
2014-02-09 18:39 UTC, Robin Johnson
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Robin Johnson archtester Gentoo Infrastructure gentoo-dev Security 2014-02-09 01:55:17 UTC
lvm.conf:
devices {
    preferred_names = [ "^/dev/mpath/", "^/dev/mapper/mpath", "^/dev/md4", "/dev/sda4" ]
    filter = [ "r|/dev/nbd.*|", "r|^/dev/sd[bc]|" ]
    sysfs_scan = 1
    multipath_component_detection = 1
    md_component_detection = 1
    md_chunk_alignment = 1
}

without lvmetad:
# lvs  -a -o lv_name,vg_name,lv_attr,lv_size,devices
  LV                    VG   Attr       LSize   Devices          
  backup                vg   -wi-a----- 200.00g /dev/sda4(26761) 
  code                  vg   -wi-ao--p-  30.00g /dev/md4(0)      
  dale_tmp              vg   -wi-a----- 300.00g /dev/sda4(583561)
  ebook                 vg   -wi-a-----  75.00g /dev/sda4(564361)
  home                  vg   -wi-ao---- 550.00g /dev/sda4(660361)
  home_gentoo           vg   -wi-ao---- 400.00g /dev/sda4(77961) 
  home_mp3              vg   -wi-ao----   1.27t /dev/sda4(180361)
  laura                 vg   -wi-ao----  65.00g /dev/sda4(0)     
  m-laptop-vista-backup vg   -wi-a-----  20.00g /dev/sda4(16640) 
  opt                   vg   -wi-ao--p-  10.00g /dev/md4(7680)   
  [pvmove0]             vg   vwC---v---   4.00m                  
  root                  vg   -wi-ao--p-  10.00g /dev/md4(34560)  
  susan-backup          vg   -wi-a----- 200.00g /dev/sda4(513161)
  tmp                   vg   -wi-ao--p-  10.00g /dev/md4(32000)  
  usr                   vg   -wi-ao--p-  35.00g /dev/md4(10240)  
  usr_lib_debug         vg   -wi-ao--p-  20.00g /dev/md4(26880)  
  usr_src               vg   -wi-ao--p-   5.00g /dev/md4(19200)  
  usr_src2              vg   -wi-----p-  10.00g /dev/md4(37120)  
  var                   vg   -wi-ao--p-  25.00g /dev/md4(20480)  
  vm1                   vg   -wi-ao--p-   5.00g /dev/md4(42240)  
  vm2                   vg   -wi-ao--p-   5.00g /dev/md4(43520)  
  vm3                   vg   -wi-ao--p-   5.00g /dev/md4(44800)  
  vm4                   vg   -wi-ao--p-   5.00g /dev/md4(46080)  

with lvmetad:
# lvs  -a -o lv_name,vg_name,lv_attr,lv_size,devices
  Found duplicate PV PQ6Sc05axd6gVPjRVExfJelEq73yQnXs: using /dev/sdb4 not /dev/md4
  Found duplicate PV PQ6Sc05axd6gVPjRVExfJelEq73yQnXs: using /dev/sdc4 not /dev/sdb4
  /dev/sdd: open failed: No medium found
  /dev/sde: open failed: No medium found
  /dev/sdf: open failed: No medium found
  No device found for PV PQ6Sc0-5axd-6gVP-jRVE-xfJe-lEq7-3yQnXs.
  No device found for PV PQ6Sc0-5axd-6gVP-jRVE-xfJe-lEq7-3yQnXs.
  LV                    VG   Attr       LSize   Devices          
  backup                vg   -wi-a----- 200.00g /dev/sda4(26761) 
  code                  vg   -wi-ao--p-  30.00g /dev/sdc4(0)     
  dale_tmp              vg   -wi-a----- 300.00g /dev/sda4(583561)
  ebook                 vg   -wi-a-----  75.00g /dev/sda4(564361)
  home                  vg   -wi-ao---- 550.00g /dev/sda4(660361)
  home_gentoo           vg   -wi-ao---- 400.00g /dev/sda4(77961) 
  home_mp3              vg   -wi-ao----   1.27t /dev/sda4(180361)
  laura                 vg   -wi-ao----  65.00g /dev/sda4(0)     
  m-laptop-vista-backup vg   -wi-a-----  20.00g /dev/sda4(16640) 
  opt                   vg   -wi-ao--p-  10.00g /dev/sdc4(7680)  
  [pvmove0]             vg   vwC---v---   4.00m                  
  root                  vg   -wi-ao--p-  10.00g /dev/sdc4(34560) 
  susan-backup          vg   -wi-a----- 200.00g /dev/sda4(513161)
  tmp                   vg   -wi-ao--p-  10.00g /dev/sdc4(32000) 
  usr                   vg   -wi-ao--p-  35.00g /dev/sdc4(10240) 
  usr_lib_debug         vg   -wi-ao--p-  20.00g /dev/sdc4(26880) 
  usr_src               vg   -wi-ao--p-   5.00g /dev/sdc4(19200) 
  usr_src2              vg   -wi-----p-  10.00g /dev/sdc4(37120) 
  var                   vg   -wi-ao--p-  25.00g /dev/sdc4(20480) 
  vm1                   vg   -wi-ao--p-   5.00g /dev/sdc4(42240) 
  vm2                   vg   -wi-ao--p-   5.00g /dev/sdc4(43520) 
  vm3                   vg   -wi-ao--p-   5.00g /dev/sdc4(44800) 
  vm4                   vg   -wi-ao--p-   5.00g /dev/sdc4(46080) 
# lvs  -a -o lv_name,vg_name,lv_attr,lv_size,devices
  No device found for PV PQ6Sc0-5axd-6gVP-jRVE-xfJe-lEq7-3yQnXs.
  No device found for PV PQ6Sc0-5axd-6gVP-jRVE-xfJe-lEq7-3yQnXs.
  LV                    VG   Attr       LSize   Devices              
  backup                vg   -wi-a----- 200.00g /dev/sda4(26761)     
  code                  vg   -wi-ao--p-  30.00g unknown device(0)    
  dale_tmp              vg   -wi-a----- 300.00g /dev/sda4(583561)    
  ebook                 vg   -wi-a-----  75.00g /dev/sda4(564361)    
  home                  vg   -wi-ao---- 550.00g /dev/sda4(660361)    
  home_gentoo           vg   -wi-ao---- 400.00g /dev/sda4(77961)     
  home_mp3              vg   -wi-ao----   1.27t /dev/sda4(180361)    
  laura                 vg   -wi-ao----  65.00g /dev/sda4(0)         
  m-laptop-vista-backup vg   -wi-a-----  20.00g /dev/sda4(16640)     
  opt                   vg   -wi-ao--p-  10.00g unknown device(7680) 
  [pvmove0]             vg   vwC---v---   4.00m                      
  root                  vg   -wi-ao--p-  10.00g unknown device(34560)
  susan-backup          vg   -wi-a----- 200.00g /dev/sda4(513161)    
  tmp                   vg   -wi-ao--p-  10.00g unknown device(32000)
  usr                   vg   -wi-ao--p-  35.00g unknown device(10240)
  usr_lib_debug         vg   -wi-ao--p-  20.00g unknown device(26880)
  usr_src               vg   -wi-ao--p-   5.00g unknown device(19200)
  usr_src2              vg   -wi-----p-  10.00g unknown device(37120)
  var                   vg   -wi-ao--p-  25.00g unknown device(20480)
  vm1                   vg   -wi-ao--p-   5.00g unknown device(42240)
  vm2                   vg   -wi-ao--p-   5.00g unknown device(43520)
  vm3                   vg   -wi-ao--p-   5.00g unknown device(44800)
  vm4                   vg   -wi-ao--p-   5.00g unknown device(46080)
Comment 1 Robin Johnson archtester Gentoo Infrastructure gentoo-dev Security 2014-02-09 01:57:59 UTC
# pvs
  PV         VG   Fmt  Attr PSize   PFree  
  /dev/md4   vg   lvm2 a-m  465.38g 290.38g
  /dev/sda4  vg   lvm2 a--    3.64t 614.89g

# lvcreate  -n vm1.tmp -L 1g vg
  Cannot change VG vg while PVs are missing.
  Consider vgreduce --removemissing.

# pvs -a
  PV                            VG   Fmt  Attr PSize   PFree  
  /dev/dm-0                               ---       0       0 
  /dev/dm-1                               ---       0       0 
  /dev/dm-13                              ---       0       0 
  /dev/dm-14                              ---       0       0 
  /dev/dm-15                              ---       0       0 
  /dev/dm-16                              ---       0       0 
  /dev/dm-18                              ---       0       0 
  /dev/dm-19                              ---       0       0 
  /dev/dm-2                               ---       0       0 
  /dev/dm-20                              ---       0       0 
  /dev/dm-21                              ---       0       0 
  /dev/dm-3                               ---       0       0 
  /dev/dm-4                               ---       0       0 
  /dev/dm-5                               ---       0       0 
  /dev/dm-6                               ---       0       0 
  /dev/dm-9                               ---       0       0 
  /dev/md2                                ---       0       0 
  /dev/md3                                ---       0       0 
  /dev/md4                      vg   lvm2 a-m  465.38g 290.38g
  /dev/sda1                               ---       0       0 
  /dev/sda4                     vg   lvm2 a--    3.64t 614.89g
  /dev/vg/backup                          ---       0       0 
  /dev/vg/dale_tmp                        ---       0       0 
  /dev/vg/ebook                           ---       0       0 
  /dev/vg/m-laptop-vista-backup           ---       0       0 
  /dev/vg/susan-backup                    ---       0       0
Comment 2 Robin Johnson archtester Gentoo Infrastructure gentoo-dev Security 2014-02-09 02:02:53 UTC
I'm concerned that my system is now unbootable.

# lvchange -ay vg/root 
  Refusing activation of partial LV root. Use --partial to override.

# lvdisplay --maps vg/root
  --- Logical volume ---
  LV Path                /dev/vg/root
  LV Name                root
  VG Name                vg
  LV UUID                rAHQ5C-aAKX-n559-XA0F-YCYz-ooOt-v080bv
  LV Write Access        read/write
  LV Creation host, time bohr-int, 2013-11-01 17:21:45 -0700
  LV Status              available
  # open                 1
  LV Size                10.00 GiB
  Current LE             2560
  Segments               1
  Allocation             inherit
  Read ahead sectors     auto
  - currently set to     256
  Block device           254:16
   
  --- Segments ---
  Logical extent 0 to 2559:
    Type		linear
    Physical volume	/dev/md4
    Physical extents	34560 to 37119
Comment 3 Robin Johnson archtester Gentoo Infrastructure gentoo-dev Security 2014-02-09 18:36:44 UTC
Created attachment 369964 [details]
pvscan --cache -vvvv
Comment 4 Robin Johnson archtester Gentoo Infrastructure gentoo-dev Security 2014-02-09 18:39:19 UTC
Created attachment 369966 [details]
pvscan -vvvv (without lvmetad running)
Comment 5 Alexander Tsoy 2014-02-10 11:39:20 UTC
From the default lvm.conf:

    # Since "filter" is often overridden from command line, it is not suitable
    # for system-wide device filtering (udev rules, lvmetad). To hide devices
    # from LVM-specific udev processing and/or from lvmetad, you need to set
    # global_filter. The syntax is the same as for normal "filter"
    # above. Devices that fail the global_filter are not even opened by LVM.
Comment 6 Robin Johnson archtester Gentoo Infrastructure gentoo-dev Security 2014-02-10 18:24:12 UTC
(In reply to Alexander Tsoy from comment #5)
> From the default lvm.conf:
>     # Since "filter" is often overridden from command line, it is not
> suitable
>     # for system-wide device filtering (udev rules, lvmetad). To hide devices
>     # from LVM-specific udev processing and/or from lvmetad, you need to set
>     # global_filter. The syntax is the same as for normal "filter"
>     # above. Devices that fail the global_filter are not even opened by LVM.

Alexandar: since I followed up with agk, if I remove all filter options:
preferred_names = []
filter = []

Then lvmetad STILL screws up the md component detection. If I force global_filter, I can get it scan just the correct devices manually, but md component detection really should work.
Comment 7 Robin Johnson archtester Gentoo Infrastructure gentoo-dev Security 2014-02-13 03:59:20 UTC
agk: did you pass it on to mornfall and figure out why lvmetad wasn't doing md component detection properly?
Comment 8 Alasdair Kergon 2014-02-13 10:42:57 UTC
Yes, I mentioned it.  There looks to be a problem with the way (non-regex) filters are being applied when using lvmetad.
Comment 9 Jeroen Roovers (RETIRED) gentoo-dev 2014-05-18 23:14:53 UTC
*** Bug 503016 has been marked as a duplicate of this bug. ***
Comment 10 Jeroen Roovers (RETIRED) gentoo-dev 2014-05-18 23:15:11 UTC
*** Bug 510660 has been marked as a duplicate of this bug. ***
Comment 11 El Goretto 2014-09-06 14:35:29 UTC
In the bug #503016 (sys-fs/lvm2: remove lvmetad from initd "need") has been quite hastedly marked duplicate of this one.
Let's say one doesn't want lvmetad to run on a server that is totally udev-less (if that doesn't make sense, feel free to comment), this server is still running lvmetad even if it's disabled in lvm.conf, as lvm init script pulls the lvmetad init script from the "need" section regardless.

That seems pretty not desirable.
Comment 12 Doug Goldstein gentoo-dev 2016-03-15 04:19:20 UTC
Robin: Have you rechecked this on a newer version?
Comment 13 masc 2016-03-15 11:07:00 UTC
I have been experiencing this with md as well and just checked against 2.0.2.145-r1, where it seems to be ok (lvs does not report inconsistencies)
Comment 14 Doug Goldstein gentoo-dev 2016-03-20 14:37:39 UTC
(In reply to masc from comment #13)
> I have been experiencing this with md as well and just checked against
> 2.0.2.145-r1, where it seems to be ok (lvs does not report inconsistencies)

Great. So that sounds like +1 to fixed in at least 145 and possibly sooner. The interesting thing would be if its fixed in the latest stable.
Comment 15 masc 2016-03-21 08:49:02 UTC
(In reply to Doug Goldstein from comment #14)
> The interesting thing would be if its fixed in the latest stable.

just checked, looks good to me with 2.02.116-r4 as well.
Comment 16 masc 2016-03-21 09:04:15 UTC
as a sidenote, while this issue seems to be resolved in 2.02.116-r4, I experienced breakage of libvirt after going back to stable.

virDriverLoadModule:73 : failed to load module /usr/lib64/libvirt/connection-driver/libvirt_driver_storage.so /lib64/libdevmapper.so.1.02: version `DM_1_02_97' not found (required by /usr/lib64/libvirt/connection-driver/libvirt_driver_storage.so)

thus reverted unstable again. maybe it's better to move forward.
Comment 17 Doug Goldstein gentoo-dev 2016-03-21 13:24:25 UTC
(In reply to masc from comment #16)
> as a sidenote, while this issue seems to be resolved in 2.02.116-r4, I
> experienced breakage of libvirt after going back to stable.
> 
> virDriverLoadModule:73 : failed to load module
> /usr/lib64/libvirt/connection-driver/libvirt_driver_storage.so
> /lib64/libdevmapper.so.1.02: version `DM_1_02_97' not found (required by
> /usr/lib64/libvirt/connection-driver/libvirt_driver_storage.so)
> 
> thus reverted unstable again. maybe it's better to move forward.

I can see that happening if you move backwards in versions. Thanks for testing.