Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 891821 - sys-fs/lvm2-2.03.17-r2: breakage with cached volumes when USE=lvm (-thin)
Summary: sys-fs/lvm2-2.03.17-r2: breakage with cached volumes when USE=lvm (-thin)
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Current packages (show other bugs)
Hardware: All Linux
: Normal normal (vote)
Assignee: Gentoo's Team for Core System packages
Depends on:
Reported: 2023-01-23 09:10 UTC by Fabian Groffen
Modified: 2023-04-09 16:34 UTC (History)
3 users (show)

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


Note You need to log in before you can comment on or make changes to this bug.
Description Fabian Groffen gentoo-dev 2023-01-23 09:10:33 UTC
After upgrading from sys-fs/lvm2-2.03.17-r1 to sys-fs/lvm2-2.03.17-r2

% qlist -IUv lvm2
sys-fs/lvm2-2.03.17-r2 lvm -lvm2create-initrd readline -sanlock -selinux -static -static-libs -systemd -thin -udev

all lvm tools are broken like this:

# lvs
  WARNING: Unrecognised segment type cache
  WARNING: Unrecognised segment type cache-pool
  LV sysvm/root_cache, segment 1 invalid: sets METADATA_FORMAT flag for cache-pool segment.
  Internal error: LV segments corrupted in root_cache.
  Cannot process volume group sysvm
  LV data/gentoo-rsync_cache, segment 1 invalid: sets METADATA_FORMAT flag for cache-pool segment.
  Internal error: LV segments corrupted in gentoo-rsync_cache.
  Cannot process volume group data

Reason for this is that the ebuild forces --with-cache=none when not USE="lvm thin".  I may not understand this why, but as far as I know I don't want thin volumes support, but do want cache support.

I've updated the ebuild's else case like so:

        myeconfargs+=( --with-thin=$(usex thin internal none)
                       --with-cache=$(usex lvm internal none) )

After recompiling this way, all lvm tools work again properly.

I'm not sure if cache and thin handling need to be pulled apart more, or if my suggested patch would be sufficient.  It would allow thin without lvm (cache), but it somehow doesn't feel sensical that cache is connected to lvm here.

Anyway, please allow cache support to be enabled without thin volume support.
Comment 1 Fabian Groffen gentoo-dev 2023-04-08 12:07:20 UTC
Can this please be looked at?  This just broke a system after the latest lvm2 update :(
Comment 2 Robin Johnson archtester Gentoo Infrastructure gentoo-dev Security 2023-04-08 21:08:25 UTC
The cache_* binaries are part of sys-block/thin-provisioning-tools;

Are you SURE you were using lvm2-2.03.17-r1.ebuild? 

I checked the history of that version, and the cache support is only there is you have USE=thin.

If you're saying that Thin & Cache work reliably without sys-block/thin-provisioning-tools being present, then let's change that everywhere, but it really surprises me.
Comment 3 Fabian Groffen gentoo-dev 2023-04-09 16:34:43 UTC
Yes I was running 2.03.17-r1, but this happened inbetween -r1 and -r2:

sys-fs/lvm2: disable LVM and thin by default

That triggered me to only enable USE=lvm, for I don't use thin-provisioning and it has the heavy deps via thin-provisioning-tools.

% qlist -Iv thin-provisioning-tools

I use SSD-cached volumes with HDDs, see lvmcache(7).  Without the cache module, lvm fails in many ways because it doesn't understand the cached volumes any more, claiming corruption etc, see first post.  I don't know how much this bloats the lvm binary, but in fact I don't think there's a real use-case why one wouldn't want cache=internal.

You don't need cache_* binaries, it's all in lvm AFAICT.