[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: Pls help fixing /boot/efi and GRUB



Thank you for the answer.

The problem was I accidentally removed the /boot folder, WHILE trying to back it up. So there were only OS folders and something was missing.

I figured out later that kernels are also stored in /boot and tried to reinstall the kernel manually, but ran into a number of minor problems.

Though I also found out that Timeshift keeps not only /root but also /boot folder (even if it is physically on the other disk)! Thanks Universe

So I just copied files from the timeshift /boot backup to the new ESP folder and GRUB showed the OS correctly.

There were also some minor problems which I solved with apt update/upgrade while being in chroot.

So, the problem is solved. At least it looks like that for now, as everything works fine i guess.

But i must mention that this passage from Debian Wiki seems incorrect

Bind mount various virtual filesystems:
# for i in /dev /dev/pts /proc /sys /sys/firmware/efi/efivars /run; do mount -B $i /mnt/$i; done

https://wiki.debian.org/GrubEFIReinstall#Using_the_rEFInd_rescue_media

I had to use


sudo mount --bind /dev /mnt/dev
sudo mount --bind /dev/pts /mnt/dev/pts
sudo mount --bind /sys /mnt/sys
sudo mount --bind /proc /mnt/proc
sudo mount --bind /sys/firmware/efi/efivars /mnt/sys/firmware/efi/efivars

And copy /etc/resolv.conf to mounted disk, to make the internet work under chroot.

I will try to suggest an update in the Debian Wiki, if it is possible for a newcomer there.




пт, 21 мар. 2025 г. в 05:58, Max Nikulin <manikulin@gmail.com>:
On 20/03/2025 03:22, J wrote:
>
> But before this oopsie deletion I have saved as a back-up at least
> something from /boot folder, or maybe even everything.

Copy files from backup to /boot and to the EFI system partition

EFI/debian/BOOTX64.CSV
EFI/debian/fbx64.efi
EFI/debian/grub.cfg
EFI/debian/grubx64.efi
EFI/debian/mmx64.efi
EFI/debian/shimx64.efi

Check if a boot entry pointing to \EFI\debian\shimx64.efi exists in UEFI
NVRAM

     efibootmgr -v

and create it otherwise. UEFI (BIOS) may have an option to boot from a
specified .efi file and it may be an alternative for recovery.

> 1) I have created a new ESP partition (on the other disc), so that to
> make it different from Windows boot drive. BTW, is it OK to have two
> partitions with ESP and boot flags..?

It depends on UEFI implementation. If you have separate disks for
Windows and for Debian then I find it reasonable to have independent EFI
partitions on each drive. Just ensure that the boot entry points to the
proper partition. As first step to boot installed Debian I would restore
EFI/debian to the existing partition.

Perhaps you may find some hints on the wiki page
https://wiki.debian.org/UEFI


Reply to: