Installed fedora on USB, now grub is gone and I cant boot into Fedora

Hi I need you guys help. I have fedora installed with windows 11 as dual boot on my internal ssd. (Fedora is luks encrypted btw)

I now wanted to install fedora on a usb stick with persistent storage. (To try some stuff.) So I created USB drive A and installed fedora live on it. Then I booted from it and put in my second usb drive B into my laptop. After that I started the installer and installed Fedora on USB drive B.

But somehow it messed up my bootloader. Now I cannot boot into fedora, only Windows. When the USB B is plugged in, I get to the grub screen, with the only options are to boot into Fedora installed on USB drive B and Windows boot manager. but when it is not plugged in, I instantly boot to Windows.

Even booting from the boot menu and selecting fedora only gives me a short black screen and throws me back to the boot menu.

I tried to fix this with Claude Ai, but nothing worked. Disabling secure boot also didnt work.

I guess I have to reinstall grub or the bootloader completely? I dont know what to do.

Perhaps a VM would be safer for that.

But somehow it messed up my bootloader.

Please try the bootloader restoration docs.

Thanks. I will try that and come back to you.

I would like to know if those docs work. I had a similar issue when installing f44 (to test) alongside my f43. Grub doesn’t work properly with two fedora installations and I couldn’t find any understandable guide to reinstall grub with a btrfs partitioning as fedora does by default nowadays.
A solution, if the docs don’t work, is to boot a live iso and reinstall the system remembering to choose the option to not format home.

I have a hunch that the bootloader is actually still intact, and Anaconda just removed the EFI NVRAM entry when installing the second Fedora onto the USB.

If so, then it just needs an efibootmgr command to fix things up.

But following the instructions in the docs should also ensure that the NVRAM entry gets rewritten.

Let’s see what OP comes back with.

From experience recommending them to users here, in general yes they do work.

Hey, so I got back from work and tried the guide. Everything went fine but sadly it couldn’t help me.

This is my partitions:

Can you also show the output of efibootmgr ?

Here :slight_smile:

Interesting, so there’s definitely only one Fedora there. Maybe that’s the “USB” Fedora and not the one on your fixed disk.

One more command please. (Ideally copy and paste the text rather than photos.)

blkid /dev/nvme0n1p1

If that doesn’t give output, try it with sudo (that’s needed on a normal install but possibly not on the live ISO).

Of course.

liveuser@localhost-live:~$ sudo blkid /dev/nvme0n1p1 /dev/nvme0n1p1: UUID=“D05D-5777” BLOCK_SIZE=“512” TYPE=“vfat” PARTLABEL=“EFI System Partition” PARTUUID=“61e81dd0-0fbf-4c1a-938f-18365e878569”
liveuser@localhost-live:~$

Cool. So, if everything was as it should be, then efibootmgr would have shown a Fedora entry for that 61e81dd... ID. But it only has a Fedora entry for a09291... which is presumably your persistent USB install.

Let’s mount the EFI partition, and check the Fedora bootloader files are still there:

mkdir -p ~/mnt/boot/efi
sudo mount /dev/nvme0n1p1 ~/mnt/boot/efi
ls ~/mnt/boot/efi/EFI/Fedora

liveuser@localhost-live:~$ ls ~/mnt/boot/efi/EFI/Fedora
BOOTIA32.CSV BOOTX64.CSV gcdia32.efi gcdx64.efi grub.cfg grubia32.efi grubx64.efi mmia32.efi mmx64.efi shim.efi shimia32.efi shimx64.efi
liveuser@localhost-live:~$

Looking good! One more check before we do the fix - let’s check that grub.cfg points to the Fedora boot partition on your disk:

cat ~/mnt/boot/efi/EFI/Fedora/grub.cfg

It should be a short output, probably 4 lines, and we want to check the long ID in the first line.

liveuser@localhost-live:~$ cat ~/mnt/boot/efi/EFI/Fedora/grub.cfg

search --no-floppy --root-dev-only --fs-uuid --set=dev 6556c85e-d65b-4b64-b8dd-5113c502c7a6
set prefix=($dev)/grub2
export $prefix
configfile $prefix/grub.cfg

liveuser@localhost-live:~$

Perfect, so it points to that 65556c... partition, which looks like the right boot partition based on your lsblk output.

It looks then like the bootloader is OK, and we just need to add it to the list of boot entries that the BIOS offers to you:

efibootmgr --create --index 0002 --disk /dev/nvme0n1 --part 1 --loader \\EFI\\fedora\\shimx64.efi --label "Fedora (main disk)"

Then run efibootmgr again and show the output - if all went well, we should have a new entry at Boot0002.

Do i run this command from chroot /mnt (like on the guide) or directly from the terminal of the live usb?

Directly from the terminal of the live USB is fine.

Thanks. I get the following error though:
“EFI variables are not supported on this system.”

Shouldnt this part maybe be different? “/dev/nvme0n1p1” and not “/dev/nvme0n1”

Hmmm - does efibootmgr by itself work OK? (Looks like it did from your earlier screenshot.)

No - the --part 1 is how we express the p1.