By the way at 
"https://www.reddit.com/r/debian/comments/wfk4xt/debian_keeps_installing_bootloader_in_wrong_disk/";
 other people mention similar problems that are/could be related to this bug.



Jmkr



---------- Původní e-mail ----------
Od: Jmkr <jmkr...@email.cz>
Komu: 1034...@bugs.debian.org, pas...@plouf.fr.eu.org, k...@debian.org, 
deb...@jamesie.de, a...@hax0rbana.org
Datum: 9. 5. 2024 10:42:41
Předmět: Re: Bug#1034812: Unbootable after install: UEFI installed to wrong ESP
I had a similar problem with my customized Debian 10 installer. I have not 
customized PARTMAN related UDEB packages yet, so these are at Debian 10 
versions. What I did was I installed my Debian in one of my test laptops that 
also had another SSD with some Windows 11 installation that I plan to nuke 
later:). All was working and booting, but when I added ESP capacity monitoring 
to my CONKY configurations, I noticed that this laptop had different ESP space 
occupied than my other laptops with the same hardware. After checking what is 
going on I found that:

- The ESP created by me during manual disk partitioning on the SSD that is used 
for my Debian system was empty and not used at all (not mounted at "/boot/efi" 
and not mentioned in "/etc/fstab").

- Instead the ESP from the other SSD with the Windows 11 installation was used. 
It was mounted at "/boot/efi", its UUID was in "/etc/fstab" and DI/GRUB 
installed the "EFI/debian/grubx64.efi" file there right next to the "Microsoft" 
and "Boot" directories that contained the Windows garbage.

Thankfully I did not boot that Windows 11 installation, so Windows were not 
able to mess around with the Debian files that rudely appeared on "their" disk. 
I was able to (hopefully) fix the situation when I noticed it:

- I archived "/boot/efi/EFI/debian/grubx64.efi" from "/dev/sda1" to 
"/Archive.tar".

- Then, I unmounted "/dev/sda1" from "/boot/efi" and mounted "/dev/sdb1" to 
"/boot/efi" and extracted "/Archive.tar" in "/boot/efi" again.

- Later I changed UUID of ESP in "/etc/fstab" file to that of ESP on 
"/dev/sdb1".

- Finally using EFIBOOTMGR I deleted the EFI boot entry my system used and 
created a new entry for ESP on "/dev/sdb1".

- Then, I tested that the system boots as before using the new EFI and FSTAB 
entries and correct ESP.

Did I forget something (that will cause problems in the future) by not 
reinstalling GRUB or some other stuff?

Do the fixes mentioned above also address the manual partitioning case? If not 
perhaps you could check that case also. I will keep the Windows 11 installation 
(as this laptop is for testing anyway) = if you want I could test the fixed 
PARTMAN files, if these are provided so that my script for customizing the 
Debian Netinst ISO can include them (after I modify it to extract a new PARTMAN 
TAR or copy new PARTMAN files directly to the extracted Debian Netinst ISO). 
(In the future I plan to learn how to create DI ISO from scratch to be able to 
include modified UDEB packages etc. => if that is needed for testing and you 
can provide some starting instructions for me I could try that also.)

Regards,
Jmkr

Reply via email to