[linux-lvm] logical volume usage type code, equivalent to GPT partition type GUID

David Teigland teigland at redhat.com
Wed Nov 3 20:15:32 UTC 2021

On Wed, Nov 03, 2021 at 01:44:33PM -0400, Chris Murphy wrote:
> Hi,
> I'm wondering to what degree the current LVM metadata format(s) can
> support additional or even arbitrary metadata.
> The UEFI spec defines the GPT, and GPT defines a "partition type GUID"
> for each partition to define it's usage/purpose, in rather open ended
> fashion. I'm wondering about an equivalent for this with LVM, whether
> it's useful and how difficult it would be to implement. This is all
> very hypothetical right now, so a high level discussion is preferred.
> The starting point is the Discoverable Partitions Spec:
> http://systemd.io/DISCOVERABLE_PARTITIONS/
> Where GPT partition type codes are used to discover file systems, and
> their intended use without having to explicitly place them into
> /etc/fstab for startup time discovery and mounting. But LVM doesn't
> have an equivalent for exposing such a capability, because it implies
> many volumes within the larger pool and also the pool might comprise
> many devices.

I'd been curious about this since reading that page.  It would be nice if
it provided a way to better integrate lvm activation with the broader

It seems like adding GPT info to disks, plus using predefined LV names, is
an alternative to setting rd.lvm.lv on the command line.  i.e. the OS will
activate a predefined root LV name from disks that are flagged (using GPT)
to be used for the purpose of the root LV.  Is that the idea?

In terms of lvm metadata, the set of disks used by the root LV is kept in
the lvm metadata, and that info would need to be kept in sync with the GPT
info on those same disks.  e.g. the lvm metadata says LV /dev/rootvg/root
uses sda and sdb, so the GPT info on sda and sdb also needs to reflect
that they are used for a root LV.  When the disks in the root LV change,
e.g. lvextend, then GPT info would also need updating.  I suppose this
just requires some integration between tools (unless the user is supposed
to be responsible for keeping things in sync.)

A similar kind of integration between lvm and dracut would let us improve
lvm activation in the initramfs.  There's not an obviously clean way to
update the initramfs from lvextend, so it's not been done.

I'll wait with other questions until I know if I've understood the basic


More information about the linux-lvm mailing list