Dual boot on separate disks and esps: grub not launching and seeing windows

I had a Windows installation on nvme ssd with efi partition and a clean ssd to install Ubuntu 22.04 on. I did everything as suggested in here i.e. turned off boot and esp flags on windows efi partition, then installed Ubuntu, installed gparted (for whatever reason it wasnt included), checked both flag back, run sudo update-grub but nothing happened after restart, it boot to ubuntu directly. Windows was installed on uefi mode. I run sudo os-prober and it does see windows. I also run sudo grub-install as it was suggested on one answer and update after but it didn’t help also. I turned off fast boot in Windows and run install and update again, didn’t help. What could be a problem? This is my disks partinoining lsblk:

sda           8:0    0 232,9G  0 disk 
├─sda1        8:1    0  18,6G  0 part [SWAP]
├─sda2        8:2    0   954M  0 part /boot
├─sda3        8:3    0   286M  0 part /boot/efi ###idk, maybe it's because I placed efi right after /boot partition when installing?
├─sda4        8:4    0  27,9G  0 part /home
└─sda5        8:5    0 185,1G  0 part /var/snap/firefox/common/host-hunspell
nvme0n1     259:0    0 476,9G  0 disk 
├─nvme0n1p1 259:1    0   100M  0 part ### this is efi windows
├─nvme0n1p2 259:2    0    16M  0 part 
├─nvme0n1p3 259:3    0 476,3G  0 part 
└─nvme0n1p4 259:4    0   533M  0 part 

Right now if I go to /boot folder there’s /efi and /grub folders, in /grub there’s grub.cfg, but in /efi/efi/ubuntu/ there’s also grubx64.efi with grub.cfg files, is it normal? What did I miss? Any help appreciated, thanks!
Right now grub is not even launching, just straight up boots to ubuntu. sudo grub-probe -t device /boot/grub shows /dev/sda2 but sudo debconf-show grub-pc shows empty in the line grub-pc/install_devices as it said here. I also tried running sudo grub-install dev/sda and it didn’t return any errors but also didn’t help. Output of sudo update-grub:

Sourcing file `/etc/default/grub'
Sourcing file `/etc/default/grub.d/init-select.cfg'
Generating grub configuration file ...
Found linux image: /boot/vmlinuz-6.2.0-32-generic
Found initrd image: /boot/initrd.img-6.2.0-32-generic
Found linux image: /boot/vmlinuz-5.19.0-32-generic
Found initrd image: /boot/initrd.img-5.19.0-32-generic
Memtest86+ needs a 16-bit boot, that is not available on EFI, exiting
Warning: os-prober will not be executed to detect other bootable partitions.
Systems on them will not be added to the GRUB boot configuration.
Check GRUB_DISABLE_OS_PROBER documentation entry.
Adding boot menu entry for UEFI Firmware Settings ...
Asked By: Arzybek


Okay, so after doing some research I figured out that:

  1. /efi/efi/ubuntu/grub.cfg just references /boot/grub/grub.cfg
  2. The issue was that grub wasn’t detecting windows because by default now os-prober is not used for whatever reason.
    So in order to fix that you need to add:
    GRUB_DISABLE_OS_PROBER=false to /etc/default/grub file and then run sudo update-grub, after that Windows will appear and grub menu will be shown.
Answered By: Arzybek