1

I have a preseed configuration with specific requirements for disk layout, including partition sizes. partman-auto does not respect the maximum partition size for the last partition on the disk. https://wikitech.wikimedia.org/wiki/PartMan/Auto explains this along with a supposed workaround:

5. LIMITATIONS
--------------

Due to limitation of the algorithms in partman-auto, there must be at
least one partition with high maximal size so that the whole free
space can be used.  Usually you can give the partition containing
/home a maximal size 1000000000 which is high enough for the present
storage devices. If the large /home is not an option for you, you can
also define in the recipe one additional partition with size
1000000000, method "keep" and leave it unmounted.  When the
installation completes you can remove it.

Do not use higher than 1000000000 numbers because the shell arithmetic
is limited to 31 bits (on i386).

Unfortunately, nowhere in the documentation does it explain what is actually meant by "define in the recipe one additional partition with size 1000000000, method "keep" and leave it unmounted"

I have tried adding

1 1000000000 1000000000 ext4 \
    method { keep } \
.

to the end of my partition recipe, but this does absolutely nothing (I have also tried "none" and "linux" instead of "ext4," also to no effect) and am at a loss as to how to continue.

1 Answers1

2

The following partman recipe worked for me. I tried it with an install of Ubuntu 20.04

d-i partman-auto/expert_recipe string \
        efi-boot-root :: \
              256 256 256 fat32 \
                      method{ efi } \
                      format{ } \
              . \
              1024 1024 1024 ext4 \
                      $bootable{ } \
                      method{ format } \
                      format{ } \
                      use_filesystem{ } \
                      filesystem{ ext4 } \
                      mountpoint{ /boot } \
              . \
              8192 1024 8192 ext4 \
                      method{ format } \
                      format{ } \
                      use_filesystem{ } \
                      filesystem{ ext4 } \
                      mountpoint{ / } \
              . \
              8192 1024 1000000000 ext2 \
                      method{ keep } \
              .

I also had to add this setting to avoid a no filesystem is specified for partition prompt about the final partition.

d-i partman-basicmethods/method_only boolean false

This is the disk partitioning after installation. The "keep" partition filled the remaining space on the disk.

Number  Start   End     Size    File system  Name                  Flags
 1      1049kB  256MB   255MB   fat32        EFI System Partition  boot, esp
 2      256MB   1280MB  1024MB  ext4
 3      1280MB  9473MB  8193MB  ext4
 4      9473MB  21.5GB  12.0GB
Andrew Lowther
  • 291
  • 1
  • 4