[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: Bug#254727: partman-auto: reusing existing partitions with same method



On Wed, Apr 20, 2011 at 05:18:52PM +0100, Colin Watson wrote:
> I've been looking at http://bugs.debian.org/254727 ("Creates swap even
> when there is already one"), and also at
> https://bugs.launchpad.net/bugs/746313 ("partman should reuse existing
> BIOS Boot Partition") which has the same cause but has more serious
> consequences.
> 
> In general, I'm aware that partman doesn't have very good support for
> reusing existing partitions.  Much of the problem is in defining good
> recipe syntax for it: how do you name the partition you want to reuse?
> Partition numbers may be too specific for some users, not every
> partition has a UUID, etc.  However, in this case, I think we could
> define a simple abstraction: "if there's already a partition with this
> method, I want to reuse it", and encode that as a $reusemethod{ }
> internal specifier in partman recipes.
> 
> The implementation is a little tricky.  You have to exclude reused
> partitions from size calculations, but you also have to perform an
> action upon applying the recipe.  I found that it was easiest to
> transform $reusemethod{ } into $reuse{ ID } when decoding the recipe,
> and then deal with that when performing the recipe.
> 
> I've pushed an initial implementation of this here:
> 
>   http://git.debian.org/?p=d-i/partman-auto.git;a=shortlog;h=refs/heads/people/cjwatson/reusemethod
> 
> and the diff against master is attached.  (Of course, we'd also need to
> add $reusemethod{ } to a bunch of recipe stanzas.)  What do people
> think of this?

What if the other OS using a swap partition is currently suspended
to disk?  Can you share the swap partition in that case?  Sounds rather
unsafe in some cases.

Of course this doesn't mean you can't let people share them, but doing
it by default would seem hazardous.

-- 
Len Sorensen


Reply to: