The UUID format used by LVM

lvmuuid

Linux LVM assigns UUID values to physical and logical volumes but they aren't valid RFC4122 UUID strings. Here is an example:

  • 2185fe86-41d4-4311-9a47-8f0ebc7ecc5a RFC4122
  • AZdHpq-uENw-cRo2-t6jS-iQXu-nD2u-woW7RT LVM

The LVM format is longer and its representation uses non-hexadecimal characters and is hyphenated differently.

What's the rationale behind this variation and why use the term "UUID" when it isn't strictly a valid UUID per the specification ?

Perhaps the LVM format is another UUID standard format but I've been unable to find any references that suggest this.

Best Answer

They are a completely random 192-bit identifier (c.f. 128 bits for RFC4122 UUID) that is used by LVM to uniquely identify each of its various entities: volume group, physical volume, logical volume.

As described here, this is generated from /dev/urandom using the characters [a-zA-Z0-9]. Note that this provides for 5.808 bits per character. According to the LVM2 source code, because LVM1 UUIDs didn't support them, the two extra characters supported by the format ("!" and "#") are not used during UUID generation.

The probability of duplicates is exceedingly low by extrapolating from the calculations on the Universally unique identifier page on Wikipedia.

Related Question