0

I setup debian 9 for a friend of mine. Now I got the laptop back and no bootable media is found on start.

I booted from the usb drive I installed from using the live mode and followed these steps: https://wiki.debian.org/GrubEFIReinstall which led me to here: https://help.ubuntu.com/community/Grub2/Installing#via_ChRoot

When I execute 12 grub-install /dev/sdb I get

Installing for x86_64-efi platform.
error: cannot find EFI directory.

On sdb1 I got /EFI/debian/grubx64.efi On sdb2 I got /proc /sys /run etc.

I'm not sure if sdb1 is my boot-partition or not - I tried both skipping/executing 8 sudo mount /dev/sdXY /mnt/boot.

I used sdb2 for all other sdXY-commands.

When I execute 13 update-grub I get lots of mkdir: cannot create directory '/var/lib/os-prober/mount': No such file or directory.

How do I recreate the bootloader?

4
  • What is the output of lsblk?
    – fpmurphy
    Feb 19, 2019 at 1:56
  • loop0 -> 2G (live), sda (hdd)->sda1 931.5G , sdb (ssd, system)->sdb1 512M, sdb2 19.8G, sdb3 6.9G, sdb4 6.9G, sdb5 1.2G, sdb6 76.5G, sdc -> sdc1 (live) 2.2G, sdc2 416K
    – UNeverNo
    Feb 20, 2019 at 19:18
  • sdb1 is probably the ESP (EFI System Partition). You can confirm by checking the partition GUID; it should be C12A7328-F81F-11D2-BA4B-00A0C93EC93B
    – fpmurphy
    Feb 21, 2019 at 0:37
  • Yes, it is the EFI-Partition. However I wasn't able to recreate it manually. Boot-repair with separate live-cd didn't work for me close all package managers - but I had none open, so I ended up using Rescatux: supergrubdisk.org
    – UNeverNo
    Feb 21, 2019 at 9:34

1 Answer 1

1

If sdb1 contains /EFI/debian/grubx64.efi, then that is very likely the EFI system partition, and Debian expects it to be already mounted at /boot/efi when things like update-grub are executed, so that the full path to the Debian bootloader would be /boot/efi/EFI/debian/grubx64.efi.

Depending on choices made at installation time, Debian can have both /boot and /boot/efi as separate filesystems at the same time. In that case, /boot/efi will contain just the <mountpoint>/EFI/debian/grubx64.efi, and /boot/grub (i.e. the <mountpoint>/grub directory on the boot filesystem) will contain grub.cfg, the x86_64-efi directory for GRUB modules, and other parts of GRUB.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .