- Package:
- partman-auto-raid
- Source:
- partman-auto-raid
- Submitter:
- Colin Watson
- Date:
- 2015-09-03 19:39:12 UTC
- Severity:
- wishlist
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,
ENOPATCH. :-) The concept sounds good to me. It might be applicable to other parts of partman, too. Max
Gah. One of these days I'll make my mailer automatically whine at me if I do that. Really attached now.
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
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.