Preseed Ubuntu / Debian - Partitioning: prevent "Partition 1 does not start on physical sector boundary."

Preseeding of Ubuntu / Debian works correct - system is bootable.

But fdisk -l is resulting following:

Disk /dev/sda: 50 GiB, 53687091200 bytes, 104857600 sectors
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 4096 bytes
I/O size (minimum/optimal): 4096 bytes / 4096 bytes
Disklabel type: dos
Disk identifier: 0x000e157a

Device     Boot    Start       End  Sectors   Size Id Type
/dev/sda1             63    192779   192717  94.1M 83 Linux
/dev/sda2  *      192780   1172744   979965 478.5M 83 Linux
/dev/sda3        1172745  96470324 95297580  45.5G 83 Linux
/dev/sda4       96470325 104856254  8385930     4G 82 Linux swap / Solaris

Partition 1 does not start on physical sector boundary.
Partition 2 does not start on physical sector boundary.
Partition 3 does not start on physical sector boundary.
Partition 4 does not start on physical sector boundary.

My current partitioning parameters in the preseed are:

d-i partman-lvm/device_remove_lvm                   boolean true
d-i partman-auto/purge_lvm_from_device              boolean true
d-i partman-md/device_remove_md                     boolean true
d-i partman-lvm/confirm                             boolean true
d-i partman/alignment                               select cylinder
d-i partman/confirm                                 boolean true
d-i partman-basicfilesystems/no_swap                  boolean false
d-i partman-partitioning/confirm_write_new_label    boolean true
d-i partman/choose_partition                        select finish
d-i partman/confirm_nooverwrite                     boolean true
d-i grub-installer/only_debian                      boolean true
d-i grub-installer/bootdev                                      string /dev/sda
d-i partman-auto/disk                               string /dev/sda
d-i partman-auto/method                             string regular
d-i partman-auto/expert_recipe string                         \
      boot-root ::                                            \
              100 50 100 free                                 \
                          $gptonly{ }                         \
                          $primary{ }                         \
                          $bios_boot{ }                       \
                          method{ biosgrub }                  \
              .                                               \
              500 50 500 ext2                                 \
                      $primary{ } $bootable{ }                \
                      method{ format } format{ }              \
                      use_filesystem{ } filesystem{ ext2 }    \
                      mountpoint{ /boot }                     \
              .                                               \
              500 10000 1000000000 ext4                       \
                      $primary{ }                             \
                      method{ format } format{ }              \
                      use_filesystem{ } filesystem{ ext4 }    \
                      mountpoint{ / }                         \
              .                                               \
              200% 500 200% linux-swap                        \
                      $primary{ }                             \
                      method{ swap } format{ }                \
              .

How to avoid the Partition {n} does not start on physical sector boundary error. How to set the correct starting sector and sector size in partman while preseeding?


Change your d-i partman/alignment parameter to optimal instead of cylinder. This should fix the issue.