A guide on how I did come to a proper working Win 11 / Fedora 40 dual boot setup with a right-sized EFI partition. Hope that helps :)
In most Windows/Linux dual-boot setups it is very likely you had first installed Win 11 (or any other Windows version) on your machine. Typically you'll then shrink down the existing Windows partition from the right end side to create some unpartitioned space for the Linux installation. This could easily be done with Windows built-in harddisk manager tool. Then install Linux in the free space and use GRUB2 as the bootloader.
I previously did this procedure again on a new PC having Win 11 preinstalled. Made up some space as described above and installed Fedora 40 with GRUB2. Works like a charm.
Well, everything was running just fine until... the first bigger system updates came in. Win 11 declined to execute an update with some irritating error message. Short Google search gave the hint: the EFI system partition (or ESP, see this ArchLinux article for a good overview) might be full. Looking up in the Windows harddisk manager tool it turned out that indeed it was at 99% and showed that the partition only was 100 MB in size :O
The reason for this small EFI partition size obviously comes from the preinstalled Win 11: Microsoft states that a Win 11 installation should have 100 MB EFI parition at least, so it comes deliverd with this sizing. When installing Fedora as the second OS on the machine, it uses the already existing EFI partition as it cannot simply 'move around' the following existings partitions to the right on the harddisk. Normally on a completely free HDD, the Fedora installer would create an EFI parition of 600 MB size.
To solve the issue, the EFI partition must be increased.
Before we go on with that, let's recap the partitioning scheme for every step so far. Assuming you have an ~1 TB HDD and use NTFS and btrfs as file systems (neither of that doesn't really matter for this guide).
Step 0: initial partition layout with preinstalled Win 11
Step 1: after freeing up some space for installing Linux (accomplished by shrinking the NTFS partition from the right with Windows harddisk manager)
Step 2: after Linux with GRUB2 have been installed
Before proceeding, please make sure you have the following in place:
- You must have the root password of your Fedora installation at hand. If you don't already have this, follow along the official guide for resetting the root password.
- Make sure you have
gparted
installed under Fedora. If it's not there it can be easily installed runningdnf install gparted
as root. - Make sure you have
Minitool Partition Wizard
installed under Windows. The free version can be downloaded here. Note: You can use any other Windows partitioning tool too, as long as you are able to (a) shrink an existing Windows partition from the left side and (b) extend an existing partition using unpartitioned space to the right with it.
In order to make some space for potential extension of the EFI partition, use the Minitool Partition Wizard to shrink the existing Windows partition from the left side. To be on the safe side, you should shrink it about 1 GB.
After applying the operation, the system must be restarted. On booting up again, Partition Wizard will perform the left-side shrinking - you will see it processing before Windows starts up. After that, you should be able to confirm this was done correctly by having a look in the harddisk manager tool - you should see unparitioned free space to the left of the Windows partition. Like this:
On some installations there is a small (16 MB) partition "Windows reserved" right next to the EFI partition. In order to extend the EFI partition to the right, this reserved partition should be moved to the most right position of the space freed up in step 1.
However, in my case it was not possible to do this with the Windows tool Partition Wizard. Instead I booted up Fedora and moved the "Windows reserved" partition to the right using gparted.
After that is done, reboot back to Windows. Partition scheme should now look like this:
Last step of changing the partitions is to use Partition Wizard again to increase the existing EFI partition using the freed-up unpartitioned space to its left. This could be done right away without rebooting. The partition scheme then looks like this:
Seems like everything is solved. But unfortunately it is not: rebooting the system, GRUB2 start menu shows up as usual but none of the entries - neither any of the Fedora nor the Windows one - can be booted :O
For trying to boot Win 11, it gave me an GRUB configuration error. When trying one of the Fedora entries, it started to load Fedora but ends up in GRUB emergency mode:
You are in emergency mode. After logging in, type "journalctl -xb" to view
system logs, "systemctl reboot" to reboot, "systemctl default" or "exit"
to boot into default mode.
Give root password for maintenance
(or press Control-D to continue):
To restore the Win 11 boot entry, start up the latest Fedora entry in the GRUB2 menu which will lead you to emergency mode as described above. Here, enter the root password and recreate the GRUB2 configuration by executing:
grub2-mkconfig -o /boot/grub2/grub.cfg
After that is done, you should be able to boot Win 11 from the GRUB2 start menu.
Last thing to do is to also repair the boot entries for Fedora. To do so, boot up the latest Fedora entry from GRUB2 and you'll again land in emergency mode. Enter the root password and execute the following command to figure out the (new) UUID of the /boot/efi
partition:
lsblk -fp
NAME FSTYPE FSVER LABEL UUID FSAVAIL FSUSE% MOUNTPOINTS
/dev/sda
├─/dev/sda1 vfat FAT32 C5B2-E64D 579,8M 3% /boot/efi
├─/dev/sda2 ext4 1.0 8b905b08-b0e3-4c23-bc99-00318c031f87 606M 31% /boot
└─/dev/sda3 btrfs fedora_localhost-live 07990934-14c1-4ec0-b740-0190f0d1dacc 774,1G 17% /home
/
/dev/zram0
Take the UUID - in this example C5B2-E64D
- and update your /etc/fstab
by searching for the line like UUID=XXXX-XXXX /boot/efi vfat umask=0077,shortname=winnt 0 2
and put in the new correct value after UUID=
. Save the file and rebbot the system.
You should now be all set!