You missed mounting the fedora /boot/efi in that list (which probably should be /dev/nvme0n1p1 and identified by its UUID in /etc/fstab). Thus the grub update did not properly configure the boot.
Also, one must confirm that /boot/efi is properly identified in /etc/fstab and that the proper efi partition is being used for boot.
If you enter the uefi setup screen which partition is shown as booting in the boot order list there.?
Also, what is the output of efibootmgr?
Sorry my bad, I did mount the efi partition to /mnt/boot/efi too but I forgot to type it. But to make it sure I just did it again. This is all the step:
sudo mount -t btrfs -o subvol=root,compress=zstd:1 UUID=5d0ed25f-9df2-4575-bb37-a474cb3ae3d3 /mnt
sudo mount /dev/nvme1n1p5 /mnt/boot
sudo mount /dev/nvme1n1p1 /mnt/boot/efi
sudo mount --bind /dev /mnt/dev
sudo mount --bind /sys /mnt/sys
sudo mount --bind /run /mnt/run
sudo mount --bind /proc /mnt/proc
sudo chroot /mnt
grub2-mkconfig -o /boot/grub2/grub.cfg
And the output:
Generating grub configuration file …
Found Windows Boot Manager on /dev/nvme1n1p1@/EFI/Microsoft/Boot/bootmgfw.efi
Found Ubuntu 23.04 (23.04) on /dev/nvme1n1p7
Adding boot menu entry for UEFI Firmware Settings …
I do not understand why fedora would give that error for efibootmgr when the fstab shows an efi partition the same as ubuntu uses. It would appear this may be the underlying cause of fedora not being seen by grub.
Your output from grub2-mkconfig seems exactly what would be expected and as long as the bios can select the proper entry for grub it should work.
Ubuntu grub seems to have a problem booting fedora in several posts here, but fedora seems to not have problems with booting ubuntu once the system is set up properly and only uses the fedora grub.
One fix, though it seems extreme, may be to do a dnf reinstall grub2* shim* kernel* while booted into the chroot environment you show above. It would seem that one needs to get the bios to recognize fedora grub again.
I tried it but nothing changed. There is no Fedora entry in both Ubuntu and Fedora grub.
I tried grub2-mkconfig again but nothing changed too.
I just noticed there are a lot of warning when reinstall grub2 shim & kernel.
Here is the output log https://pastebin.com/EFQp6Vw3
OK I noticed something very weird. My pc has two Fedora grub menu.
If I access the grub from shimx64.efi it showed everything (Fedora entries, Ubuntu entries, Windows entry).
Once I’m inside Fedora, I ran grub customizer and all the Fedora entries disappeared:
If I may make a guess, grub from Ubuntu does not understand the bls snippets you will find in Fedora’s grub. Otherwise, the added snippet looks fine to me. It is likely you can only multi-boot Fedora and Ubuntu by first loading Fedora’s grub2, and from there refer to the Ubuntu grub.cfg.
Hmmm OK so my situation is normal
Somehow I feel like the /boot/grub2/grub.cfg loads only other OS entries as default.
EDIT: ok I found the answer. So it’s all about the BLS option.
When BLS support is enabled (GRUB_ENABLE_BLSCFG=true), GRUB will read the BLS entries and configuration files to generate the GRUB menu. This allows for easier management of multiple kernel and initramfs images, including options like fallback images and kernel parameters defined in BLS.
On the other hand, when BLS support is disabled (GRUB_ENABLE_BLSCFG=false), GRUB will not consider BLS entries and will use the traditional configuration files (such as /etc/default/grub and /etc/grub.d/*) to generate the GRUB menu.