#543786 partman-auto-raid: having to name devices explicitly is clumsy

#543786#5
Date:
2009-08-26 22:09:47 UTC
From:
To:
partman-auto-raid/recipe currently has to be set like this:

d-i partman-auto-raid/recipe string \
  1 2 0 ext3 / /dev/sda1#/dev/sdb1 . \
  1 2 0 swap / /dev/sda5#/dev/sdb5 .

These device names would normally be expected to correspond to
partitions that are the result of running normal autopartitioning based
on partman-auto/expert_recipe or similar. I think that in general this
is clumsy and hard to manage. In particular, if you're generating
preseed files from some other format (e.g. kickseed) then it's
tremendously difficult to work out in advance what the partition numbers
are going to be in any portable way, without duplicating logic such as
that to choose default disk labels, due to the split between primary and
logical partitions; but even if you are in a position to work this out
by hand it is a very clumsy way to go about it.

Attached is a patch which introduces new syntax, looking like this:

d-i partman-auto-raid/recipe string \
  1 2 0 ext3 / raidid=1 . \
  1 2 0 swap / raidid=2 .

You then put raidid{ 1 } and raidid{ 2 } (the IDs don't have to be
numbers; they just have to contain neither spaces nor slashes) for the
method{ raid } elements in your main autopartitioning recipe, and
partman-auto-raid works out automatically which devices it ought to use.

Any comments? I think this is a noticeable improvement, so I'll commit
it next week or so if there are no objections.

Thanks,

#543786#10
Date:
2009-08-28 12:53:56 UTC
From:
To:
ENOPATCH. :-)

The concept sounds good to me. It might be applicable to
other parts of partman, too.

	Max

#543786#15
Date:
2009-08-28 13:12:55 UTC
From:
To:
Gah. One of these days I'll make my mailer automatically whine at me if
I do that.

Really attached now.

#543786#20
Date:
2009-09-02 17:24:00 UTC
From:
To:
Hi Colin,

The change looks good to me, but note that I only read through
the patch and I haven't actually tested it.

Currently partman-auto-* are limited in how complex block
devices can be preseeded and combined. Single "depth" is no
problem, but stacking complex block devices gets tricky.

(Or brings with it a coupling of unrelated parts which may
not be necessary, e.g. partman-auto-crypto and LVM.)

Reading your patch, it seemed to me that raidid actually
does two things, even though only the first may be intended:
One, it provides a stable and easily accessible identifier.

Second, (here starts crazy): It expresses something which
could be considered a dependency.

It could be taken to mean: Make sure whatever device provides
ID "2" is setup before doing anything else implied by this
preseeded "partition".

Do you think the raidid could, usefully, be generalized to
something like "deviceid=" to allow for a future dependency-
based preseeding of complex block devices?

Or is that overengineering?

	Max

#543786#25
Date:
2015-09-03 19:26:57 UTC
From:
To:
I'd like to see this change included. It's been merged in Ubuntu since
forever and works very well.

It also makes it possible to transparently create a degraded array
when only one disk is available.

With excplicit device naming all devices must be available at install
time, or a different preseed.cfg must be used.