#1129936 [embedded][aarch64] partman refuses to partition eMMC/UFS devices due to misplaced backup GPT; please help to include/use sgdisk to fix

Package:
gdisk
Source:
gdisk
Description:
GPT fdisk text-mode partitioning tool
Submitter:
Macpaul Lin
Date:
2026-03-06 09:03:02 UTC
Severity:
normal
#1129936#5
Date:
2026-03-06 08:45:50 UTC
From:
To:
Tags: feature-request

Dear Maintainers,

While attempting to install Debian on embedded systems utilizing eMMC
or UFS storage, the installer (partman) fails, throws an error dialog,
and refuses to create new partitions.
(reference issue:
https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=1108515)

Symptoms & Logs:
During the installation failure, /var/log/syslog shows the following
kernel error messages:
Jan 11 04:50:46 kernel: [  252.069353] GPT:420935 != 122142719
Jan 11 04:50:46 kernel: [  252.069357] GPT: Use GNU Parted to correct
GPT errors

Root Cause Analysis:
This issue occurs on embedded systems that rely entirely on eMMC or UFS
storage (i.e., boards without dedicated NOR/NAND flash for the
bootloader). On these devices, the factory-flashed bootstrap firmware
image is usually much smaller than the physical size of the storage
device.

Because the image is pre-compiled, the backup GPT header is located at
the end of the firmware image rather than at the physical end of the
storage device. When partman encounters this mismatch, it abruptly
aborts the partitioning process.

Workaround / Comparison:
Currently, the Ubuntu and openSUSE installers handle this scenario
gracefully.

By booting into the Ubuntu installer (which includes sgdisk), I can run
the following command to move the backup GPT header to the physical end
of the disk: sgdisk -e /dev/mmcblk0

After running this command, if I reboot into the Debian installer,
partman successfully recognizes the free space and proceeds to create
new partitions without any issues. The rest of the installation goes
very smoothly.

Suggested Solution:
Debian's installer currently lacks a mechanism to handle this common
embedded-system scenario. I propose that sgdisk (from the gdisk
package) be integrated into the Debian installer environment (with
udeb).

During the partitioning phase, if a GPT backup header mismatch is
detected, the installer should either:

Automatically run sgdisk -e to fix the header location.
Prompt the user with a dialog offering to automatically fix the GPT
errors (similar to how other modern installers handle it).
Or, at least remind user to run sgdisk fix it manually. :)

Thank you!

Best regards,
Macpaul Lin