Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Select an option

  • Save ammarshah/817721cd025ad930823ecdfef30f4b84 to your computer and use it in GitHub Desktop.

Select an option

Save ammarshah/817721cd025ad930823ecdfef30f4b84 to your computer and use it in GitHub Desktop.
Reinstall Fedora 44 GRUB in a dual-boot setup with Windows 11

Reinstall Fedora 44 GRUB in a dual-boot setup with Windows 11

Windows 11 updates sometimes hide or wipe the GRUB menu and your system boots directly into Windows. In this case, you can restore GRUB using a Fedora 44 Live USB.

  1. Create a Live USB: Use a tool like Rufus (if using Windows) or Fedora Media Writer (which is pre-installed in Fedora if you have it on some other machine) to flash Fedora 44 onto a USB drive.

  2. Boot from the USB: Restart your computer and press your manufacturer's Boot Menu Key (usually F12, F11, F10, or Esc) to select and boot from the USB in UEFI mode.

  3. Open the Terminal: Once inside the Live environment, open the terminal.

  4. Identify your Linux Root Partition: Type sudo fdisk -l to find the partition where Linux is installed (it will likely look something like /dev/sda2 or /dev/nvme0n1p2).

    Device         Start       End   Sectors   Size Type
    /dev/sda1       2048   1230847   1228800   600M EFI System
    /dev/sda2    1230848   1263615     32768    16M Microsoft reserved
    /dev/sda3    1263616 314236927 312973312 149.2G Microsoft basic data
    /dev/sda4  314236928 315834367   1597440   780M Windows recovery environment
    /dev/sda5  315834368 320028671   4194304     2G Linux filesystem
    /dev/sda6  320028672 500117503 180088832  85.9G Linux filesystem

    In my case, /dev/sda1 600MB is my EFI System partition (this is where the bootloader files live), /dev/sda5 2GB is my /boot partition and /dev/sda6 85.9GB is my, btrfs type, root (/) partition where Fedora is installed.

Caution

Make sure to identify your partitions and use them correctly in the next step.

  1. Mount the Btrfs Subvolumes & EFI:

    # Mount the Fedora root subvolume
    sudo mount -o subvol=root /dev/sda6 /mnt
    
    # Mount your separate boot partition
    sudo mount /dev/sda5 /mnt/boot
    
    # Mount your EFI partition
    sudo mount /dev/sda1 /mnt/boot/efi
    
    # Bind critical virtual file systems
    for i in /dev /dev/pts /proc /sys /run; do sudo mount -B $i /mnt$i; done
    
    # Bind EFI variables so Fedora can fix your motherboard's boot list
    sudo mount -o bind /sys/firmware/efi/efivars /mnt/sys/firmware/efi/efivars
  2. Chroot into your Fedora System: Switch your terminal's operational scope into your installed system.

    sudo chroot /mnt
  3. Wipe the Broken Boot Files and Reinstall: Wiping the broken GRUB and shim config files will trigger Fedora to cleanly recreate them upon package reinstallation.

    # Remove corrupted configurations (Fedora automatically recreates these)
    rm -f /boot/efi/EFI/fedora/grub.cfg
    rm -f /boot/grub2/grub.cfg
    
    # Reinstall the correct boot loader packages
    dnf reinstall grub2-efi grub2-common shim

Caution

Fedora has a strict rule for UEFI systems: Never use the grub-install command. It breaks Fedora's shim signed boot files. Instead, we must let Fedora’s package manager (dnf) rebuild the EFI files correctly.

  1. Re-generate the GRUB Config Menu: Create a clean, updated boot list that probes for both Fedora 44 and Windows 11.

    grub2-mkconfig -o /boot/grub2/grub.cfg
  2. Clean Exit and Reboot: Exit the chroot safely, flush the changes to the disk, and restart your PC.

    exit
    sync
    sudo reboot

Note

Use systemctl reboot -i if you get an error running sudo reboot command.

The GRUB menu should now reappear.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment