LVM 2.02.53 has been released on Sep 26th. Updated patches are attached as well as a patch for the ebuild. I have tested everything on two different machines and things worked smoothly. In contrast to 2.02.51 which had its own share of problems (see below) like dmeventd crashing on me from time to time while handling snapshots. Please note: I have changed the udev rules handling. With the current version in portage (2.02.51), there is a race condition between udev and lvm which is easily reproducible: Create a snapshot of a logical volume and try to delete it again. Usually 7 out of 10 tries will fail to delete the snapshot wrongfully reporting that the device is currently in use/open. This is directly related to the installed udev rule. So the ebuild is now changed to install the LVM supplied udev rules which work without any problems for me on my private system and on a company server I administrate. Please consider this change. If there is anything else, please let me know. Reproducible: Always
Created attachment 206004 [details, diff] ebuild diff: 2.02.51-r1 -> 2.02.53 - adds installation of LVM udev rules - removes pvcreate patch (no longer necessary) - removes Gentoo specific device mapper export patch which is no longer required because the LVM supplied udev rules are installed
Created attachment 206006 [details, diff] updated as-needed patch
Created attachment 206008 [details, diff] updated lvm.conf patch
Created attachment 206011 [details, diff] updated selinux/pkgconfig patch
If I may ask, have those patches been pushed upstream yet? IMHO they are the right thing to do (TM) so upstream would profit from it and maintaining the ebuild would get a bit less time-consuming.
Well I did some build fixes last week so you building in a different directory from the source should work now. I'll check through these patches to see if there's anything else we can take. As for 'lvm1' being the default format, that certainly needs changing upstream now!
We DO need the device-mapper-export-format.patch. It's not only used by the udev rules. It's popular with the dmcrypt users as well. Please add it back (and it's one of the patches I'd asked agk to include before, but never heard back on).
I'll have a look at the export patch later today or tomorrow. Nevertheless, I still strongly believe "we" should nevertheless use the LVM supplied udev rules. They work fine and if there are any issues, those can be fixed and pushed upstream as well.
Created attachment 206076 [details, diff] ebuild diff: 2.02.51-r1 -> 2.02.53 + included device mapper export patch again + used today's portage ebuild (keywords changed)
Created attachment 206077 [details, diff] updated device mapper export format patch + identical to the original patch, just re-diffed against 2.02.53 w/ minor modification + tested and works like 2.02.51 w/ patch
So - the default has been "lvm2" format for a long time. It's the text in example.conf that was wrong and I've now corrected. I've merged the libdevmapper.pc.in selinux patch.
Part of the export patch can go upstream (some of the fields, not the 'export' option), yes, for completeness. With the new udev rules, we get what we currently need from sysfs and the prefix on the UUID (which cryptsetup now uses). We're also going to add some flags so the software (e.g. cryptsetup) causing the udev events can pass requests (like 'don't create a node for this device') directly into the udev rules.
And I've pulled in the bulk of the Makefile changes. Together with the previous upsteam changes, see if this is enough to fix the builds or whether there are still some bits I missed.
agk: I've emailed you a spin of some missed bits from as-needed. Plus a respin of the --export patch and a discussion about it, unless sysfs gets a lot more data about the DM table, it's not going to work for all the udev rules (eg there's already one that used DM_TARGET_TYPES to control a symlink).
Closing since we have 2.02.56 in the tree now. I did report export and one more libdm patch.
Sorry, but for me this bug still exists: I can't remove LVM snapshots when udevd is running. I don't know exactly, which update stopped this from working but apparently it happend around Fall 2009. My current versions are: sys-fs/lvm2-2.02.56-r2 sys-fs/udev-149 Let me know if i can provide further information. BTW: Couldn't reopen and i'm also not sure, wether it's better to open a new ticket instead. So please advise if this doesn't belong here. Thanks!