#1108515 partman: Unable to create partition on free space of MMC storage (mmcblk0)

#1108515#5
Date:
2025-06-30 09:59:59 UTC
From:
To:
Dear Maintainer,

I am experiencing an issue with the Debian 
installer’s partitioning tool (partman) when
attempting to install on an MMC storage 
device (mmcblk0, MMC DG4064 63.6GB). The tool
fails to detect or utilize the available free
space for partition creation, even though the
free space is correctly recognized by other 
tools (e.g., Ubuntu installer, fdisk).

Hardware: MediaTek Genio 1200-EVK
Device: MMC #1 (mmcblk0) - MMC DG4064: 63.6 GB
Symptoms:
Guided partitioning fails with:
Unable to satisfy all constraints on the partition.
Manual partitioning shows the free space, but attempts to create a new
partition (of any size, at beginning or end) fail with the same error.

Details:

The disk contains several small partitions (bootloaders,
firmware, ESP, etc.), followed by a large free space (~63.4 GB).
The installer correctly lists the free space, but cannot
create a new partition in it.
This issue does not occur on Ubuntu’s installer, which can
partition the free space without issue.

Steps to reproduce:

Boot Debian installer on a system with an MMC device with a similar
partition layout.
Attempt guided or manual partitioning using partman.
Observe that partition creation in the free space fails.

Relevant Screenshots/Logs:

A. Guided partition creation on free space
A.1
  x Guided - use the largest continuous free space
x

A.2
  x Selected for partitioning:
x
  x
x
  x MMC/SD card #1 (mmcblk0) - MMC DG4064: 63.4 GB (63.6 GB)
x

A.3
  x        All files in one partition (recommended for new users)
x

A.4
  lqqqqqqqqqlqqqqqqqqqqqqqqu [!!] Partition disks
tqqqqqqqqqqqqqqqkqqqqqqqqqk
  x         x                                                     x
x
  x         x                      ERROR!!!                       x
x
  x         x Unable to satisfy all constraints on the partition. x
x
  x Computinx                                                     x
x
  x         x     <Go Back>                        <Continue>     x
x
  mqqqqqqqqqx                                                     x
qqqqqqqqj
            mqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqj

B. Manual partition creation on free space
B.1
  x          Manual                                             .
x
B.2
  x   MMC/SD card #1 (mmcblk0) - 63.6 GB MMC DG4064
-    x
  x   >     #1             4.2 MB                    bootloaders
a    x
  x   >     #2             4.2 MB                    bootloaders_
a    x
  x   >     #3            33.6 MB        fat16       firmware
0    x
  x   >     #4            33.6 MB        fat16       firmware_b
a    x
  x   >     #5           524.3 kB                    dramk
a    x
  x   >     #6             1.0 MB                    misc
a    x
  x   >     #7            33.6 MB        fat16       bootassets
a    x
  x   >     #8           104.9 MB     K  ESP         BOOT
.    x
  x   >                   63.4 GB        FREE SPACE
a    x
B.3
                x  Create a new partition                      x
B.4
   x The maximum size for this partition is 63.4 GB.
x

B.5
   x New partition size:
x
   x
x
   x 63.4
GB______________________________________________________________ x

B.6
   x New partition size:
x
   x
x
   x 50
GB________________________________________________________________ x

B.7
  x Location for the new partition:
x
  x
x
  x                              Beginning
x
  x                              End
x


C. Log found in installer
    Jan  1 00:23:34 partman:   No matching physical volumes found
    Jan  1 00:23:35 kernel: [  129.288184] GPT:Primary header thinks
Alt. header is not at the end of the disk.
    Jan  1 00:23:35 kernel: [  129.288199] GPT:420935 != 124190719
    Jan  1 00:23:35 kernel: [  129.288204] GPT:Alternate GPT header not
at the end of the disk.
    Jan  1 00:23:35 kernel: [  129.288207] GPT:420935 != 124190719
    Jan  1 00:23:35 kernel: [  129.288210] GPT: Use GNU Parted to
correct GPT errors.
    Jan  1 00:23:35 kernel: [  129.288232]  mmcblk0: p1 p2 p3 p4 p5 p6
p7 p8
    Jan  1 00:23:35 kernel: [  129.385261] GPT:Primary header thinks
Alt. header is not at the end of the disk.
    Jan  1 00:23:35 kernel: [  129.385270] GPT:420935 != 124190719
    Jan  1 00:23:35 kernel: [  129.385275] GPT:Alternate GPT header not
at the end of the disk.
    Jan  1 00:23:35 kernel: [  129.385277] GPT:420935 != 124190719
    Jan  1 00:23:35 kernel: [  129.385279] GPT: Use GNU Parted to
correct GPT errors.
    Jan  1 00:23:35 kernel: [  129.385295]  mmcblk0: p1 p2 p3 p4 p5 p6
p7 p8

Expected behavior:
 * partman should allow creation of a new partition in the available
free space.
   Reference and expected result: fdisk on Ubuntu liveCD

   root@ubuntu-server:/# fdisk /dev/mmcblk0

   Welcome to fdisk (util-linux 2.40.2).
   Changes will remain in memory only, until you decide to write them.
   Be careful before using the write command.

   GPT PMBR size mismatch (420935 != 124190719) will be corrected by
write.

   The backup GPT table is not on the end of the device. This problem
will be corrected by write.

   Command (m for help): p

   Disk /dev/mmcblk0: 59.22 GiB, 63585648640 bytes, 124190720 sectors
   Units: sectors of 1 * 512 = 512 bytes
   Sector size (logical/physical): 512 bytes / 512 bytes
   I/O size (minimum/optimal): 512 bytes / 512 bytes
   Disklabel type: gpt
   Disk identifier: 480266F3-BD5E-420A-9EA3-6AC1252808FB

   Device          Start    End Sectors  Size Type
   /dev/mmcblk0p1     34   8225    8192    4M Linux filesystem
      /dev/mmcblk0p2   8226  16417    8192    4M Linux filesystem
      /dev/mmcblk0p3  16418  81953   65536   32M unknown
   /dev/mmcblk0p4  81954 147489   65536   32M unknown
   /dev/mmcblk0p5 147490 148513    1024  512K Linux filesystem
   /dev/mmcblk0p6 148514 150561    2048    1M Linux filesystem
   /dev/mmcblk0p7 150562 216097   65536   32M Linux filesystem
   /dev/mmcblk0p8 216098 420897  204800  100M EFI System

   Command (m for help): n
   Partition number (9-128, default 9):
   First sector (420898-124190686, default 421888):
   Last sector, +/-sectors or +/-size{K,M,G,T,P} (421888-124190686,
default 124188671):

   Created a new partition 9 of type 'Linux filesystem' and of size 59
GiB.

Actual behavior:
partman fails with a constraint error, regardless of partition size or
location.

Thanks for your help
Macpaul Lin

#1108515#10
Date:
2026-02-13 07:06:12 UTC
From:
To:
Since bug #1109090 has been solved I could continue debug on this
issue.

Storage devices detected by "parted_devices":

/dev/sda        30784094208      USB  SanDisk 3.2Gen1   msdos
/dev/mmcblk0    62537072640     MMC 064GB2      gpt
/dev/mmcblk0boot0       8388608 Generic SD/MMC Storage Card     unknown
/dev/mmcblk0boot1       8388608 Generic SD/MMC Storage Card     unknown

Here is the log in /var/log/partman when option "Guided - use the
largest continuous free space" is selected:


/usr/lib/partman/display.d/10initial_auto:
*************************************
******************
/usr/lib/partman/automatically_partition/20biggest_free/choices:
***************
****************************************
/usr/lib/partman/automatically_partition/20biggest_free/choices: IN:
PARTITIONS
=dev=mmcblk0
parted_server: Read command: PARTITIONS
parted_server: command_partitions()
parted_server: Opening outfifo
parted_server: OUT: OK
...
parted_server: OUT: 1   17408-4211711   4194304 primary unknown
/dev/mmcblk0p1
bootloaders
parted_server: OUT: 2   4211712-8406015 4194304 primary unknown
/dev/mmcblk0p2
bootloaders_b
...
parted_server: OUT: 7   77087744-110642175      33554432        primary
fat16
/dev/mmcblk0p7  bootassets
parted_server: OUT: 8   110642176-215499775     104857600       primary
fat16
/dev/mmcblk0p8  BOOT
parted_server: OUT: -1  215499776-62537055743   62321555968     primary
free
/dev/mmcblk0p-1
...
parted_server: Opening infifo
/usr/lib/partman/automatically_partition/20biggest_free/choices: IN:
PARTITIONS
=dev=sda
parted_server: Read command: PARTITIONS
parted_server: command_partitions()
parted_server: Opening outfifo
parted_server: OUT: OK
parted_server: OUT: 1   1048576-30784077823     30783029248     primary
fat32
/dev/sda1

parted_server: Partitions printed
parted_server: OUT:
parted_server: Closing infifo and outfifo
parted_server: main_loop: iteration 442
parted_server: Opening infifo
/usr/lib/partman/automatically_partition/50some_device/choices:
****************
***************************************

Best regards,
Macpaul Lin

#1108515#15
Date:
2026-02-26 17:14:34 UTC
From:
To:
After investigating each partition offset, size, and some part of the
source code in partman-auto and partman-base, I've noticed there is a
kernel error message in /var/log/syslog just once.

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

Then I've realized this is because of the bootstarp firmware of eMMC or
UFS only embedded system is usually smaller then the full size of the
storage. Which means there is no NOR or NAND storage as the first boot
strap storage on these boards. Hence the backup GPT header will be
pointed to some place where the firmware exactly ends instead of the
end of the storage. This causes partman reported error dialog and
refuse to create a new partition.

However, there is no such limitation on Ubuntu and openSuse installers.
I'm not sure how the partition manager on openSuse fix the backup GPT,
but I'm pretty sure there is sgdisk in Ubuntu installer. I could use
the command 'sgdisk -e /dev/mmcblk0' to move backup GPT to the end of
the eMMC storage with Ubuntu installer, reboot the device with debian
installer, then use partman to create the new partition with the rest
of free space. There is no more issue. The installation gose very
smoothly.

Hence I guess the solution is to add a fix process during the installer
just like Ubuntu and openSuse. No matter it is fixed manually or
automatically.

Is there any reference for creating an new issue for adding new tool
(ex: sgdisk) into debian installer? Then the current issue could be
closed.

Best regards,
Macpaul Lin