#1110425 debian-installer installs GRUB to wrong disk (internal EFI instead of target USB) causing boot issues

Package:
debian-installer
Source:
debian-installer
Description:
Debian Installer documentation
Submitter:
smallbussiness
Date:
2025-08-06 06:23:03 UTC
Severity:
normal
Tags:
#1110425#5
Date:
2025-08-05 08:49:15 UTC
From:
To:
Dear Maintainer,

I encountered a significant issue while installing Debian using the
debian-installer. When installing Debian on a USB drive intended to be a
fully portable OS (with its own bootloader), the installer silently
installed or updated the GRUB bootloader on my laptop’s internal EFI
partition, even though the target root filesystem and EFI partition were on
the USB drive.

This behavior causes the internal system to become unbootable unless the
USB stick is plugged in, as the system firmware is directed to the USB's
GRUB configuration. If the USB is removed, the system fails to boot with
the error: “No bootable device found.”


Steps to reproduce:

1. Install Debian normally on an internal disk (e.g., /dev/sda).
2. Later, install Debian again, targeting a USB stick (e.g., /dev/sdb),
intending for the USB to be fully independent.
3. During the installation, the installer does not prompt clearly for GRUB
target.
4. After install, the laptop's GRUB was modified and now relies on the USB.
5. Boot fails when the USB is not plugged in.


Expected behavior:

- The installer should default to installing GRUB to the EFI partition of
the selected target disk, or at the very least, it should prompt clearly
for the GRUB installation target (especially in multi-disk setups).
- It should not modify the bootloader on unrelated disks (such as the
internal EFI when the user is targeting a USB install).


Actual behavior:

- GRUB was written to the internal EFI, and the GRUB configuration points
to the USB root filesystem.
- Internal system became unbootable without USB inserted.
- There was no clear warning or choice to avoid this behavior during
installation.


System details:

- Debian version: Debian GNU/Linux 12 (bookworm)
- kernal: Linux debian 6.1.0-35-amd64 Debian 6.1.137-1 x86_64
- USB drive: 128GB Sandisk
- System: UEFI-enabled laptop, legacy-enabled


This issue lead to boot failure, data loss, and a confusion user experience.


Thanks for maintaining Debian.

Best regards,
Deadlooks

#1110425#10
Date:
2025-08-06 05:14:04 UTC
From:
To:
Hello,

Am 5. August 2025 10:49:15 MESZ schrieb smallbussiness <smallbussiness007@gmail.com>:

There were significant changes in this regard in Trixie, so you could try, if it works better for you with a beta image of Debian 13 (Trixie RC 3):

<https://www.debian.org/devel/debian-installer/>


Holger

#1110425#15
Date:
2025-08-06 05:15:51 UTC
From:
To:
Control: reassign -1 grub-installer
#1110425#22
Date:
2025-08-06 06:19:58 UTC
From:
To:
grub-installer does not choose GRUB location, it installs the boot
loader in the EFI partition which was chosen and mounted during
partitioning. If multiple EFI partitions were set "Use as: EFI system
partition", then partman-efi chooses the "first" one (in its own
internal order) regardless of the root filesystem location.

Which partitioning method did you use ? Guided using an entire disk,
guided using the largest free space, manual ? If you use manual
partitioning, you must make sure to disable all othe EFI partitions.
Guided methods should disable all other EFI partitions so only the one
on the selected disk should be used. There was a bug (fixed for trixie)
in guided partitioning with LVM but I doubt you used LVM on a USB drive.