feedback sought on mdadm (Debian) sarge->etch upgrade strategy

martin f krafft madduck at debian.org
Mon Aug 14 22:27:17 UTC 2006


also sprach martin f krafft <madduck at madduck.net> [2006.08.14.2253 +0100]:
>    If, however, mdadm creates a /dev/md/X node, udev will then
>    create /dev/mdX, and this confuses the hell out of mdadm later,

To make a long story short, mdadm now knows two superblock versions:
0 and 1. Basically, the source of the problem is that these two use
different algorithms to determine the device name to use. See:

  http://neil.brown.name/git?p=mdadm;a=blob;hb=HEAD;f=super0.c#l228
  http://neil.brown.name/git?p=mdadm;a=blob;hb=HEAD;f=super1.c#l321

The brief_examine_super[01] functions determine the name. While
version-1 superblocks hard-code the name to be used, version-0
superblocks determine it from the super-minor field. They will use
/dev/md/<super-minor> if /dev/md<super-minor> does not exist, and
/dev/md<super-minor> if the device node is already present.

I am not so worried about version-1 right now (even though I don't
like the hardcoding aspect), since all Debian sarge systems have
version-0 superblocks (version-1 was introduced with mdadm 2.5,
sarge has version 1.9). Thus, the systems may use /dev/mdX or
/dev/md/X, and those could be referenced in LVM metadata,
/etc/crypttab, or /etc/fstab (and probably others). Thus, I should
make sure that the array is started and the expected device node
present by the time they are used (by LVM/dm-crypt/whatever).

The "solution" right now is that mdadm creates a /dev/mdX ->
/dev/md/X symlink if the device is assembled as /dev/md/X, and
/dev/mdX otherwise.

Obviously, this is bad because mdadm must thus know about block
device major/minor numbers, which it should not have to. The right
way would IMHO be if mdadm just told the kernel to create a device
e.g. /dev/md6 and assemble the array according to information passed
to it. A preliminary such interface exists, but only *after* the md
devices have been created, otherwise /sys/block/mdX does not exist.

So it's all a big catch-22 and I am not sure how to best handle it.
Thus, I'd be happy to hear your input!

-- 
 .''`.     martin f. krafft <madduck at debian.org>
: :'  :    proud Debian developer and author: http://debiansystem.info
`. `'`
  `-  Debian - when you have better things to do than fixing a system
 
"arguments are extremely vulgar,
 for everyone in good society
 holds exactly the same opinion."
                                                        -- oscar wilde
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: Digital signature (GPG/PGP)
Url : http://lists.alioth.debian.org/pipermail/pkg-mdadm-devel/attachments/20060814/6da23ee5/attachment.pgp


More information about the pkg-mdadm-devel mailing list