I'm currently trying to set up an unattended installation of Ubuntu 10.04 (Lucid Lynx) through preseeding. But whenever I try to create a custom partition scheme, the Debian installer (which Ubuntu is using) produces a faulty partition table.
I've taken the partition scheme described in the example preseed file:
d-i partman-auto/expert_recipe string \
boot-root :: \
40 50 100 ext3 \
$primary{ } $bootable{ } \
method{ format } format{ } \
use_filesystem{ } filesystem{ ext3 } \
mountpoint{ /boot } \
. \
500 10000 1000000000 ext3 \
method{ format } format{ } \
use_filesystem{ } filesystem{ ext3 } \
mountpoint{ / } \
. \
64 512 300% linux-swap \
method{ swap } format{ } \
.
Unfortunately it also produces an incorrect partition table on the disk. The installation process itself is working and the installed system eventually boots and is working, as far as I can tell. But fdisk
and cfdisk
are still complaining:
# fdisk -l /dev/sda
Disk /dev/sda: 17.2 GB, 17179869184 bytes
255 heads, 63 sectors/track, 2088 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk identifier: 0x000a1cdd
Device Boot Start End Blocks Id System
/dev/sda1 * 1 5 37888 83 Linux
Partition 1 does not end on cylinder boundary.
/dev/sda2 5 2089 16736257 5 Extended
/dev/sda5 5 2013 16121856 83 Linux
/dev/sda6 2013 2089 613376 82 Linux swap / Solaris
cfdisk
even refuses to start at all:
# cfdisk /dev/sda
FATAL ERROR: Bad primary partition 1: Partition ends in the final partial cylinder
parted
on the other hand does not complain about the cylinder boundary of /dev/sda1
:
# parted /dev/sda p
Model: VMware Virtual disk (scsi)
Disk /dev/sda: 17.2GB
Sector size (logical/physical): 512B/512B
Partition Table: msdos
Number Start End Size Type File system Flags
1 1049kB 39.8MB 38.8MB primary ext4 boot
2 40.9MB 17.2GB 17.1GB extended
5 40.9MB 16.5GB 16.5GB logical ext4
6 16.6GB 17.2GB 628MB logical linux-swap(v1)
Since the installed system is working, it shouldn't be a big problem but I'm afraid that this will mean trouble in the future.
It's probably a bug in the Debian installer of Ubuntu 10.04 since the version provided for Karmic Koala is working as expected and creates a correct partition table. I've filed a bug report on Launchpad on this issue.
Probably related to Bug #561573 and Bug #551965.
Appending
partman/alignment=cylinder
as kernel boot parameter solved the problem for me.