I installed kali alongside ubuntu but I formatted the kali drive.
I reinstalled grub using the following command:
grub-install /dev/sda
Now when I boot, I get No such partition
error.
I did the following steps in grub rescue console:
set prefix=(hd0,2)/boot/grub
set root=(hd0,2)
insmod normal
normal
After that it successfully booted into the Ubuntu installation but I have to do it every time device boots up.
How to fix this problem permanently?