[Yaird-devel] Re: evms first try

Erik van Konijnenburg ekonijn at xs4all.nl
Thu Dec 1 23:36:28 UTC 2005


Hi,

Thanks for testing.

On Thu, Dec 01, 2005 at 12:25:01PM +0100, Marco Amadori wrote:
> I tried latest bzr yaird on my system, here is the relevant part of yaird -t :
> 
> yaird error: Don't know how to choose between /dev/evms/boot 
> and /dev/mapper/boot for dm-3 (fatal)

You probably have evms and lvm2 installed on a single box?

On a combination of evms/mdadm/lvm the /dev/mapper/boot does not show
up on my test box, but we should count on the clash occuring in real systems.

> and here it is the relevant code in perl/ActiveBlockDev.pm :
> 
> for my $p (@{$paths}) {
>                         if ($p =~ m!^/dev/mapper/([^/]*)$!
>                                 ||$p =~ m!^/dev/evms/.*$!)
>                         {
>                                 if (defined ($match)) {
>                                         Base::fatal ("Don't know how to choose 
> between $match and $p for $na
> me");
>                                 }
>                                 $match = $p;
>                         }
>                 }
> 
> I think choosing  /dev/evms/boot over  /dev/mapper/boot will be fine, right ?

It's not as simple as that.   This is happens in yspecial, where we cook up
a pathname in /dev that will be used for mounting.

Mostly, we need to mknod that device, then mount, so we can pick anything we
want as long as its unique and its the same on mount and mknod.

It matters for dm devices: there the tool that creates the major/minor in the
kernel (dmsetup, vgchange, cryptsetup, evms_activate, ...) also creates the block
device file in /dev, and we don't get to pick the name that will be used for
the device file.

Thus yspecial attempts to predict the name that will be chosen for dm devices
by tools like evms and vgchange.  As long as there's only one of /dev/evms/boot
and /dev/mapper/boot, that's a good indication that the same name will be
used by the tool that makes it to the initramfs.  If both exist, we have a 
cant-happen condition, and no real reason to assume one or the other name
will be correct.  Perhaps user has been installing/uninstalling packages
and some unused device files are left over?

A more reliable way might be to look at the tool that will be used to activate
the device: evms_activate uses /dev/evms, the rest uses /dev/mapper.  In order
to make that work, we would have to annotate the active block device in tryEvms
and friends, then use that annotation in yspecial.

Regards,
Erik





More information about the Yaird-devel mailing list