My goal is to install Debian to be bootable from a usb stick on a MacBook with two usb ports. To do so I booted from Debian Live flash on the first usb port. Next I used to Debian installer to install Debian on the second USB port. Installation completed with a message that Debian was successfully installed. Yet Debian does not boot from the usb where it was installed by installer.
Live system partitions:
Device: /dev/sdc1, Boot: *, Size: 3.2G, Id:0, Type: Empty
Device: /dev/sdc2, Boot: , Size: 5M, Id:ef, Type: EFI (FAT-12/16/32)
Partitions of the usb where installer installed Debian:
Device: /dev/sdd1, Boot: , Size: 99M, Id:c, Type: W95 FAT32 (LBA)
Device: /dev/sdd2, Boot: , Size: 14.5G, Id:83, Type: Linux
After booting MacBook from the Debian Live USB stick, I try to reinstall bootloader on the second USB stick with:
sudo mount /dev/sdd2 /mnt
sudo mount --bind /dev /mnt/dev
sudo mount --bind /proc /mnt/proc
sudo mount --bind /sys /mnt/sys
sudo chroot /mnt
grub-install /dev/sdd
update-grub
And grub-install /dev/sdd
returns:
Installing for x86_64-efi platform.
grub-install error: cannot find EFI directory
Any ideas how to make it boot?
Update
As suggested by ChanganAuto, I have added sudo mount /dev/sdd1 /mnt/boot/efi
. Now it looks like grub-install
works:
user@debian:~$ sudo mount /dev/sdd1 /mnt/boot/efi
user@debian:~$ sudo chroot /mnt
root@debian:/# grub-install /dev/sdd
Installing for x86_64-efi platform.
grub-install: warning: EFI variables are not supported on this system..
Installation finished. No error reported.
Not sure about update-grub
, though:
root@debian:/# update-grub
Generating grub configuration file ...
Found background image: /usr/share/images/desktop-base/desktop-grub.png
Found linux image: /boot/vmlinuz-6.1.0-18-amd64
Found initrd image: /boot/initrd.img-6.1.0-18-amd64
Warning: os-prober will be executed to detect other bootable partitions.
Its output will be used to detect bootable binaries on them and create new boot entries.
grub-probe: error: cannot find a GRUB drive for /dev/sdb1. Check your device.map.
Add yet usb still does not boot.