mirror of
https://github.com/xcat2/confluent.git
synced 2026-11-19 08:52:20 +00:00
e021d29afc
When the largest filesystem of a captured image is a plain partition, it was sized as the disk minus the other filesystems. That ignored the 2048 sector gap before the first partition and the rounding of every partition up to a 2048 sector boundary, so the last partition always ran past the end of the disk. The clamp then set its end to the sector count, one past the last sector and inside the backup GPT, and parted refused it with 'The location ... is outside of the device'. Images with the largest filesystem in LVM were not affected. Reserve that overhead plus 1MiB at the end of the disk for the backup GPT, and clamp to that last sector instead. Also round the swap partition by its own size rather than by the previous partition's.