We've determined this to be due to using disks with mixed sector sizes (i.e. different physical and logical sector sizes). The mentioned patch [0] enables lvmlockd to create shared leases in mixed sector sized disks, but additional support is needed in sanlock for these to work correctly.
The required sanlock patches are: * d5e4def0d087 - sanlock: add flags to specify sector size [1] * 445e86700fa3 - configurable sector size and align size [2] If we don't have these additional sanlock patches, sanlock isn't able to find the written leases due to alignment issues and ultimately those are handled as invalid. Unfortunately, both sanlock patches are extensive and change a lot of low-level internal structures, so providing them as SRU updates would be prone to backporting errors and regressions. Since both lvm2 and sanlock are working as expected with non-mixed sector sizes, and the current versions actively prevent leases to be written to mixed sector disks, we can consider that things are working correctly. Support for mixed sector sizes should be considered a "feature" instead, which is available starting with the versions below: - lvm2: 2.03.10 - sanlock: 3.8.0 These versions are available in Ubuntu releases starting with Hirsute, and have been provided as backports in focal-backports and groovy- backports. Please refer to bug #1929432 and bug #1928708 for further details on the -backports versions. [0] https://sourceware.org/git/?p=lvm2.git;a=commitdiff;h=2d1fe38d84d4 [1] https://pagure.io/sanlock/c/d5e4def0d087 [2] https://pagure.io/sanlock/c/445e86700fa3 ** Changed in: lvm2 (Ubuntu Focal) Status: Confirmed => Won't Fix ** Changed in: lvm2 (Ubuntu Groovy) Status: Confirmed => Won't Fix -- You received this bug notification because you are a member of Ubuntu Touch seeded packages, which is subscribed to lvm2 in Ubuntu. https://bugs.launchpad.net/bugs/1920047 Title: sanlock global lock creation fail Status in lvm2 package in Ubuntu: Fix Released Status in lvm2 source package in Focal: Won't Fix Status in lvm2 source package in Groovy: Won't Fix Bug description: Hello, Running Ubuntu server 20.04, I cannot create a shared VG using sanlock : # vgcreate --shared foo /dev/mapper/vol Enabling sanlock global lock Skipping global lock: lockspace not found or started Logical volume "lvmlock" created. VG foo init failed: -28 Failed to initialize lock args for lock type sanlock Volume group "foo" successfully removed Messages in /var/log/syslog lvmlockd[446807]: 1616089866 WARNING: mixed block sizes physical 4096 logical 512 (using 4096) for /dev/mapper/foo-lvmlock lvmlockd[446807]: 1616089866 S lvm_foo init_vg_san write_resource gl error -28 /dev/mapper/foo-lvmlock # lsb_release -rd Description: Ubuntu 20.04.2 LTS Release: 20.04 # dpkg -l | grep lvm ii liblvm2cmd2.03:amd64 2.03.07-1ubuntu1 amd64 LVM2 command library ii lvm2 2.03.07-1ubuntu1 amd64 Linux Logical Volume Manager ii lvm2-lockd 2.03.07-1ubuntu1 amd64 LVM locking daemon A similar bug report from RHEL8 : https://bugzilla.redhat.com/show_bug.cgi?id=1833837 Bug has been fixed upstream : https://sourceware.org/git/?p=lvm2.git;a=commit;h=2d1fe38d84d499011d13ae1ea11535398528fc87 It seems to be included in version 2.03.10 : https://sourceware.org/git/?p=lvm2.git;a=shortlog;h=refs/tags/v2_03_10 How can we get this patch included in Ubuntu 20.04 ? King Regards, Charles To manage notifications about this bug go to: https://bugs.launchpad.net/ubuntu/+source/lvm2/+bug/1920047/+subscriptions -- Mailing list: https://launchpad.net/~touch-packages Post to : touch-packages@lists.launchpad.net Unsubscribe : https://launchpad.net/~touch-packages More help : https://help.launchpad.net/ListHelp