I run Debian Testing on a Dell Latitude E5450.
I created a USB environment with debootstrap
following the instructions posted here, and here. As per those instructions (and others), I mounted my running /dev/{pts}
, /proc
and /sys
inside the appropriate directory, installed the lattest kernel, systemd
and the lot. The last step is to configure GRUB by first installing it on the EFI partition of my USB stick (formated to FAT32 and with a boot flag) from inside the chroot
environment (with the appropriate parameters such as the EFI directory), and then running update-grub
; again, and I cannot stress this enough, I ran this command from inside the chroot
environment of the system created via debootstrap
.
The problem with that is that it detects my running system on dev/sda2
, which is my main partition. So when I try to boot this USB using virt-manager
, nothing happens; my laptop doesn't detect it as a bootable device when I go to the "One-time boot menu" (pressing F12 while the Dell logo is displaying), so I enter the setup and set the grubx64.efi
inside the USB stick as a boot option, then reboot. Upon doing that, unsurprisingly, it wants to boot the kernel in my laptop, not the one in the USB drive.
This is what happens:
# grub-install --boot-directory=/boot/ --efi-directory=/boot/efi --recheck --removable /dev/sdb1
Installing for x86_64-efi platform.
Installation finished. No error reported.
# update-grub
Generating grub configuration file ...
Found linux image: /boot/vmlinuz-5.10.0-3-amd64
Found initrd image: /boot/initrd.img-5.10.0-3-amd64
Found Debian GNU/Linux bullseye/sid on /dev/sda2
done
This is the grub.cfg
file I get. In line 106 I do see a menu entry with the kernel in the USB, but this doesn't show up when trying to boot from it; again, the one-time boot menu doesn't recognise the first partition (FAT fs, EFI) as a bootable device. If I don't mount the /dev
directory into the tree with the new environment, I cannot run grub-install
(this makes a lot of sense, but I thought it was worth mentioning).
I don't know what to do because Google doesn't return anything useful, other than more instructions on how to do everything I already did. Firstly, it is very frustrating not to have my USB EFI partition recognised by the boot menu. Secondly, I would really like to know what command, with what parameters, and with what directories mounted inside the chroot
tree I have to run in order for GRUB to recognise the kernel inside the USB stick, not the one in my laptop.
Below are screencaps of how the USB sticks show in GParted and in fdisk
.
lsblk
doesn't return that, and the entries infstab
are the devices IDs. Thanks! :)fdisk -l
output saysDisklabel type: gpt
and it indicates the type as "EFI System", which is a human-friendly name of that type GUID I mentioned. Note that GParted indicates flagsboot, esp
: on GPT partitioning, those both always appear together as GParted only has "flags" to identify the various partition types, which is a bit poor fit for GPT partitioning.