Repair/Reinstall GRUB after Windows 11 Update (Dual Boot Fedora F39)

Dear Community,

Unfortunately, I am getting loss and have not found a solution that works. My problem is the following:

I use Windows 11 and Fedora 39 as Dual Boot. After the last windows/bios update, notebook starts directly in Windows. I can’t find a easy and workable solution to show GRUB on boot again.

No options in bios/uefi and also boot-repair-disk (boot-repair-disk download | SourceForge.net) don’t work. boot-repair-disk don’t shows the “Recommended Repair” button and also with advanced I see nothing. Maybe because my Fedora filesystem is btrfs??

Also when I boot into the UEFI boot menu, I only see the Windows Bootloader. No entry for Fedora.

So I need your help and kindly ask for an step-by-step tutorial to fix/repair/reinstall GRUB
(I can use the installed Windows 11 or the Fedora 39 Live CD)

Thank you so much.
Tom

2 Likes

can you still boot from bios to Fedora? if so this might fix the issue
sudo grub2-mkconfig -o /boot/grub2/grub.cfg

sometimes W11 did this to me and i still could boot to Fedora from bios and then fixing grub again worked

Hello Marko,
thats my problem: I found no solution to boot into Fedora. Entry is not available in UEFI Boot menu. I can only boot into Windows 11 or start Fedora from USB-Stick.

Is there a solution to fix this from Windows or with Fedora Live (USB-Stick)

Thank you
Tom

You can use a Fedora Live USB to chroot/systemd-nspawn into your broken Fedora and fix grub from there. Let me gather some instructions for you. I have old notes.

BRB

Windows supports hibernation, aka, “faststartup”. On a dual-boot system I sometimes have to disable fast startup after updating Windows 11.

Mount the Fedora Partition:

  • Once you’re in the Fedora Live environment, open a terminal.
  • Identify the partition where Fedora is installed. You can use the lsblk command to list all available block devices and their mount points.

Identify and Mount Partitions:

  • Once you’re in the Fedora Live environment, open a terminal.

  • Use the lsblk command to identify the partitions. Typically, you’ll have a separate boot partition (e.g., /dev/sda1) and the root partition (e.g., /dev/sda2 for Fedora).

  • Mount the root partition:
    sudo mount /dev/sda2 /mnt

  • Mount The Boot paritions:
    sudo mount /dev/sda1 /mnt/boot

  • Prepare the systemd-nspawn Environment:

  • sudo systemd-nspawn -D /mnt

  • Reinstall GRUB:

  • grub2-install /dev/sda

  • Update GRUB Configuration:

  • grub2-mkconfig -o /boot/grub2/grub.cfg

  • Exit the systemd-nspawn environment:

  • exit

  • Then, unmount the partitions:

  • sudo umount /mnt/boot /mnt

  • Safely reboot your system and remove the Fedora Live media.

You should see the GRUB menu allowing you to choose between Windows and Fedora. Test both entries to ensure they boot correctly.

If anything else, please let us know.

Your instructions are great for systems using MBR boot, but do not account for the changes from ext4 to btrfs and sub-volumes, nor do they account for use of UEFI.

Windows 11 only uses UEFI so the fedora install also uses UEFI and proper instructions must reflect that.

When in the live system first make certain that the internet connection is properly functioning.
Then to mount the root subvolume with a btrfs file system it would be necessary to identify the btrfs partition with lsblk -f then mount it as.

  1. su to enter the root user environment
  2. mount -t btrfs -o subvol=root,compress=zstd:1 UUID=<uuid of btrfs partition> /mnt
    then mount the other needed system file systems as
  3. for fs in proc sys run dev sys/firmware/efi/efivars ; do mount -o bind /$fs /mnt/$fs ; done
  4. chroot /mnt
  5. mount -a which will then mount the remaining file systems for the installed system according to the /etc/fstab entries.
  6. then perform the steps above to repair grub.

I have not tried systemd-nspawn but if that works as it appears from the man page then it may be possible to replace my steps 3 thru 5 with the systemd-nspawn command given above.

So the mount command could be /dev/sdaX /mnt -o subvol=@ instead? I should try this real quick in a VM while I’m here. Outside of that I do not see much difference in the commands :thinking:

---------------------------------------------------------------------------------------------------------------------------------------

Would you have some points to add, amend to this process? I stated earlier these are older commands and I did make assumptions as the Title does say F39. I do not know may people who frequent the forums to use my type of setup with systemd-boot , Most users are running Grub/standard installs.

I agree, and the instructions I give here seem correct for recovery as long as the live system is booted into the proper mode. Though it is important to note that systemd-boot is significantly different than grub boot. The standard fedora btrfs structure does not name a subvol as @ (I think that may be a systemd boot requirement). The root file system is in the subvol root instead.

Hey,

thanks for your comments and your help. I tried the following from above, but with Igrub2-install and grub2-mkconfig I got the errors below.

Do you have further tips for me?

SSD = nvme0n1
EFI Partition = nvme0n1p1
Boot Partition = nvme0n1p6
Fedora Partition = nvme0n1p7

mount /dev/nvme0n1p7 /mnt/
mount /dev/nvme0n1p6 /mnt/root/boot
mount /dev/nvme0n1p1 /mnt/root/boot/efi

mount -o bind /dev /mnt/root/dev
mount -o bind /sys /mnt/root/sys
mount -o bind /proc /mnt/root/proc
mount -o bind /run /mnt/root/run

chroot /mnt/root

mount -a

dnf reinstall grub2* shim

This works fine and I can access my local fedora files

grub2-install /dev/nvme0n1

Installing for x86_64-efi platform.
grub2-install: error: This utility should not be used for EFI platforms because it does not support UEFI Secure Boot. If you really wish to proceed, invoke the --force option.
Make sure Secure Boot is disabled before proceeding.

Secure Boot is disabled. If I try to use the --force command I also get an error:

Installing for x86_64-efi platform.
EFI variables are not supported on this system.
EFI variables are not supported on this system.
grub2-install: error: efibootmgr failed to register the boot entry: No such file or directory.

How can I install it for UEFI??

grub2-mkconfig -o /boot/grub2/grub.cfg

/usr/sbin/grub2-probe: error: cannot find a device for / (is /dev mounted?).

/dev is mounted. What is missing???

I assume the chroot command was a typo?

What is the output of mount while in the chroot environment? Does it show /dev properly mounted? Does it show all the required devices mounted?
/
/boot
/boot/efi
/home
/dev
/sys
/proc
/run
If you exit from the chroot environment all those should show an entry at /mnt/root/…

There also may be a discrepancy depending upon which live iso you are using to boot (kernel related). The release version of the iso had kernel 6.5.6. Your installed system likely has kernel 6.8.X (or maybe 6.7.X). Grub has been updated as well.

Booting from the live iso obtained from Index of /pub/alt/live-respins would give you an iso with (almost) current software and kernel which probably would assist with that grub2-mkconfig error since the booted kernel would be much closer to the updated kernel on the installed system (as would be almost all the other software). The respin iso as of today is dated 20240401.

Using Fedora 39 Workstation defaults, you get btrfs subvolumes for root and home. Here:

% df -lh
Filesystem      Size  Used Avail Use% Mounted on
/dev/nvme0n1p7  405G   93G  308G  24% /
devtmpfs        4.0M     0  4.0M   0% /dev
tmpfs           7.8G     0  7.8G   0% /dev/shm
efivarfs        256K  104K  148K  42% /sys/firmware/efi/efivars
tmpfs           3.1G  2.1M  3.1G   1% /run
tmpfs           7.8G   16K  7.8G   1% /tmp
/dev/nvme0n1p7  405G   93G  308G  24% /home
/dev/nvme0n1p6  974M  308M  599M  34% /boot
/dev/nvme0n1p1  646M  100M  547M  16% /boot/efi
tmpfs           1.6G  156K  1.6G   1% /run/user/1000

Note that root and home are both on /dev/nvme0n1p7 , but need to be mounted using -0 subvol=<name>... as shown above in @computersavvy’s post. Note that there is no need to mount the home subvolume.

Guys - you made my day. Thank you so much.

Together with your input and this Gist I found, I was able to restore GRUB :smiley:

su

mount -o subvol=root /dev/nvme0n1p7 /mnt/
mount /dev/nvme0n1p6 /mnt/boot
mount /dev/nvme0n1p1 /mnt/boot/efi

mount -o bind /dev /mnt/dev
mount -o bind /sys /mnt/sys
mount -o bind /proc /mnt/proc
mount -o bind /run /mnt/run
mount -o bind /sys/firmware/efi/efivars /mnt/sys/firmware/efi/efivars

chroot /mnt

mount -a

dnf reinstall shim-* grub2-*

grub2-mkconfig -o /boot/grub2/grub.cfg

efibootmgr -c -d /dev/nvme0n1p1 -p 1 -L Fedora -l '\EFI\fedora\shimx64.efi.efi'

After this I was able to boot Fedora via UEFI Boot Menu. Then I executed this and after restart, GRUB is shown again:

dnf reinstall shim-* grub2-*

grub2-mkconfig -o /boot/grub2/grub.cfg

Crazy challenge but again learned a lot about Linux :sweat_smile:

6 Likes

Fedora is a long time learning experience, even for those of us with more than 20 years experience. :nerd_face:

just open Microsoft_window boot efi and select Fadora as first boot option in Boot configration… this can be done by presing power button+volume down in surface laptop, your may be different ,just try this.

I Followed these steps, i had issues trying to dual boot two fedora installs but i’m posting this here because this post is one of the top search results on Google:

Delete the EFI partition. Fedora was the only OS in my drive anyways and I had messed with the EFI partition. I then recreated the EFI partition by doing an Ubuntu install.

Boot into a fedora live session using a USB stick. Open the terminal.

Then I followed the steps in your comment:

  1. su

  2. mount -t btrfs -o subvol=root,compress=zstd:1 UUID=<uuid of btrfs partition> /mnt

  3. for fs in proc sys run dev ; do mount -o bind /$fs /mnt/$fs ; done

  4. chroot /mnt

  5. mount -a

  6. I had an error in the fstab in my fedora install with the wrong UUID for the EFI partition so I edited the UUID in the fstab in my fedora install manually. I got the UUID from the gnome Disks app in the fedora live session, selecting my disk and then selecting the EFI partition

  7. mount -a again

Then I followed the steps here:

I have an EFI system.

2 Likes

Thank you a ton! :pray: :pray: This procedure worked for me as well. It was a huge and frustrating challenge, this whole thing after an automatic windows update made grub dysfunctional. :tired_face:

BTW there is a small typo in your instructions, it says shimx64.efi.efi.

In my case, I have an encrypted partition for linux so the beginning changed a little bit. Using the live image I had booted I had to first

sudo su
cryptsetup luksOpen /dev/nvme0n1p6 my_encrypted_volume
mount /dev/mapper/my_encrypted_volume /mnt/

I have no separate root partition so that sufficed, then I continued from there with mounting the /mnt/boot and /mnt/boot/efi.

Also in my case, I did not have to reinstall shim or grub twice like in your instructions.

You made my day!
I’m on fedora 41 and I had to adapt for the luks encrypted device but it worked like a charm!
For luks you have to mount the /dev/mapper/luks-codeofyourdevice intead of the physical partition and it will ask for the password, then it will be done.
Once done I had the possibility in bios to set fedora as boot efi device and that’s it.
Thanks

Appreciate your all help, i was able to get grub back to boot menu and even try to boot the system back.

But instead of boot for now i’m getting error

Verifying shim SBAT data failed: Security policy violation 
Something went seriously wrong: SBAT self-test failed: Security Policy Violation 

My secure boot is enabled, seems like i’m missing keys importing at some point.
any advice here?

I have a similar issue.
Windows 11 Update 23H2 broke my Dual Boot.
My laptop came with Windows 10 preinstalled and as I am primarly a Fedora user, I installed it and setup the Dual Boot.
Time after then I updated to version 11.

I very seldom use Windows. But last weekend I had to do a fiscal task that only runs on Windows. So I booted Windows and did the mentioned task.
But when going back to Fedora Linux, EFI menu wouldn’t show up and boot would load Windows only.

I have Secure Boot disabled. Here is proof of it.


On the other hand this is the boot order.

There are suggestions on how to fix the issue but from within Linux terminal. How can I do that if Fedora can´t be loaded?