[dm-devel] Differentiating between dm devices

Milan Broz mbroz at redhat.com
Thu Mar 24 08:32:25 UTC 2011


On 03/24/2011 08:23 AM, Hannes Reinecke wrote:

> That is the approach I've been following for SUSE.
> The UUID is assumed to be of this syntax:
> 
> <type>-<identifier>

There were several discussions, I think even unofficial definition
tries but nobody documented that properly.

So thanks for opening this here, it should be formalized (Alasdair?).

What I remember from discussions:

- all devices should set DM-UUID (not required still though)
(btw available now in sysfs /sys/block/dm-X/dm/uuid in udev db,
no need to use dm-ioctl)

- everything is supposed to set a prefix to identify subsystem (owner)

- DM-UUID can contain multiple namespaces

- first part (prefix) says which the second part belongs to

(e.g. CRYPT-PLAIN-blabla - CRYPT is says it was cryptsetup namespace,
it is up subsystem to handle content, here we can parse crypt device
type from it it for example.)

- you can stack it (like partition/kpartx over other subsystem)
(problem of prefix separator, now we will get
probably something like part1-CRYPT-LUKS-00000000...)

- kpartx uses prefix in format (part%N- where
N is part number - my opinion it is bug but that up to discussion.
My suggestion is to use KPARTX-part%N*)

- some uses lowercase here

- there is limit of 128 characters for DM-UUID
(so stacking should handle this somehow)

To my knowledge, these prefixes are in the wild:

LVM- (lvm2)
DMRAID- (dmraid)
CRYPT- (cryptsetup)
mpath- (multipath)
part%N- (kpartx)

Milan




More information about the dm-devel mailing list