thoughts on mdadm and dev node creation

Neil Brown neilb at suse.de
Fri Aug 18 06:40:59 UTC 2006


On Monday August 14, madduck at madduck.net wrote:
> Neil,
> 
> Have you considered removing all knowledge of device major/minor
> numbers from mdadm userspace?
> 
> I imagine a solution where mdadm simply tells the kernel (via sysfs)
> to assemble device md1 from e.g. /dev/sd[abc]1, and the kernel then
> notifies udev to create the device (or, if udev is not used, just
> makes sure that the existing /dev/md1 then refers to the newly
> created array?

I have considered that approach.  I even have a patch to md lying
around that allows me to ask for devices to be created without having
to have the device node first.
I'm not convinced it is a good idea though.... but I'm not convinced
it isn't either.

> 
> This sort of interface would be much better IMHO, because
> 
>   (a) udev is becoming the standard

Yeh, mistakes happen :-)  (I'm just be facetious) 

>   (b) udev should thus create /dev nodes, and nothing else

I don't see that.

>   (c) mdadm via ioctl() requires a /dev node to assemble the array,
>       but udev only gets to find out about the array after it's
>       assembled, at which point the device node already exists. So
>       it's sort of a catch-22 situation.

So simply tell udev to ignore 'md' and let mdadm do all the creation.
I know - I suggested leaving creation of partition nodes to udev.  I'm
not convinced of that either.

Maybe I should sit squarely on the fence and allow you to choose. :-)
i.e. mdadm can create nodes for you, but won't if you don't want it
to.

But how would you ask it not do?  Maybe use a dev name without any
slashed.

   mdadm -C /dev/md0 -l5 -n4 -x1 /dev/sd[a-e]

Actually creates a device node - minor number 0

   mdadm -C md0 -l5 -n4 -x1 /dev/sd[a-e]

Doesn't create any device nodes.  They are left to udev.
Under the hood I would create /dev/..dont-ask as dev node and create
the device via that (unless some sysfs support was available).

But then you have to teach your users the different usage...
But why would you want to?

I cannot help this is a bit of a mountain/mole-hill problem created by
a desire to auto-configure everything for people.  If you just expect
people to put the names they want to use in mdadm.conf just like they
do in fstab, then I suspect half the problems would go away...


Does that help at all?

> 
> Do you have any thoughts on the matter? Please keep the mailing list
> on Cc.
> 
> Btw: can I get you to subscribe to
> http://lists.alioth.debian.org/mailman/listinfo/pkg-mdadm-devel
> so we could just have all discussions there?

I think you already did.  I am subscribed.  But if you have a specific
question for me, it is safer to Cc: me as well as send it to the list,
else I am less likely to see it quickly.

NeilBrown




More information about the pkg-mdadm-devel mailing list