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

Re: preseeding/partman-auto: LVM expert recipe problem



On Tue, Oct 25, 2011 at 6:49 AM, Thorsten Sperber <lists@aero2k.de> wrote:
>
> I have a problem regarding the partman-auto/expert-recipe. I have this
> minimal recipe (very minimal, not really useful at all except to prove this
> bug) and it calculates 2200000100 MB (and a lot more in my original recipe).
>
> : Oct 25 10:25:49 partman-auto: Available disk space (31457) too small for
> expert recipe (2200000100); skipping
>
> 31457 is the ~30GB sized virtual hard disk I use for testing.
>
> I hope this is fixable, since it is part of the stable installer.
>
> mini recipe here:
>
> <code>
> d-i partman-auto/disk string /dev/sda
> d-i partman-auto/method string lvm
> d-i partman-auto/purge_lvm_from_device boolean true
> d-i partman-lvm/confirm boolean true
> d-i partman-lvm/device_remove_lvm boolean true
> d-i partman-auto-lvm/new_vg_name string SBS_PV
> # d-i partman-lvm/vgcreate string SBS_PV
> d-i partman-auto/expert_recipe string                   \
>        boot-root::                                     \
>                100 1000 100 ext3                 \
>                        $primary{ }                     \
>                        $bootable{ }                    \
>                        method{ format }                \
>                        format{ }               \
>                        use_filesystem{ }               \
>                        filesystem{ ext3 }              \
>                        mountpoint{ /boot }             \
>                .                                       \
>                                                        \
>                                                        \
>                100 1000 100 ext3                      \
>                        $lvmok{ }                       \
>                        method{ format }                \
>                        format{ }               \
>                        use-filesystem{ }               \
>                        filesystem{ ext3 }              \
>                        mountpoint{ / }                 \
>               .
> </code>
>
> My desired recipe contains an explicitly declared PV, some more LV with more
> defined stuff and follows all the rules I found in the
> debian-installer:$doc/debian-installer/devel files (which could really need
> some more examples and rules description),
>
> The basic problem is the wrong calculation of the minimum size. I already
> tried it with different priorities to see their effect on the result, but no
> change.

(You don't need the "\" within the recipes)

Can the installer's partitioning algorithm really do that?!

>From "partman-auto-recipe.txt":

6. HOW THE ACTUAL PARTITION SIZES ARE COMPUTED
----------------------------------------------

Suppose we have to create N partitions and min[i], max[i] and
priority[i] are the minimal size, the maximal size and the priority of
the partition #i as described in section 1.

Let free_space be the size of the free space to partition.

Then do the following:

for(i=1;i<=N;i++) {
   factor[i] = priority[i] - min[i];
}
ready = FALSE;
while (! ready) {
   minsum = min[1] + min[2] + ... + min[N];
   factsum = factor[1] + factor[2] + ... + factor[N];
   ready = TRUE;
   for(i=1;i<=N;i++) {
      x = min[i] + (free_space - minsum) * factor[i] / factsum;
      if (x > max[i])
         x = max[i];
      if (x != min[i]) {
         ready = FALSE;
         min[i] = x;
      }
   }
}

Then min[i] will be the size of partition #i.


7. APPENDIX
-----------

On May 25th 2004, it was noted that on i386 systems, the very minimum size of
a Debian installation on a classical (/, /usr, /usr, /home) setup was:
48MB on / (6MB on /boot)
77MB on /usr
17MB on /var
It is thus wise to use minimum values with this consideration in mind.

#261244: 70MB are required for /var
#265290: 1.8GB are not enough for / with desktop


Reply to: