0

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.

1 Answer 1

0

What you seem to be working towards is a live, bootable Debian image with persistence. Essentially, it is a full Linux installation on USB.

Since you already made a bootable Debian USB drive, you've learned most of what is needed. However, to enable persistence, an additional partition must be created. A summary from that site:

  1. Download the Debian ISO.
  2. Modify the ISO to use persistence.
  3. Put it on USB and boot from it.
  4. Create and format an additional partition for persistence.
  5. Create a mount point.

Note that additional drivers, e.g., audio and Bluetooth, may need to be installed after creating the persistent instance.

5
  • How to modify the Debian Live ISO to use persistence?
    – dokondr
    Commented Mar 19 at 17:26
  • 1
    See gist.github.com/chrisdiana/282b416986c4597d71812cba467bc1fd .It's a bit long. Commented Mar 19 at 17:32
  • Trying to make persistent bootable Debian image was the first thing I started with before installing it on usb. Unfortunately command: LANG=C sed 's/splash quiet/persistence /;s/quiet splash/persistence /' \ </debian-live-10.0.0-amd64-mate.iso \ >/debian-live-10.0.0-amd64-mate-persist.iso fails on MacOS Unix, and I currently have no Linux machine where it may work.
    – dokondr
    Commented Mar 19 at 18:57
  • 1
    Although a "live with persistence" is a viable solution it might not be the best. So, I disagree with the premise of this answer and I suggest you were on the right track but used the wrong method - it's a UEFI system (and it can't work any other way because Apple) so you must mount the ESP (it seems to have been correctly created - sdd1 - and then (re)install Grub): wiki.debian.org/GrubEFIReinstall (ignore the parts about LUKS, of course) I suspect you need only to add mount /dev/sdd1 /mnt/boot/efi and #4 (maybe). Commented Mar 20 at 8:46
  • Please see my updated question.
    – dokondr
    Commented Mar 20 at 13:55

You must log in to answer this question.

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