Lost EFI entry in boot menu after removing and re-connecting drive

Problem: Qubes OS entry disappeared from the boot menu.

I had installed Qubes concurrent with a Windows 10 installation and another Linux and the boot menu listed all 3. Everything worked fine. But one day I took out the drive, put in another and booted from that, and then put the original drive back in. From then on, the boot menu only had Windows and the other Linux, but Qubes OS had mysteriously disappeared. No software was installed during this time.

I was able to follow the ‘Installation finished but “Qubes” boot option is missing and xen.cfg is empty’ troubleshooting instructions to recreate a Qubes entry.

But I’m puzzled as to what could make the entry disappear in the first place and what can be done to prevent it?

I am facing the same issue since past weeks, I have not able to figure out the what is causing the problem but I did find the solution.

Boot into the installation media, Go to shell

efibootmgr -v

if the qubesOS entry is missing add it manually

efibootmgr -v -c -u -L QubesOS -l /EFI/qubes/grubx64.efi -d /dev/sdd2 -p 1 #grubx64.efi for  qubes R4.1, xen.efi for Qubes R4.0 Sdd is the drive and p 1 is the partition no

Reboot, You will find the boot entry for qubes.

source

Edit : I think the it’s the motherboard firmware causing this particular issue, Please update your motherboard bios firmware to latest and disable C state option.

1 Like

Yeah, the efibootmgr command usage is described in “UEFI troubleshooting” and it does add the boot entry.

You may be on the right path as to the cause. My HP BIOS doesn’t label them as C-states.

I also wonder if BIOS “Dynamic Runtime Scanning of Boot Block” could cause this.

I am also facing a very similar issue. I installed the Qubes v4.0.4 on a usb drive. it was working fine but i plugged it in my second laptop and tried to boot from this usb drive after disabling the secure boot. It didn’t work. Finally after getting tired I plugged it back into the old laptop just to find that it isn’t even booting in that now.

Now I have my data in vault and personal qubes but I am completely stuck as I am not able to boot it. Could someone help please? In the reply above I could should “boot into the installation media and and go to shell” but how do I boot it if it is not bootable and how to go to shell?

can you explain this?

I mean on a portable flash drive so that I may plug it into any PC and may boot using it.

is that your qubes installation or qubes installer

the easiest is, boot into your qubes os installation medium, then choose rescue qubes os, wait until next step, choose proceed to shell, continue, then ```efibootmgr -v -c -u -L pastor -l (your efi files) -d (your boot drive) -p (which partition),

example :
efibootmgr -v -c -u -L pastor -l /EFI/qubes/grubx64.efi -d /dev/sdb -p 1

I don’t know where efi file is located in 4.0.4 but i think it’s in /EFI/qubes/xen.efi

this is the qubes installation not installer

Do you mean boot into installer medium or installation medium?

I understand that installer USB is the one that we use to install Qubes OS on external USB stick (i.e. to create the portable machine).

Before booting the device, I mounted both the installer as well as installation USBs in Ubuntu VM to see the content. I see that the EFI folder in installation USB is completely empty. There is no .efi file in the USB at all. Could it be be the reason why it is not booting up? (Note: In installer USB, I found the .efi file here: /EFI/BOOT/BOOTX64.efi)

By the way I tried to execute the command you mentioned in shell (Rescue Mode) but it gave the error that no linux partition could be found.

I think this time I need to accept the loss of data but I hope that I will find an easy way to backup and restore my data and settings from Qubes-OS as otherwise I might need to quit this OS completely till it becomes more user friendly (for non-technical users like me.)

By the way thanks for your support and response. Would be extremely thankful to you for some tips to backup/restore …

First, i want to say that this is not qubes issue.

Refering to this Copying the ISO onto the installation medium, then it’s installer medium as your glossary.

Good

I’ve said that first, you need to locate where your EFI file, Disk drive, and Partition.

try run to locate drive and partition :
lsblk
From my thought that you use automatic installer so it can be like this (again this is example):
/dev/sda1 600 MiB vfat
/dev/sda2 1000 MiB ext4
/dev/sda3 (the rest of usb drive) ext4

from above output your efi drive and partition is should be in /dev/sda1


locate efi files.

mount /boot /mnt
mount /boot/efi /mnt/efi
cd /mnt/efi/EFI/

Search in all folder here, and look for your efi files. In 4.1 it’s located in /mnt/efi/EFI/qubes/grubx64.efi, lets say that you found it in /mnt/efi/EFI/qubes/xen.efi.

Then you can create efi boot with :
efibootmgr -v -c -u -L pastor -l /EFI/qubes/xen.efi -d /dev/sda -p 1