Skip to content

Commit 68cea42

Browse files
Marketenclaude
andcommitted
Point grub-installer at the target disk, not the installer USB
The preseed sets grub-installer/bootdev to "default", which also marks the question as seen. grub-installer then takes this path: db_fget grub-installer/bootdev seen if [ "$RET" = true ] && db_get grub-installer/bootdev && [ "$RET" ]; then if [ "$RET" = "default" ]; then bootdev=$default_bootdev $default_bootdev is the first grub-mkdevicemap entry -- (hd0), the installer USB itself. The safeguard against installing onto the installation media only runs in the *:grub-pc branch, so nothing protects a UEFI install. The EFI install still succeeds, because grub-install writes to the ESP on the real disk, but the step then exits 1 reading the ISO9660 partition table: grub-installer: info: Installing grub on '/dev/sda' grub-installer: info: grub-install ran successfully main-menu: (process:10646): Can't read partition table from /dev/sda main-menu: WARNING **: Configuring 'grub-installer' failed with error code 1 Reuse the non-USB disk list already computed for partman. Verified by a local QEMU UEFI USB install of the Debian 13.5.0 unattended ISO, which now completes the installer in ~4 minutes instead of stalling on the failure dialog. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
1 parent b5b6d12 commit 68cea42

1 file changed

Lines changed: 11 additions & 1 deletion

File tree

‎scripts/check-disks.sh‎

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,4 +12,14 @@ for DISK in ${DEVICE}; do
1212
DISKS="${DISKS} ${DISK}";
1313
done;
1414
DISKS=$(echo "${DISKS}" | sed "s/^ //g");
15-
debconf-set partman-auto/disk "$DISKS";
15+
debconf-set partman-auto/disk "$DISKS";
16+
17+
# grub-installer/bootdev is preseeded to "default", which marks the question as
18+
# already seen. grub-installer then resolves "default" to the first entry of
19+
# grub-mkdevicemap, i.e. (hd0) -- the installer USB itself. Its safeguard against
20+
# installing onto the installation media only runs for grub-pc, so on UEFI it
21+
# happily targets the stick and then dies reading its partition table:
22+
# Can't read partition table from /dev/sda
23+
# Point it at the same non-USB disks partman is using. grub-installer accepts a
24+
# space separated list and installs to each entry in turn.
25+
debconf-set grub-installer/bootdev "$DISKS";

0 commit comments

Comments
 (0)