[linux-lvm] LVM PV UUID problem

Mark H. Wood mwood at iupui.edu
Fri Oct 9 15:39:24 UTC 2020


On Fri, Oct 09, 2020 at 11:18:38AM -0400, Digimer wrote:
> On 2020-10-09 10:43 a.m., Zdenek Kabelac wrote:
> > Dne 09. 10. 20 v 15:12 Digimer napsal(a):
> >> Hi all,
> >>
> >>    I'm storing LVM information in a postgres database, and wanted to use
> >> the UUID from the PVs / VGs / LVs as the UUIDs in the database. I
> >> noticed when I tried to do this that postgres complained that the UUID
> >> was not valid. I checked with an online UUID validator
> >> (https://www.freecodeformat.com/validate-uuid-guid.php) and it also
> >> reported as invalid.
> >>
> >> Example;
> >>
> >> ====
> >> # pvdisplay | grep UUID
> >>    PV UUID               jLkli2-dEXx-5Y8n-pYlw-nCcy-9dFL-3B6jU3
> >> ====
> >>
> >>    Is this a known issue?
> >>
> > 
> > Hi
> > 
> > At the time of lvm2 devel I believe UUID was just a unique identifier,
> > later some effort to standardize it came in.
> > 
> > But really you should NOT be using basically internal unique identifiers
> > in your DB - this are internal to DM/LVM work and might be changed at
> > any time to something else.
> > 
> > User is supposed to use  'vgname' & 'lvname'  - so there you can put those
> > valid UUID sequences - although human readable strings are always nicer ;)
> > 
> > Zdenek
> 
> The trick is that VG and LV names can change, so I wanted to use the
> (so-called) UUID as a way to keep track of a given item through name
> changes.
> 
> I suppose I'll have to rework to use the internal "UUIDs" as more like
> serial numbers instead...

Well, if we are stuck with non-standard "UUID"s, at least they are
meant to be Universally Unique, so they can be treated as unique
opaque string tokens.  Or you might find a library function that can
return the unencoded binary value and you can encode it as you please.
However, the issue of persistence remains.

FWIW I think it's quite reasonable for someone to want immutable
unique identifiers for distinct objects such as LVM PVs, especially
when the "unique identifier" part is already available and quite
visible.

-- 
Mark H. Wood
Lead Technology Analyst

University Library
Indiana University - Purdue University Indianapolis
755 W. Michigan Street
Indianapolis, IN 46202
317-274-0749
www.ulib.iupui.edu
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 195 bytes
Desc: not available
URL: <http://listman.redhat.com/archives/linux-lvm/attachments/20201009/56b392b2/attachment.sig>


More information about the linux-lvm mailing list