Bug 24599 - Need proper LVM2 support
Summary: Need proper LVM2 support
Status: RESOLVED WONTFIX
Alias: None
Product: udisks
Classification: Unclassified
Component: detection (show other bugs)
Version: unspecified
Hardware: Other All
: medium normal
Assignee: David Zeuthen (not reading bugmail)
QA Contact:
URL:
Whiteboard:
Keywords:
: 24672 (view as bug list)
Depends on:
Blocks:
 
Reported: 2009-10-18 04:01 UTC by Michael Hofmann
Modified: 2012-09-28 15:10 UTC (History)
1 user (show)

See Also:
i915 platform:
i915 features:


Attachments
output of ls -lR /sys (36.56 KB, application/gzip)
2009-10-18 04:01 UTC, Michael Hofmann
Details
output of udevadm info --export-db (13.32 KB, application/gzip)
2009-10-18 04:03 UTC, Michael Hofmann
Details
output of devkit-disks --dump (3.16 KB, application/gzip)
2009-10-18 04:04 UTC, Michael Hofmann
Details
output of lvmdump (29.14 KB, application/x-gtar)
2009-10-18 04:08 UTC, Michael Hofmann
Details

Description Michael Hofmann 2009-10-18 04:01:50 UTC
Created attachment 30519 [details]
output of ls -lR /sys

I have a LVM setup, with one LV in mirrored mode (RAID1) spread over 2 PVs. For such a setup, 3 more DM devices are generated: VG-LV_mimage_0, VG-LV_mimage_1 und VG-LV_mlog. These devices do *not* respresent real LVs, and shouldn't be included in dk-disks.

$ sudo lvs
  LV   VG     Attr   LSize   Origin Snap%  Move Log
  home ubuntu mwi-ao 465.76G                    home_mlog
  root ubuntu -wi-ao  10.00G
  swap ubuntu -wi-ao   4.00G

$ sudo lvs -a
  LV              VG     Attr   LSize   Origin Snap%  Move Log
  home            ubuntu mwi-ao 465.76G                    home_mlog
  [home_mimage_0] ubuntu iwi-ao 465.76G
  [home_mimage_1] ubuntu iwi-ao 465.76G
  [home_mlog]     ubuntu lwi-ao   4.00M
  root            ubuntu -wi-ao  10.00G
  swap            ubuntu -wi-ao   4.00G

To reproduce, create an LVM setup with at least 2 PVs, and change a LV to mirrored mode with "sudo lvconvert -m 1 VG/LV".
Comment 1 Michael Hofmann 2009-10-18 04:03:16 UTC
Created attachment 30520 [details]
output of udevadm info --export-db
Comment 2 Michael Hofmann 2009-10-18 04:04:22 UTC
Created attachment 30521 [details]
output of devkit-disks --dump
Comment 3 Michael Hofmann 2009-10-18 04:08:55 UTC
Created attachment 30522 [details]
output of lvmdump
Comment 4 Martin Pitt 2009-10-22 15:13:01 UTC
This is in fact just a corollary of dk-disks handling lvm/dm/md devices itself in the rules, instead of having dmsetup/mdadm etc. ship their own rules. These rules are currently being introduced upstream, but didn't trickle through all the distros yet.

This was recently discussed at length in this Debian bug: http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=545032#56

Upstream lvm2 fixed that a while ago in its udev rules:
http://sourceware.org/ml/lvm2-cvs/2009-08/msg00018.html

+ENV{DM_LV_NAME}=="?*_mlog", GOTO="lvm_end"
+ENV{DM_LV_NAME}=="?*_mimage_[0-9]*", GOTO="lvm_end"
Comment 5 David Zeuthen (not reading bugmail) 2009-10-23 07:35:14 UTC
(In reply to comment #4)
> This is in fact just a corollary of dk-disks handling lvm/dm/md devices itself
> in the rules, instead of having dmsetup/mdadm etc. ship their own rules. These
> rules are currently being introduced upstream, but didn't trickle through all
> the distros yet.
> 
> This was recently discussed at length in this Debian bug:
> http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=545032#56
> 
> Upstream lvm2 fixed that a while ago in its udev rules:
> http://sourceware.org/ml/lvm2-cvs/2009-08/msg00018.html

Just FYI, the Fedora lvm2 packages omit these udev rules. It conflicted with dracut or anaconda or something so they decided to pull it. To add insult to injury, keep in mind that the Fedora lvm2 package maintainers practically are the upstream lvm2 maintainers. So they're not eating their own dog food. To say that I'm happy with the lvm2 maintainers would be a lie.

So I guess we have to ship our own crap in DKD for a while more.

> 
> +ENV{DM_LV_NAME}=="?*_mlog", GOTO="lvm_end"
> +ENV{DM_LV_NAME}=="?*_mimage_[0-9]*", GOTO="lvm_end"
> 

Comment 6 David Zeuthen (not reading bugmail) 2009-10-23 07:45:51 UTC
(In reply to comment #0)
> Created an attachment (id=30519) [details]
> output of ls -lR /sys
> 
> I have a LVM setup, with one LV in mirrored mode (RAID1) spread over 2 PVs. For
> such a setup, 3 more DM devices are generated: VG-LV_mimage_0, VG-LV_mimage_1
> und VG-LV_mlog. These devices do *not* respresent real LVs, and shouldn't be
> included in dk-disks.

Maybe if these three devices don't represent anything useful, then LVM2 shouldn't expose them as block devices?

But, yes, we need to add proper LVM2 support to DeviceKit-disks / Palimpsest in the same way that we have proper MD (Linux Software RAID) support. This includes untangling the mess that the LVM2 guys like to add an additional three block devices to confuse users. Anyway, that's bug 24672 and I guess we can close either as a duplicate of the other. This bug contains more information so I'm tempted to close bug 24672 as a dupe of this bug.

> 
> $ sudo lvs
>   LV   VG     Attr   LSize   Origin Snap%  Move Log
>   home ubuntu mwi-ao 465.76G                    home_mlog
>   root ubuntu -wi-ao  10.00G
>   swap ubuntu -wi-ao   4.00G
> 
> $ sudo lvs -a
>   LV              VG     Attr   LSize   Origin Snap%  Move Log
>   home            ubuntu mwi-ao 465.76G                    home_mlog
>   [home_mimage_0] ubuntu iwi-ao 465.76G
>   [home_mimage_1] ubuntu iwi-ao 465.76G
>   [home_mlog]     ubuntu lwi-ao   4.00M
>   root            ubuntu -wi-ao  10.00G
>   swap            ubuntu -wi-ao   4.00G
> 
> To reproduce, create an LVM setup with at least 2 PVs, and change a LV to
> mirrored mode with "sudo lvconvert -m 1 VG/LV".
> 

Comment 7 David Zeuthen (not reading bugmail) 2009-10-23 07:46:34 UTC
Going to use this bug for implementing proper LVM2 support. Adjusting title as needed.
Comment 8 David Zeuthen (not reading bugmail) 2009-10-23 07:47:46 UTC
*** Bug 24672 has been marked as a duplicate of this bug. ***
Comment 9 Martin Pitt 2009-10-30 09:39:08 UTC
> Upstream lvm2 fixed that a while ago in its udev rules:
> http://sourceware.org/ml/lvm2-cvs/2009-08/msg00018.html

> +ENV{DM_LV_NAME}=="?*_mlog", GOTO="lvm_end"
> +ENV{DM_LV_NAME}=="?*_mimage_[0-9]*", GOTO="lvm_end"

FYI, I just added some basic LVM test cases (single LV/no RAID, and single LV/RAID-1) to the test suite (see bug 24446). This checks the "presentation hide" flag as well, so without the patch above (or the equivalent that was applied in Ubuntu), it fails:

======================================================================
FAIL: LVM: Single LV, RAID-1
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/home/martin/dk-disks-test.py", line 1032, in test_single_lv_raid
    o != real_lv_obj)
AssertionError: dbus.Boolean(False, variant_level=1) != True

(that's the DevicePresentationHide property).

So regardless how distros ship their udev rules right now, they can use this to test that they have a correct setup which probes the LVs and hides the shadow image LVs.
Comment 10 Martin Pitt 2009-11-03 14:50:48 UTC
Ah, please ignore my previous comment. I just noticed that PRESENTATION_HIDE does not hide a device from palimpsest. OTOH the devices were never actually shown in GNOME since that checks for usage "filesystem". So I changed the test suite to just ensure that mirror images have an emty usage.
Comment 11 Martin Pitt 2009-11-03 14:51:16 UTC
That said, _should_ palimpsest show devices which have "presentation hide"?
Comment 12 David Zeuthen (not reading bugmail) 2012-09-28 15:10:06 UTC
For udisks 2.0 we don't do LVM stuff any more and we even changed the default to off in the udisks1 branch and the udisks 1.0.4 release for these reasons

 http://cgit.freedesktop.org/udisks/commit/?h=udisks1&id=99de237eed6a026597e9b045527631c42ab86968

Closing as WONTFIX as there are no immediate plans to add this.


Use of freedesktop.org services, including Bugzilla, is subject to our Code of Conduct. How we collect and use information is described in our Privacy Policy.